Eric Dumazet
6cfe6f5185
vlan: fix a potential uninit-value in vlan_dev_hard_start_xmit()
...
[ Upstream commit dacab578c7c6cd06c50c89dfa36b0e0f10decd4e ]
syzbot triggered the following splat [1], sending an empty message
through pppoe_sendmsg().
When VLAN_FLAG_REORDER_HDR flag is set, vlan_dev_hard_header()
does not push extra bytes for the VLAN header, because vlan is offloaded.
Unfortunately vlan_dev_hard_start_xmit() first reads veth->h_vlan_proto
before testing (vlan->flags & VLAN_FLAG_REORDER_HDR).
We need to swap the two conditions.
[1]
BUG: KMSAN: uninit-value in vlan_dev_hard_start_xmit+0x171/0x7f0 net/8021q/vlan_dev.c:111
vlan_dev_hard_start_xmit+0x171/0x7f0 net/8021q/vlan_dev.c:111
__netdev_start_xmit include/linux/netdevice.h:4883 [inline]
netdev_start_xmit include/linux/netdevice.h:4897 [inline]
xmit_one net/core/dev.c:3580 [inline]
dev_hard_start_xmit+0x253/0xa20 net/core/dev.c:3596
__dev_queue_xmit+0x3c7f/0x5ac0 net/core/dev.c:4246
dev_queue_xmit include/linux/netdevice.h:3053 [inline]
pppoe_sendmsg+0xa93/0xb80 drivers/net/ppp/pppoe.c:900
sock_sendmsg_nosec net/socket.c:724 [inline]
sock_sendmsg net/socket.c:747 [inline]
____sys_sendmsg+0xa24/0xe40 net/socket.c:2501
___sys_sendmsg+0x2a1/0x3f0 net/socket.c:2555
__sys_sendmmsg+0x411/0xa50 net/socket.c:2641
__do_sys_sendmmsg net/socket.c:2670 [inline]
__se_sys_sendmmsg net/socket.c:2667 [inline]
__x64_sys_sendmmsg+0xbc/0x120 net/socket.c:2667
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
Uninit was created at:
slab_post_alloc_hook+0x12d/0xb60 mm/slab.h:774
slab_alloc_node mm/slub.c:3452 [inline]
kmem_cache_alloc_node+0x543/0xab0 mm/slub.c:3497
kmalloc_reserve+0x148/0x470 net/core/skbuff.c:520
__alloc_skb+0x3a7/0x850 net/core/skbuff.c:606
alloc_skb include/linux/skbuff.h:1277 [inline]
sock_wmalloc+0xfe/0x1a0 net/core/sock.c:2583
pppoe_sendmsg+0x3af/0xb80 drivers/net/ppp/pppoe.c:867
sock_sendmsg_nosec net/socket.c:724 [inline]
sock_sendmsg net/socket.c:747 [inline]
____sys_sendmsg+0xa24/0xe40 net/socket.c:2501
___sys_sendmsg+0x2a1/0x3f0 net/socket.c:2555
__sys_sendmmsg+0x411/0xa50 net/socket.c:2641
__do_sys_sendmmsg net/socket.c:2670 [inline]
__se_sys_sendmmsg net/socket.c:2667 [inline]
__x64_sys_sendmmsg+0xbc/0x120 net/socket.c:2667
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
CPU: 0 PID: 29770 Comm: syz-executor.0 Not tainted 6.3.0-rc6-syzkaller-gc478e5b17829 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/30/2023
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-05-30 12:57:53 +01:00
..
2021-09-15 09:50:34 +02:00
2023-04-20 12:10:25 +02:00
2023-01-14 10:16:18 +01:00
2023-05-30 12:57:53 +01:00
2021-04-07 15:00:08 +02:00
2022-10-30 09:41:16 +01:00
2022-06-22 14:13:17 +02:00
2022-05-18 10:23:42 +02:00
2023-05-30 12:57:49 +01:00
2023-01-14 10:15:31 +01:00
2021-07-14 16:56:29 +02:00
2023-05-30 12:57:46 +01:00
2023-03-17 08:45:11 +01:00
2023-04-20 12:10:23 +02:00
2022-05-25 09:17:56 +02:00
2023-05-30 12:57:48 +01:00
2022-03-08 19:09:37 +01:00
2023-04-26 11:27:42 +02:00
2022-08-31 17:15:19 +02:00
2022-12-14 11:32:01 +01:00
2023-01-24 07:19:55 +01:00
2023-04-05 11:23:52 +02:00
2022-11-03 23:57:51 +09:00
2023-05-30 12:57:52 +01:00
2023-05-30 12:57:52 +01:00
2023-03-22 13:30:00 +01:00
2022-11-25 17:45:56 +01:00
2023-05-30 12:57:51 +01:00
2023-04-26 11:27:41 +02:00
2022-04-27 13:53:50 +02:00
2021-02-10 09:29:14 +01:00
2023-05-30 12:57:46 +01:00
2023-05-30 12:57:53 +01:00
2022-12-14 11:32:01 +01:00
2023-02-22 12:55:58 +01:00
2023-04-26 11:27:41 +02:00
2023-05-17 11:48:10 +02:00
2023-05-30 12:57:49 +01:00
2022-04-13 21:01:00 +02:00
2023-05-30 12:57:46 +01:00
2023-02-15 17:22:12 +01:00
2023-03-17 08:45:07 +01:00
2023-05-30 12:57:52 +01:00
2023-02-22 12:55:57 +01:00
2023-05-30 12:57:46 +01:00
2022-01-11 15:25:01 +01:00
2021-03-07 12:34:07 +01:00
2023-04-20 12:10:26 +02:00
2023-03-11 16:39:26 +01:00
2023-02-22 12:55:53 +01:00
2023-05-17 11:48:11 +02:00
2023-05-17 11:48:11 +02:00
2023-04-26 11:27:42 +02:00
2023-05-30 12:57:46 +01:00
2021-11-18 14:04:27 +01:00
2023-05-30 12:57:52 +01:00
2021-02-07 15:37:12 +01:00
2023-05-30 12:57:52 +01:00
2023-05-30 12:57:46 +01:00
2023-05-30 12:57:46 +01:00
2023-05-30 12:57:52 +01:00
2023-03-13 10:19:36 +01:00
2023-02-15 17:22:15 +01:00
2023-05-17 11:47:50 +02:00
2023-05-30 12:57:51 +01:00
2021-06-18 10:00:06 +02:00
2023-05-30 12:57:46 +01:00