Eric Dumazet
1ca1ba465e
geneve: make sure to pull inner header in geneve_rx()
syzbot triggered a bug in geneve_rx() [1]
Issue is similar to the one I fixed in commit 8d975c15c0
("ip6_tunnel: make sure to pull inner header in __ip6_tnl_rcv()")
We have to save skb->network_header in a temporary variable
in order to be able to recompute the network_header pointer
after a pskb_inet_may_pull() call.
pskb_inet_may_pull() makes sure the needed headers are in skb->head.
[1]
BUG: KMSAN: uninit-value in IP_ECN_decapsulate include/net/inet_ecn.h:302 [inline]
BUG: KMSAN: uninit-value in geneve_rx drivers/net/geneve.c:279 [inline]
BUG: KMSAN: uninit-value in geneve_udp_encap_recv+0x36f9/0x3c10 drivers/net/geneve.c:391
IP_ECN_decapsulate include/net/inet_ecn.h:302 [inline]
geneve_rx drivers/net/geneve.c:279 [inline]
geneve_udp_encap_recv+0x36f9/0x3c10 drivers/net/geneve.c:391
udp_queue_rcv_one_skb+0x1d39/0x1f20 net/ipv4/udp.c:2108
udp_queue_rcv_skb+0x6ae/0x6e0 net/ipv4/udp.c:2186
udp_unicast_rcv_skb+0x184/0x4b0 net/ipv4/udp.c:2346
__udp4_lib_rcv+0x1c6b/0x3010 net/ipv4/udp.c:2422
udp_rcv+0x7d/0xa0 net/ipv4/udp.c:2604
ip_protocol_deliver_rcu+0x264/0x1300 net/ipv4/ip_input.c:205
ip_local_deliver_finish+0x2b8/0x440 net/ipv4/ip_input.c:233
NF_HOOK include/linux/netfilter.h:314 [inline]
ip_local_deliver+0x21f/0x490 net/ipv4/ip_input.c:254
dst_input include/net/dst.h:461 [inline]
ip_rcv_finish net/ipv4/ip_input.c:449 [inline]
NF_HOOK include/linux/netfilter.h:314 [inline]
ip_rcv+0x46f/0x760 net/ipv4/ip_input.c:569
__netif_receive_skb_one_core net/core/dev.c:5534 [inline]
__netif_receive_skb+0x1a6/0x5a0 net/core/dev.c:5648
process_backlog+0x480/0x8b0 net/core/dev.c:5976
__napi_poll+0xe3/0x980 net/core/dev.c:6576
napi_poll net/core/dev.c:6645 [inline]
net_rx_action+0x8b8/0x1870 net/core/dev.c:6778
__do_softirq+0x1b7/0x7c5 kernel/softirq.c:553
do_softirq+0x9a/0xf0 kernel/softirq.c:454
__local_bh_enable_ip+0x9b/0xa0 kernel/softirq.c:381
local_bh_enable include/linux/bottom_half.h:33 [inline]
rcu_read_unlock_bh include/linux/rcupdate.h:820 [inline]
__dev_queue_xmit+0x2768/0x51c0 net/core/dev.c:4378
dev_queue_xmit include/linux/netdevice.h:3171 [inline]
packet_xmit+0x9c/0x6b0 net/packet/af_packet.c:276
packet_snd net/packet/af_packet.c:3081 [inline]
packet_sendmsg+0x8aef/0x9f10 net/packet/af_packet.c:3113
sock_sendmsg_nosec net/socket.c:730 [inline]
__sock_sendmsg net/socket.c:745 [inline]
__sys_sendto+0x735/0xa10 net/socket.c:2191
__do_sys_sendto net/socket.c:2203 [inline]
__se_sys_sendto net/socket.c:2199 [inline]
__x64_sys_sendto+0x125/0x1c0 net/socket.c:2199
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x1e0 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x63/0x6b
Uninit was created at:
slab_post_alloc_hook mm/slub.c:3819 [inline]
slab_alloc_node mm/slub.c:3860 [inline]
kmem_cache_alloc_node+0x5cb/0xbc0 mm/slub.c:3903
kmalloc_reserve+0x13d/0x4a0 net/core/skbuff.c:560
__alloc_skb+0x352/0x790 net/core/skbuff.c:651
alloc_skb include/linux/skbuff.h:1296 [inline]
alloc_skb_with_frags+0xc8/0xbd0 net/core/skbuff.c:6394
sock_alloc_send_pskb+0xa80/0xbf0 net/core/sock.c:2783
packet_alloc_skb net/packet/af_packet.c:2930 [inline]
packet_snd net/packet/af_packet.c:3024 [inline]
packet_sendmsg+0x70c2/0x9f10 net/packet/af_packet.c:3113
sock_sendmsg_nosec net/socket.c:730 [inline]
__sock_sendmsg net/socket.c:745 [inline]
__sys_sendto+0x735/0xa10 net/socket.c:2191
__do_sys_sendto net/socket.c:2203 [inline]
__se_sys_sendto net/socket.c:2199 [inline]
__x64_sys_sendto+0x125/0x1c0 net/socket.c:2199
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcf/0x1e0 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x63/0x6b
Fixes: 2d07dc79fe ("geneve: add initial netdev driver for GENEVE tunnels")
Reported-and-tested-by: syzbot+6a1423ff3f97159aae64@syzkaller.appspotmail.com
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2024-03-04 09:59:33 +00:00
..
2024-02-20 16:56:21 +01:00
2024-02-28 12:20:00 -08:00
2024-01-31 14:08:28 -08:00
2024-02-21 19:09:17 +01:00
2024-02-03 12:46:13 +00:00
2024-01-12 11:32:19 -08:00
2024-02-17 08:56:41 -08:00
2024-02-10 08:02:48 -08:00
2024-02-28 09:50:51 -05:00
2024-02-06 14:10:47 +08:00
2024-02-21 16:24:10 +00:00
2024-01-04 17:01:14 +01:00
2024-01-18 11:37:24 -08:00
2024-01-22 11:40:12 +01:00
2023-12-27 15:37:11 +01:00
2024-02-13 11:15:44 +01:00
2024-02-24 15:01:59 +01:00
2023-12-29 18:08:18 +01:00
2024-02-09 12:55:53 +08:00
2024-02-20 22:58:05 -08:00
2024-01-10 08:45:22 -08:00
2023-12-19 07:58:27 +09:00
2024-02-02 17:16:55 +01:00
2024-01-31 19:54:58 +05:30
2024-02-29 12:18:37 -08:00
2024-01-18 09:48:40 -08:00
2024-02-07 08:20:02 +09:00
2024-02-23 13:53:44 +01:00
2024-01-17 16:47:17 -08:00
2024-01-18 11:37:24 -08:00
2024-02-20 12:49:14 +01:00
2024-02-23 09:17:47 -08:00
2024-01-18 11:37:24 -08:00
2024-02-13 11:40:23 +01:00
2024-02-21 13:56:33 -08:00
2024-02-23 23:39:35 +01:00
2024-01-08 00:51:36 +01:00
2024-01-09 16:32:11 -08:00
2024-02-10 16:52:39 +00:00
2024-02-14 11:15:54 +02:00
2024-02-02 12:52:44 -08:00
2024-02-04 23:36:06 +02:00
2024-02-24 15:59:26 -08:00
2024-01-18 11:37:24 -08:00
2024-02-21 21:11:20 +01:00
2024-01-17 15:25:27 -08:00
2024-01-17 15:39:32 -08:00
2023-12-15 17:07:05 +01:00
2024-02-24 09:55:29 -08:00
2024-02-01 13:49:39 +01:00
2024-01-18 15:16:57 -08:00
2024-01-18 11:37:24 -08:00
2024-01-30 16:20:54 -08:00
2024-02-06 12:35:44 +01:00
2024-02-05 16:16:24 +01:00
2024-01-04 17:01:14 +01:00
2024-03-04 09:59:33 +00:00
2024-01-03 13:33:59 +01:00
2024-01-18 16:44:03 -08:00
2024-02-13 15:42:44 -08:00
2024-02-14 16:28:16 +01:00
2024-02-15 10:19:55 -08:00
2024-01-05 15:55:41 +05:30
2024-01-07 22:59:16 +01:00
2023-12-15 19:54:56 +01:00
2024-02-19 16:11:01 +01:00
2023-12-15 17:07:28 +01:00
2024-02-20 12:04:07 +00:00
2024-01-30 22:41:11 +05:30
2024-01-31 10:06:07 +01:00
2024-02-20 14:35:36 +01:00
2024-01-23 13:19:15 +01:00
2024-01-17 14:37:40 -08:00
2024-01-26 22:45:58 +01:00
2024-01-04 18:06:46 -08:00
2024-01-12 18:25:05 +01:00
2023-12-20 15:02:57 -08:00
2024-02-13 15:38:23 +00:00
2023-12-17 10:06:32 -08:00
2024-01-11 11:31:46 -08:00
2023-12-18 10:56:03 -07:00
2024-01-18 01:05:33 +01:00
2024-02-23 09:54:13 -08:00
2024-02-15 15:34:47 -05:00
2024-01-04 14:37:17 +01:00
2024-02-23 13:53:54 +01:00
2024-01-18 17:08:31 -08:00
2024-02-27 12:52:51 +00:00
2023-12-15 17:27:04 +01:00
2024-02-17 08:52:38 -08:00
2024-02-15 14:44:07 -05:00
2024-01-11 19:46:52 -08:00
2024-01-22 11:59:22 +01:00
2024-01-29 09:48:40 +02:00
2024-02-19 09:43:37 +01:00
2024-02-15 14:46:13 -05:00
2024-01-04 17:03:47 +01:00
2024-02-25 10:41:57 -08:00
2024-01-18 16:44:03 -08:00
2024-01-18 15:57:25 -08:00
2024-01-18 16:44:03 -08:00
2024-01-23 09:13:24 +01:00
2024-01-17 16:47:17 -08:00
2024-01-18 16:44:03 -08:00
2023-12-20 09:25:25 +01:00
2024-01-12 13:32:30 -08:00
2024-02-13 10:12:47 +01:00
2024-01-12 12:38:37 +01:00