]> git.baikalelectronics.ru Git - kernel.git/commit
net, bonding: Disallow vlan+srcmac with XDP
authorJussi Maki <joamaki@gmail.com>
Thu, 12 Aug 2021 14:52:41 +0000 (14:52 +0000)
committerJakub Kicinski <kuba@kernel.org>
Fri, 13 Aug 2021 21:03:28 +0000 (14:03 -0700)
commitf2f0a51ca38db5e994b34c097f023557744f2e41
treea0f33adadc502dabf2a903ab8b0ebe2ef928de77
parentf5cb65ba4d42845a9c494879d47436b23d78c291
net, bonding: Disallow vlan+srcmac with XDP

The new vlan+srcmac xmit policy is not implementable with XDP since
in many cases the 802.1Q payload is not present in the packet. This
can be for example due to hardware offload or in the case of veth
due to use of skbuffs internally.

This also fixes the NULL deref with the vlan+srcmac xmit policy
reported by Jonathan Toppins by additionally checking the skb
pointer.

Fixes: e39a2a5a4e36 ("net, bonding: Refactor bond_xmit_hash for use with xdp_buff")
Reported-by: Jonathan Toppins <jtoppins@redhat.com>
Signed-off-by: Jussi Maki <joamaki@gmail.com>
Reviewed-by: Jonathan Toppins <jtoppins@redhat.com>
Link: https://lore.kernel.org/r/20210812145241.12449-1-joamaki@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/bonding/bond_main.c