]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
af_unix: Don't call skb_get() for OOB skb.
authorKuniyuki Iwashima <kuniyu@amazon.com>
Fri, 16 Aug 2024 23:39:21 +0000 (16:39 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 6 Jul 2025 08:57:59 +0000 (10:57 +0200)
commit5bbe3f018c3d51e7294c0eb73af6c2a2cf84bbaa
treef1b24590d7bd5fe8a91842260fcec48a6698ec04
parent35e0a4d1d8380654284b7e48cbc297b00b1409ec
af_unix: Don't call skb_get() for OOB skb.

[ Upstream commit 8594d9b85c07f05e431bd07e895c2a3ad9b85d6f ]

Since introduced, OOB skb holds an additional reference count with no
special reason and caused many issues.

Also, kfree_skb() and consume_skb() are used to decrement the count,
which is confusing.

Let's drop the unnecessary skb_get() in queue_oob() and corresponding
kfree_skb(), consume_skb(), and skb_unref().

Now unix_sk(sk)->oob_skb is just a pointer to skb in the receive queue,
so special handing is no longer needed in GC.

Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Link: https://patch.msgid.link/20240816233921.57800-1-kuniyu@amazon.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Stable-dep-of: 32ca245464e1 ("af_unix: Don't leave consecutive consumed OOB skbs.")
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/unix/af_unix.c
net/unix/garbage.c