Re: [PATCH net] net: bridge: fix skb leak of reinjected link-local frames

From: Xia Yan

Date: Mon Nov 16 2026 - 22:43:32 EST


On 11/15/26 23:32, Daniel Wade wrote:
> br_handle_frame() passes the link-local frames it neither forwards nor
> delivers (01:80:c2:00:00:02 to 0d and 0f, unless set in the group
> forward mask) through NF_HOOK() at NF_BR_LOCAL_IN. Since commit
> 3b2e2904deb3 ("net: bridge: fix per-port af_packet sockets") the okfn
> only learns the source and returns 1, which becomes RX_HANDLER_PASS.

Before that commit the okfn called br_pass_frame_up() and the frame
was consumed on reinjection. The leak starts at 3b2e2904deb3.

The queue paths hold up too. Both fail-open exits in
__nfqnl_enqueue_packet() reinject NF_ACCEPT inside the enqueue call,
and nf_queue() still reports the frame as queued. nf_hook() returns
0, br_handle_frame() answers RX_HANDLER_CONSUMED, and the single free
is the kfree_skb() in the new okfn. QUEUE_BYPASS just resumes the
hook walk. If the remaining hooks accept, nf_hook() returns 1 and the
frame is passed up from br_handle_frame() itself. The branch now
matches the 0x00 and 0x0e cases above it, including the *pskb
assignment after skb_share_check().

No other bridge okfn leaves the skb with the caller. Delivered frames
reach netif_receive_skb() through br_pass_frame_up() and forwarding
goes through br_forward_finish(). The link-local hook was the
exception.

Reviewed-by: Xia Yan <yanxia@xxxxxxxxxxxxxxxxxxxx>