net: bridge: xmit: make sure we have at least eth header len bytes
Subsystems (4)
cover net: bridge: xmit: make sure we have at least eth header len bytes
From: Randy MacLeod <[email protected]>
This is my first commit to -stable so I'm going to carefully explain what I've done. I work on the Yocto Project and I have done some work on the Linux network stack a long time ago so I'm not quite a complete newbie.
I took the commit found here:
https://lore.kernel.org/stable/[email protected]/
and backported as per my commit log:
Based on above commit but simplified since pskb_may_pull_reason() does not exist until 6.1.
I also trimmed the original commit log of the "Tested by dropwatch" section as well as the full stack trace since that may have changed in 5.10/5.15 and It compiles fine for 5.10 and 5.15 but I have not tested with dropwatch since the patch is just dropping short xmit packets for bridging.
Finally, since the patch is much simpler than the original, I've removed the original patch author's SOB line.
Please let me know if any of this is not what y'all'd like to see.
Randy MacLeod (1):
net: bridge: xmit: make sure we have at least eth header len bytes
net/bridge/br_device.c | 5 +++++ 1 file changed, 5 insertions(+)
base-commit: 5a8fa04b2a4de1d52be4a04690dcb52ac7998943
Signature · 1 line
2.34.1
PATCH 1/1 net: bridge: xmit: make sure we have at least eth header len bytes
From: Randy MacLeod <[email protected]>
[ Upstream commit 8bd67ebb50c0145fd2ca8681ab65eb7e8cde1afc ]
Based on above commit but simplified since pskb_may_pull_reason() does not exist until 6.1.
syzbot triggered an uninit value[1] error in bridge device's xmit path by sending a short (less than ETH_HLEN bytes) skb. To fix it check if we can actually pull that amount instead of assuming.
--- net/bridge/br_device.c | 5 +++++ 1 file changed, 5 insertions(+)
net/bridge/br_device.c +5 -0
@@ -36,6 +36,11 @@ netdev_tx_t br_dev_xmit(struct sk_buff *skb, struct net_device *dev)const unsigned char *dest;u16 vid =0 ; +if (unlikely (!pskb_may_pull (skb,ETH_HLEN ))) { +kfree_skb (skb); +return NETDEV_TX_OK ; + } +memset (skb->cb,0 ,sizeof (struct br_input_skb_cb ));rcu_read_lock ();
Signature · 1 line
2.34.1