]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: make sure openat/openat2 honor rlimit nofile
authorJens Axboe <axboe@kernel.dk>
Fri, 20 Mar 2020 01:23:18 +0000 (19:23 -0600)
committerJens Axboe <axboe@kernel.dk>
Fri, 20 Mar 2020 14:47:27 +0000 (08:47 -0600)
commit9213ac4e70155d84db649dd9c79236e06dd33adb
treef8fe39d2782257cac15532721624a766f670442e
parentfcfe34c71073c19235d17891a24dce02dee9fa66
io_uring: make sure openat/openat2 honor rlimit nofile

Dmitry reports that a test case shows that io_uring isn't honoring a
modified rlimit nofile setting. get_unused_fd_flags() checks the task
signal->rlimi[] for the limits. As this isn't easily inheritable,
provide a __get_unused_fd_flags() that takes the value instead. Then we
can grab it when the request is prepared (from the original task), and
pass that in when we do the async part part of the open.

Reported-by: Dmitry Kadashev <dkadashev@gmail.com>
Tested-by: Dmitry Kadashev <dkadashev@gmail.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/file.c
fs/io_uring.c
include/linux/file.h