]> git.ipfire.org Git - thirdparty/linux.git/commit
io_uring/af_unix: disable sending io_uring over sockets
authorPavel Begunkov <asml.silence@gmail.com>
Wed, 6 Dec 2023 13:55:19 +0000 (13:55 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 9 Dec 2023 21:20:33 +0000 (21:20 +0000)
commit69db702c83874fbaa2a51af761e35a8e5a593b95
tree4083f92ab0c7a2606d971b152d0d33c8c266feb9
parent15319a4e8ee4b098118591c6ccbd17237f841613
io_uring/af_unix: disable sending io_uring over sockets

File reference cycles have caused lots of problems for io_uring
in the past, and it still doesn't work exactly right and races with
unix_stream_read_generic(). The safest fix would be to completely
disallow sending io_uring files via sockets via SCM_RIGHT, so there
are no possible cycles invloving registered files and thus rendering
SCM accounting on the io_uring side unnecessary.

Cc: stable@vger.kernel.org
Fixes: 0091bfc81741b ("io_uring/af_unix: defer registered files gc to io_uring release")
Reported-and-suggested-by: Jann Horn <jannh@google.com>
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Acked-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
io_uring/rsrc.h
net/core/scm.c