diff options
author | 2020-05-05 16:28:53 +0800 | |
---|---|---|
committer | 2020-05-05 13:18:11 -0600 | |
commit | 7f13657d141346125f4d0bb93eab4777f40c406e (patch) | |
tree | ee786539b1ab574f47c0f9dd9c406a36176cc6c8 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | io_uring: fix mismatched finish_wait() calls in io_uring_cancel_files() (diff) | |
download | linux-dev-7f13657d141346125f4d0bb93eab4777f40c406e.tar.xz linux-dev-7f13657d141346125f4d0bb93eab4777f40c406e.zip |
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 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions