]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: don't use 'fd' for openat/openat2/statx
authorJens Axboe <axboe@kernel.dk>
Thu, 7 May 2020 20:56:15 +0000 (14:56 -0600)
committerJens Axboe <axboe@kernel.dk>
Thu, 7 May 2020 20:56:15 +0000 (14:56 -0600)
commit147d342c88f3ddea1433e50e3ebdb8e596ee847f
treefdffa1a1cf9a869305c5759ef1aa8e36d2ece1db
parente934236721dc79a70cffb07db120a6f367c41bd4
io_uring: don't use 'fd' for openat/openat2/statx

We currently make some guesses as when to open this fd, but in reality
we have no business (or need) to do so at all. In fact, it makes certain
things fail, like O_PATH.

Remove the fd lookup from these opcodes, we're just passing the 'fd' to
generic helpers anyway. With that, we can also remove the special casing
of fd values in io_req_needs_file(), and the 'fd_non_neg' check that
we have. And we can ensure that we only read sqe->fd once.

This fixes O_PATH usage with openat/openat2, and ditto statx path side
oddities.

Cc: stable@vger.kernel.org: # v5.6
Reported-by: Max Kellermann <mk@cm4all.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c