summaryrefslogtreecommitdiff
path: root/fs/splice.c
diff options
context:
space:
mode:
authorXiaoguang Wang <xiaoguang.wang@linux.alibaba.com>2020-05-05 16:28:53 +0800
committerJens Axboe <axboe@kernel.dk>2020-05-05 13:18:11 -0600
commit7f13657d141346125f4d0bb93eab4777f40c406e (patch)
treeee786539b1ab574f47c0f9dd9c406a36176cc6c8 /fs/splice.c
parentd8f1b9716cfd1a1f74c0fedad40c5f65a25aa208 (diff)
downloadlinux-7f13657d141346125f4d0bb93eab4777f40c406e.tar.gz
io_uring: handle -EFAULT properly in io_uring_setup()
If copy_to_user() in io_uring_setup() failed, we'll leak many kernel resources, which will be recycled until process terminates. This bug can be reproduced by using mprotect to set params to PROT_READ. To fix this issue, refactor io_uring_create() a bit to add a new 'struct io_uring_params __user *params' parameter and move the copy_to_user() in io_uring_setup() to io_uring_setup(), if copy_to_user() failed, we can free kernel resource properly. Suggested-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Xiaoguang Wang <xiaoguang.wang@linux.alibaba.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/splice.c')
0 files changed, 0 insertions, 0 deletions