linux/drivers/net
Eric Dumazet 9d570741ae vxlan: do not feed vxlan_vnifilter_dump_dev with non vxlan devices
vxlan_vnifilter_dump_dev() assumes it is called only
for vxlan devices. Make sure it is the case.

BUG: KASAN: slab-out-of-bounds in vxlan_vnifilter_dump_dev+0x9a0/0xb40 drivers/net/vxlan/vxlan_vnifilter.c:349
Read of size 4 at addr ffff888060d1ce70 by task syz-executor.3/17662

CPU: 0 PID: 17662 Comm: syz-executor.3 Tainted: G        W         5.17.0-syzkaller-12888-g77c9387c0c5b #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
 print_address_description.constprop.0.cold+0xeb/0x495 mm/kasan/report.c:313
 print_report mm/kasan/report.c:429 [inline]
 kasan_report.cold+0xf4/0x1c6 mm/kasan/report.c:491
 vxlan_vnifilter_dump_dev+0x9a0/0xb40 drivers/net/vxlan/vxlan_vnifilter.c:349
 vxlan_vnifilter_dump+0x3ff/0x650 drivers/net/vxlan/vxlan_vnifilter.c:428
 netlink_dump+0x4b5/0xb70 net/netlink/af_netlink.c:2270
 __netlink_dump_start+0x647/0x900 net/netlink/af_netlink.c:2375
 netlink_dump_start include/linux/netlink.h:245 [inline]
 rtnetlink_rcv_msg+0x70c/0xb80 net/core/rtnetlink.c:5953
 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2496
 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline]
 netlink_unicast+0x543/0x7f0 net/netlink/af_netlink.c:1345
 netlink_sendmsg+0x904/0xe00 net/netlink/af_netlink.c:1921
 sock_sendmsg_nosec net/socket.c:705 [inline]
 sock_sendmsg+0xcf/0x120 net/socket.c:725
 ____sys_sendmsg+0x6e2/0x800 net/socket.c:2413
 ___sys_sendmsg+0xf3/0x170 net/socket.c:2467
 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2496
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0x80 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f87b8e89049

Fixes: f9c4bb0b24 ("vxlan: vni filtering support on collect metadata device")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Acked-by: Roopa Prabhu <roopa@nvidia.com>
Link: https://lore.kernel.org/r/20220330194643.2706132-1-eric.dumazet@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-03-31 08:53:01 -07:00
..
appletalk
arcnet net: arcnet: com20020: Fix null-ptr-deref in com20020pci_probe() 2022-03-03 10:29:13 +00:00
bonding net: add per-cpu storage and net->core_stats 2022-03-11 23:17:24 -08:00
caif net: caif: Use netif_rx(). 2022-03-04 12:02:19 +00:00
can can: gs_usb: gs_make_candev(): fix memory leak for devices with extended bit timing configuration 2022-03-31 09:55:27 +02:00
dsa net: dsa: felix: fix possible NULL pointer dereference 2022-03-30 12:07:38 -07:00
ethernet net: hns3: fix software vlan talbe of vlan 0 inconsistent with hardware 2022-03-31 11:39:59 +02:00
fddi
fjes
hamradio hamradio: Fix wrong assignment of 'bbc->cfg.loopback' 2022-03-16 19:17:49 -07:00
hippi
hyperv Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-03-17 13:56:58 -07:00
ieee802154 spi: Updates for v5.18 2022-03-21 18:33:57 -07:00
ipa net: ipa: use struct_size() for the interconnect array 2022-03-11 22:50:07 -08:00
ipvlan net: add per-cpu storage and net->core_stats 2022-03-11 23:17:24 -08:00
mctp mctp: serial: Use netif_rx(). 2022-03-06 11:05:31 +00:00
mdio net: mdio: mscc-miim: add lan966x internal phy reset support 2022-03-21 22:33:02 -07:00
netdevsim devlink: hold the instance lock during eswitch_mode callbacks 2022-03-21 14:11:38 +00:00
pcs
phy net: phy: broadcom: Fix brcm_fet_config_init() 2022-03-25 16:59:21 -07:00
plip slip/plip: Use netif_rx(). 2022-03-06 11:05:31 +00:00
ppp
slip slip/plip: Use netif_rx(). 2022-03-06 11:05:31 +00:00
team teaming: deliver link-local packets with the link they arrive on 2022-02-18 11:40:52 +00:00
usb net: usb: ax88179_178a: add Allied Telesis AT-UMCs 2022-03-24 18:32:14 -07:00
vmxnet3
vxlan vxlan: do not feed vxlan_vnifilter_dump_dev with non vxlan devices 2022-03-31 08:53:01 -07:00
wan Networking changes for 5.18. 2022-03-24 13:13:26 -07:00
wireguard wireguard: socket: ignore v6 endpoints when ipv6 is disabled 2022-03-30 19:14:09 -07:00
wireless iwlwifi: mvm: Don't fail if PPAG isn't supported 2022-03-22 16:18:27 -07:00
wwan Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-03-23 10:53:49 -07:00
xen-netback Revert "xen-netback: Check for hotplug-status existence before watching" 2022-02-24 08:58:37 -08:00
Kconfig
LICENSE.SRC
Makefile vxlan: move to its own directory 2022-03-01 08:38:01 +00:00
Space.c
amt.c
bareudp.c bareudp: use ipv6_mod_enabled to check if IPv6 enabled 2022-03-16 19:16:57 -07:00
dummy.c
eql.c
geneve.c net: geneve: add missing netlink policy and size for IFLA_GENEVE_INNER_PROTO_INHERIT 2022-03-22 22:19:46 -07:00
gtp.c gtp: Fix inconsistent indenting 2022-03-16 08:47:02 -07:00
ifb.c
loopback.c net: Add skb_clear_tstamp() to keep the mono delivery_time 2022-03-03 14:38:48 +00:00
macsec.c
macvlan.c net: macvlan: add net device refcount tracker 2022-03-14 10:06:54 +00:00
macvtap.c macvtap: advertise link netns via netlink 2022-03-01 17:59:28 -08:00
mdio.c
mhi_net.c
mii.c
net_failover.c net: add per-cpu storage and net->core_stats 2022-03-11 23:17:24 -08:00
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
sungem_phy.c
tap.c net: tap: track dropped skb via kfree_skb_reason() 2022-03-06 11:04:01 +00:00
thunderbolt.c
tun.c net: add per-cpu storage and net->core_stats 2022-03-11 23:17:24 -08:00
veth.c veth: Allow jumbo frames in xdp mode 2022-03-17 20:33:52 +01:00
virtio_net.c
vrf.c net: Add l3mdev index to flow struct and avoid oif reset for port devices 2022-03-15 20:20:02 -07:00
vsockmon.c
xen-netfront.c xen/grant-table: remove readonly parameter from functions 2022-03-15 20:34:40 -05:00