Eric Dumazet
687c5d52fe
ip6_tunnel: fix NEXTHDR_FRAGMENT handling in ip6_tnl_parse_tlv_enc_lim()
...
[ Upstream commit d375b98e0248980681e5e56b712026174d617198 ]
syzbot pointed out [1] that NEXTHDR_FRAGMENT handling is broken.
Reading frag_off can only be done if we pulled enough bytes
to skb->head. Currently we might access garbage.
[1]
BUG: KMSAN: uninit-value in ip6_tnl_parse_tlv_enc_lim+0x94f/0xbb0
ip6_tnl_parse_tlv_enc_lim+0x94f/0xbb0
ipxip6_tnl_xmit net/ipv6/ip6_tunnel.c:1326 [inline]
ip6_tnl_start_xmit+0xab2/0x1a70 net/ipv6/ip6_tunnel.c:1432
__netdev_start_xmit include/linux/netdevice.h:4940 [inline]
netdev_start_xmit include/linux/netdevice.h:4954 [inline]
xmit_one net/core/dev.c:3548 [inline]
dev_hard_start_xmit+0x247/0xa10 net/core/dev.c:3564
__dev_queue_xmit+0x33b8/0x5130 net/core/dev.c:4349
dev_queue_xmit include/linux/netdevice.h:3134 [inline]
neigh_connected_output+0x569/0x660 net/core/neighbour.c:1592
neigh_output include/net/neighbour.h:542 [inline]
ip6_finish_output2+0x23a9/0x2b30 net/ipv6/ip6_output.c:137
ip6_finish_output+0x855/0x12b0 net/ipv6/ip6_output.c:222
NF_HOOK_COND include/linux/netfilter.h:303 [inline]
ip6_output+0x323/0x610 net/ipv6/ip6_output.c:243
dst_output include/net/dst.h:451 [inline]
ip6_local_out+0xe9/0x140 net/ipv6/output_core.c:155
ip6_send_skb net/ipv6/ip6_output.c:1952 [inline]
ip6_push_pending_frames+0x1f9/0x560 net/ipv6/ip6_output.c:1972
rawv6_push_pending_frames+0xbe8/0xdf0 net/ipv6/raw.c:582
rawv6_sendmsg+0x2b66/0x2e70 net/ipv6/raw.c:920
inet_sendmsg+0x105/0x190 net/ipv4/af_inet.c:847
sock_sendmsg_nosec net/socket.c:730 [inline]
__sock_sendmsg net/socket.c:745 [inline]
____sys_sendmsg+0x9c2/0xd60 net/socket.c:2584
___sys_sendmsg+0x28d/0x3c0 net/socket.c:2638
__sys_sendmsg net/socket.c:2667 [inline]
__do_sys_sendmsg net/socket.c:2676 [inline]
__se_sys_sendmsg net/socket.c:2674 [inline]
__x64_sys_sendmsg+0x307/0x490 net/socket.c:2674
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0x44/0x110 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x63/0x6b
Uninit was created at:
slab_post_alloc_hook+0x129/0xa70 mm/slab.h:768
slab_alloc_node mm/slub.c:3478 [inline]
__kmem_cache_alloc_node+0x5c9/0x970 mm/slub.c:3517
__do_kmalloc_node mm/slab_common.c:1006 [inline]
__kmalloc_node_track_caller+0x118/0x3c0 mm/slab_common.c:1027
kmalloc_reserve+0x249/0x4a0 net/core/skbuff.c:582
pskb_expand_head+0x226/0x1a00 net/core/skbuff.c:2098
__pskb_pull_tail+0x13b/0x2310 net/core/skbuff.c:2655
pskb_may_pull_reason include/linux/skbuff.h:2673 [inline]
pskb_may_pull include/linux/skbuff.h:2681 [inline]
ip6_tnl_parse_tlv_enc_lim+0x901/0xbb0 net/ipv6/ip6_tunnel.c:408
ipxip6_tnl_xmit net/ipv6/ip6_tunnel.c:1326 [inline]
ip6_tnl_start_xmit+0xab2/0x1a70 net/ipv6/ip6_tunnel.c:1432
__netdev_start_xmit include/linux/netdevice.h:4940 [inline]
netdev_start_xmit include/linux/netdevice.h:4954 [inline]
xmit_one net/core/dev.c:3548 [inline]
dev_hard_start_xmit+0x247/0xa10 net/core/dev.c:3564
__dev_queue_xmit+0x33b8/0x5130 net/core/dev.c:4349
dev_queue_xmit include/linux/netdevice.h:3134 [inline]
neigh_connected_output+0x569/0x660 net/core/neighbour.c:1592
neigh_output include/net/neighbour.h:542 [inline]
ip6_finish_output2+0x23a9/0x2b30 net/ipv6/ip6_output.c:137
ip6_finish_output+0x855/0x12b0 net/ipv6/ip6_output.c:222
NF_HOOK_COND include/linux/netfilter.h:303 [inline]
ip6_output+0x323/0x610 net/ipv6/ip6_output.c:243
dst_output include/net/dst.h:451 [inline]
ip6_local_out+0xe9/0x140 net/ipv6/output_core.c:155
ip6_send_skb net/ipv6/ip6_output.c:1952 [inline]
ip6_push_pending_frames+0x1f9/0x560 net/ipv6/ip6_output.c:1972
rawv6_push_pending_frames+0xbe8/0xdf0 net/ipv6/raw.c:582
rawv6_sendmsg+0x2b66/0x2e70 net/ipv6/raw.c:920
inet_sendmsg+0x105/0x190 net/ipv4/af_inet.c:847
sock_sendmsg_nosec net/socket.c:730 [inline]
__sock_sendmsg net/socket.c:745 [inline]
____sys_sendmsg+0x9c2/0xd60 net/socket.c:2584
___sys_sendmsg+0x28d/0x3c0 net/socket.c:2638
__sys_sendmsg net/socket.c:2667 [inline]
__do_sys_sendmsg net/socket.c:2676 [inline]
__se_sys_sendmsg net/socket.c:2674 [inline]
__x64_sys_sendmsg+0x307/0x490 net/socket.c:2674
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0x44/0x110 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x63/0x6b
CPU: 0 PID: 7345 Comm: syz-executor.3 Not tainted 6.7.0-rc8-syzkaller-00024-gac865f00af29 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
Fixes: fbfa743a9d2a ("ipv6: fix ip6_tnl_parse_tlv_enc_lim()")
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Willem de Bruijn <willemb@google.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-01-25 15:35:30 -08:00
..
2024-01-01 12:42:41 +00:00
2024-01-01 12:42:32 +00:00
2023-12-20 17:01:50 +01:00
2023-12-20 17:01:48 +01:00
2023-09-18 12:56:58 +01:00
2023-08-24 10:51:39 -07:00
2024-01-25 15:35:29 -08:00
2023-08-30 08:36:17 +02:00
2023-05-31 13:06:57 +02:00
2023-11-28 17:19:52 +00:00
2023-06-24 15:50:13 -07:00
2023-10-06 12:54:33 +02:00
2023-10-09 13:35:24 +02:00
2024-01-20 11:51:43 +01:00
2023-08-01 21:07:46 -07:00
2023-11-20 11:59:35 +01:00
2023-10-06 15:56:46 -07:00
2024-01-10 17:16:45 +01:00
2023-08-09 13:08:09 -07:00
2023-12-08 08:52:23 +01:00
2023-10-23 10:19:33 -07:00
2023-11-20 11:59:34 +01:00
2023-08-29 17:39:15 -07:00
2024-01-01 12:42:30 +00:00
2024-01-25 15:35:30 -08:00
2024-01-25 15:35:30 -08:00
2023-09-14 10:43:51 +02:00
2023-08-18 12:44:56 -07:00
2023-11-20 11:58:56 +01:00
2023-11-20 11:59:34 +01:00
2024-01-20 11:51:37 +01:00
2023-06-24 15:41:46 -07:00
2023-10-10 19:43:22 -07:00
2023-08-15 15:26:18 -07:00
2024-01-20 11:51:37 +01:00
2024-01-25 15:35:20 -08:00
2024-01-25 15:35:29 -08:00
2024-01-25 15:35:14 -08:00
2023-12-13 18:45:10 +01:00
2023-08-28 06:58:46 +01:00
2024-01-20 11:51:46 +01:00
2023-06-10 00:11:41 -07:00
2023-11-20 11:59:37 +01:00
2023-12-13 18:45:23 +01:00
2023-06-24 15:50:13 -07:00
2023-12-13 18:45:10 +01:00
2024-01-20 11:51:47 +01:00
2023-10-01 19:31:29 +01:00
2024-01-01 12:42:41 +00:00
2024-01-01 12:42:31 +00:00
2024-01-25 15:35:30 -08:00
2024-01-25 15:35:30 -08:00
2024-01-25 15:35:30 -08:00
2024-01-10 17:16:52 +01:00
2024-01-25 15:35:18 -08:00
2023-07-21 08:54:03 +01:00
2023-11-28 17:19:51 +00:00
2023-12-13 18:45:10 +01:00
2024-01-25 15:35:30 -08:00
2024-01-25 15:35:26 -08:00
2024-01-25 15:35:30 -08:00
2023-06-24 15:50:13 -07:00
2024-01-10 17:16:54 +01:00
2023-10-17 18:21:13 -07:00
2023-07-19 10:07:27 -07:00
2023-04-19 18:48:48 -07:00
2024-01-10 17:16:51 +01:00
2023-08-15 15:26:17 -07:00