]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
io_uring: don't check unrelated req->open.how in accept request
authorJens Axboe <axboe@kernel.dk>
Mon, 14 Mar 2022 23:26:19 +0000 (17:26 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 11:57:38 +0000 (13:57 +0200)
commit78efdec65b804452a4434da7557b668dc23ee75a
treefee5a3a16eb2bc5e91af3e3109256a8e6aff7a23
parent35de7727e6d4a3fabf8ed483a37733fed4abb62a
io_uring: don't check unrelated req->open.how in accept request

[ Upstream commit adf3a9e9f556613197583a1884f0de40a8bb6fb9 ]

Looks like a victim of too much copy/paste, we should not be looking
at req->open.how in accept. The point is to check CLOEXEC and error
out, which we don't invalid direct descriptors on exec. Hence any
attempt to get a direct descriptor with CLOEXEC is invalid.

No harm is done here, as req->open.how.flags overlaps with
req->accept.flags, but it's very confusing and might change if either of
those command structs are modified.

Fixes: aaa4db12ef7b ("io_uring: accept directly into fixed file table")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/io_uring.c