]> git.baikalelectronics.ru Git - kernel.git/commit
__netif_receive_skb_core: pass skb by reference
authorBoris Sukholitko <boris.sukholitko@broadcom.com>
Tue, 19 May 2020 07:32:37 +0000 (10:32 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 19 May 2020 22:38:00 +0000 (15:38 -0700)
commit7e1c1398a19484c1e064ac13d30c6328e3f3b5f2
treea72795d0d8594c6b85681104a4240b9e5fc9c1a0
parent28bf0ee25a47af8d5bbf025f5aeed14cb690edf1
__netif_receive_skb_core: pass skb by reference

__netif_receive_skb_core may change the skb pointer passed into it (e.g.
in rx_handler). The original skb may be freed as a result of this
operation.

The callers of __netif_receive_skb_core may further process original skb
by using pt_prev pointer returned by __netif_receive_skb_core thus
leading to unpleasant effects.

The solution is to pass skb by reference into __netif_receive_skb_core.

v2: Added Fixes tag and comment regarding ppt_prev and skb invariant.

Fixes: 2aadc52730f9 ("net: core: propagate SKB lists through packet_type lookup")
Signed-off-by: Boris Sukholitko <boris.sukholitko@broadcom.com>
Acked-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev.c