diff --git a/patches.suse/veth-Ensure-eth-header-is-in-skb-s-linear-part.patch b/patches.suse/veth-Ensure-eth-header-is-in-skb-s-linear-part.patch new file mode 100644 index 0000000..1792c70 --- /dev/null +++ b/patches.suse/veth-Ensure-eth-header-is-in-skb-s-linear-part.patch @@ -0,0 +1,71 @@ +From b6fa694ac2cf0b372afc650855a595784e1d1f75 Mon Sep 17 00:00:00 2001 +From: Guillaume Nault +Date: Wed, 6 Apr 2022 16:18:54 +0200 +Subject: [PATCH 8/8] veth: Ensure eth header is in skb's linear part +Git-commit: 726e2c5929de841fdcef4e2bf995680688ae1b87 +Patch-mainline: v5.18-rc3 +References: git-fixes + +After feeding a decapsulated packet to a veth device with act_mirred, +skb_headlen() may be 0. But veth_xmit() calls __dev_forward_skb(), +which expects at least ETH_HLEN byte of linear data (as +__dev_forward_skb2() calls eth_type_trans(), which pulls ETH_HLEN bytes +unconditionally). + +Use pskb_may_pull() to ensure veth_xmit() respects this constraint. + +kernel BUG at include/linux/skbuff.h:2328! +RIP: 0010:eth_type_trans+0xcf/0x140 +Call Trace: + + __dev_forward_skb2+0xe3/0x160 + veth_xmit+0x6e/0x250 [veth] + dev_hard_start_xmit+0xc7/0x200 + __dev_queue_xmit+0x47f/0x520 + ? skb_ensure_writable+0x85/0xa0 + ? skb_mpls_pop+0x98/0x1c0 + tcf_mirred_act+0x442/0x47e [act_mirred] + tcf_action_exec+0x86/0x140 + fl_classify+0x1d8/0x1e0 [cls_flower] + ? dma_pte_clear_level+0x129/0x1a0 + ? dma_pte_clear_level+0x129/0x1a0 + ? prb_fill_curr_block+0x2f/0xc0 + ? skb_copy_bits+0x11a/0x220 + __tcf_classify+0x58/0x110 + tcf_classify_ingress+0x6b/0x140 + __netif_receive_skb_core.constprop.0+0x47d/0xfd0 + ? __iommu_dma_unmap_swiotlb+0x44/0x90 + __netif_receive_skb_one_core+0x3d/0xa0 + netif_receive_skb+0x116/0x170 + be_process_rx+0x22f/0x330 [be2net] + be_poll+0x13c/0x370 [be2net] + __napi_poll+0x2a/0x170 + net_rx_action+0x22f/0x2f0 + __do_softirq+0xca/0x2a8 + __irq_exit_rcu+0xc1/0xe0 + common_interrupt+0x83/0xa0 + +Fixes: e314dbdc1c0d ("[NET]: Virtual ethernet device driver.") +Signed-off-by: Guillaume Nault +Signed-off-by: David S. Miller +Signed-off-by: Denis Kirjanov +--- + drivers/net/veth.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/net/veth.c b/drivers/net/veth.c +index 287f996e7095..f1c402cd4e99 100644 +--- a/drivers/net/veth.c ++++ b/drivers/net/veth.c +@@ -195,7 +195,7 @@ static netdev_tx_t veth_xmit(struct sk_buff *skb, struct net_device *dev) + + rcu_read_lock(); + rcv = rcu_dereference(priv->peer); +- if (unlikely(!rcv)) { ++ if (unlikely(!rcv) || !pskb_may_pull(skb, ETH_HLEN)) { + kfree_skb(skb); + goto drop; + } +-- +2.16.4 + diff --git a/series.conf b/series.conf index db02151..b0e3ebb 100644 --- a/series.conf +++ b/series.conf @@ -61163,6 +61163,7 @@ patches.suse/Revert-NFSv4-Handle-the-special-Linux-file-open-acce.patch patches.suse/NFSv4-fix-open-failure-with-O_ACCMODE-flag.patch patches.suse/SUNRPC-Handle-low-memory-situations-in-call_status.patch + patches.suse/veth-Ensure-eth-header-is-in-skb-s-linear-part.patch patches.suse/powerpc-perf-Fix-power9-event-alternatives.patch patches.suse/0014-video-fbdev-udlfb-properly-check-endpoint-type.patch patches.suse/bnx2x-fix-napi-API-usage-sequence.patch