]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
bpf, sockmap: Remove skb_orphan and let normal skb_kfree do cleanup
authorJohn Fastabend <john.fastabend@gmail.com>
Fri, 9 Oct 2020 18:37:35 +0000 (11:37 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Oct 2020 09:07:49 +0000 (10:07 +0100)
commit733dcb4149ffbf02acd2c09ab54357e050929a95
treefc536123cd4eb5727f488fae3b9318860bc1009d
parent4cdfe55c067b457c69316d9c7cba3fd0f88039e3
bpf, sockmap: Remove skb_orphan and let normal skb_kfree do cleanup

[ Upstream commit 10d58d006356a075a7b056e0f6502db416d1a261 ]

Calling skb_orphan() is unnecessary in the strp rcv handler because the skb
is from a skb_clone() in __strp_recv. So it never has a destructor or a
sk assigned. Plus its confusing to read because it might hint to the reader
that the skb could have an sk assigned which is not true. Even if we did
have an sk assigned it would be cleaner to simply wait for the upcoming
kfree_skb().

Additionally, move the comment about strparser clone up so its closer to
the logic it is describing and add to it so that it is more complete.

Fixes: 604326b41a6fb ("bpf, sockmap: convert to generic sk_msg interface")
Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/160226865548.5692.9098315689984599579.stgit@john-Precision-5820-Tower
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/core/skmsg.c