linux/net/unix
Kuniyuki Iwashima b5c0898807 af_unix: Remove dead code in unix_stream_read_generic().
When splice() support was added in commit 2b514574f7 ("net:
af_unix: implement splice for stream af_unix sockets"), we had
to release unix_sk(sk)->readlock (current iolock) before calling
splice_to_pipe().

Due to the unlock, commit 73ed5d25dc ("af-unix: fix use-after-free
with concurrent readers while splicing") added a safeguard in
unix_stream_read_generic(); we had to bump the skb refcount before
calling ->recv_actor() and then check if the skb was consumed by a
concurrent reader.

However, the pipe side locking was refactored, and since commit
25869262ef ("skb_splice_bits(): get rid of callback"), we can
call splice_to_pipe() without releasing unix_sk(sk)->iolock.

Now, the skb is always alive after the ->recv_actor() callback,
so let's remove the unnecessary drop_skb logic.

This is mostly the revert of commit 73ed5d25dc ("af-unix: fix
use-after-free with concurrent readers while splicing").

Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Link: https://lore.kernel.org/r/20240529144648.68591-1-kuniyu@amazon.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-06-01 16:28:55 -07:00
..
af_unix.c af_unix: Remove dead code in unix_stream_read_generic(). 2024-06-01 16:28:55 -07:00
diag.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-02-01 15:12:37 -08:00
garbage.c af_unix: Fix garbage collection of embryos carrying OOB with SCM_RIGHTS 2024-05-21 13:42:02 +02:00
Kconfig af_unix: Remove CONFIG_UNIX_SCM. 2024-01-31 16:41:16 -08:00
Makefile af_unix: Remove CONFIG_UNIX_SCM. 2024-01-31 16:41:16 -08:00
sysctl_net_unix.c net: Remove the now superfluous sentinel elements from ctl_table array 2024-05-03 13:29:41 +01:00
unix_bpf.c bpf: sockmap, fix proto update hook to avoid dup calls 2024-01-03 16:50:06 -08:00