> ftmac100_rx_packet() uses __pskb_pull_tail() to pull either the
> Ethernet header or, for small frames, the whole frame into the skb
> head, and ignores the return value.  If that pull ever failed,
> eth_type_trans() would find less than ETH_HLEN in the head and BUG()
> in __skb_pull().
> 
> It doesn't fail today because the skb is freshly allocated, isn't
> shared and has room in the head, but that's only true because of how
> this driver allocates.  Use pskb_may_pull() for the header and
> __skb_linearize() for small frames, which is what the two pulls are
> doing, and drop the frame if either fails.
> 
> Assisted-by: LLM
> Signed-off-by: Josef Bacik <[email protected]>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/20261008-b4-pskb-pull-tail-drivers-v2-0-8f2bd9bee...@toxicpanda.com?part=2

Reply via email to