]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: statx must grab the file table for valid fd
authorJens Axboe <axboe@kernel.dk>
Mon, 27 Apr 2020 16:41:22 +0000 (10:41 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 27 Apr 2020 16:41:22 +0000 (10:41 -0600)
commit396ee0f3d278ea74e7098dda9806a4b8f59d41b8
tree1c5ab65cdde9b64c1514218ae4820b57608437cd
parentb04fea22df5a4189c419ed381dcf4e8d36c2f4f3
io_uring: statx must grab the file table for valid fd

Clay reports that OP_STATX fails for a test case with a valid fd
and empty path:

 -- Test 0: statx:fd 3: SUCCEED, file mode 100755
 -- Test 1: statx:path ./uring_statx: SUCCEED, file mode 100755
 -- Test 2: io_uring_statx:fd 3: FAIL, errno 9: Bad file descriptor
 -- Test 3: io_uring_statx:path ./uring_statx: SUCCEED, file mode 100755

This is due to statx not grabbing the process file table, hence we can't
lookup the fd in async context. If the fd is valid, ensure that we grab
the file table so we can grab the file from async context.

Cc: stable@vger.kernel.org # v5.6
Reported-by: Clay Harris <bugs@claycon.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c