https://github.com/torvalds/linux
Revision 7f13657d141346125f4d0bb93eab4777f40c406e authored by Xiaoguang Wang on 05 May 2020, 08:28:53 UTC, committed by Jens Axboe on 05 May 2020, 19:18:11 UTC
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>
1 parent d8f1b97
History
Tip revision: 7f13657d141346125f4d0bb93eab4777f40c406e authored by Xiaoguang Wang on 05 May 2020, 08:28:53 UTC
io_uring: handle -EFAULT properly in io_uring_setup()
Tip revision: 7f13657
File Mode Size
Documentation
LICENSES
arch
block
certs
crypto
drivers
fs
include
init
ipc
kernel
lib
mm
net
samples
scripts
security
sound
tools
usr
virt
.clang-format -rw-r--r-- 15.8 KB
.cocciconfig -rw-r--r-- 59 bytes
.get_maintainer.ignore -rw-r--r-- 71 bytes
.gitattributes -rw-r--r-- 62 bytes
.gitignore -rw-r--r-- 1.7 KB
.mailmap -rw-r--r-- 15.1 KB
COPYING -rw-r--r-- 496 bytes
CREDITS -rw-r--r-- 97.4 KB
Kbuild -rw-r--r-- 1.3 KB
Kconfig -rw-r--r-- 595 bytes
MAINTAINERS -rw-r--r-- 539.4 KB
Makefile -rw-r--r-- 59.9 KB
README -rw-r--r-- 727 bytes

README

back to top