]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
llc: Don't drop packet from non-root netns.
authorKuniyuki Iwashima <kuniyu@amazon.com>
Tue, 18 Jul 2023 17:41:51 +0000 (10:41 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jul 2023 06:47:02 +0000 (08:47 +0200)
commitc17b4ec9cc38596bc0d8508d450344823be2c79e
tree9b425ddf3cd77c8e23e99c93dd7cf2e19d2693f3
parent2400ae8fd86d0dfb67bdff6e206b090b0606bbf4
llc: Don't drop packet from non-root netns.

[ Upstream commit 6631463b6e6673916d2481f692938f393148aa82 ]

Now these upper layer protocol handlers can be called from llc_rcv()
as sap->rcv_func(), which is registered by llc_sap_open().

  * function which is passed to register_8022_client()
    -> no in-kernel user calls register_8022_client().

  * snap_rcv()
    `- proto->rcvfunc() : registered by register_snap_client()
       -> aarp_rcv() and atalk_rcv() drop packets from non-root netns

  * stp_pdu_rcv()
    `- garp_protos[]->rcv() : registered by stp_proto_register()
       -> garp_pdu_rcv() and br_stp_rcv() are netns-aware

So, we can safely remove the netns restriction in llc_rcv().

Fixes: e730c15519d0 ("[NET]: Make packet reception network namespace safe")
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/llc/llc_input.c