Eric Dumazet
6af289746a
dccp: fix dccp_v4_err()/dccp_v6_err() again
...
dh->dccph_x is the 9th byte (offset 8) in "struct dccp_hdr",
not in the "byte 7" as Jann claimed.
We need to make sure the ICMP messages are big enough,
using more standard ways (no more assumptions).
syzbot reported:
BUG: KMSAN: uninit-value in pskb_may_pull_reason include/linux/skbuff.h:2667 [inline]
BUG: KMSAN: uninit-value in pskb_may_pull include/linux/skbuff.h:2681 [inline]
BUG: KMSAN: uninit-value in dccp_v6_err+0x426/0x1aa0 net/dccp/ipv6.c:94
pskb_may_pull_reason include/linux/skbuff.h:2667 [inline]
pskb_may_pull include/linux/skbuff.h:2681 [inline]
dccp_v6_err+0x426/0x1aa0 net/dccp/ipv6.c:94
icmpv6_notify+0x4c7/0x880 net/ipv6/icmp.c:867
icmpv6_rcv+0x19d5/0x30d0
ip6_protocol_deliver_rcu+0xda6/0x2a60 net/ipv6/ip6_input.c:438
ip6_input_finish net/ipv6/ip6_input.c:483 [inline]
NF_HOOK include/linux/netfilter.h:304 [inline]
ip6_input+0x15d/0x430 net/ipv6/ip6_input.c:492
ip6_mc_input+0xa7e/0xc80 net/ipv6/ip6_input.c:586
dst_input include/net/dst.h:468 [inline]
ip6_rcv_finish+0x5db/0x870 net/ipv6/ip6_input.c:79
NF_HOOK include/linux/netfilter.h:304 [inline]
ipv6_rcv+0xda/0x390 net/ipv6/ip6_input.c:310
__netif_receive_skb_one_core net/core/dev.c:5523 [inline]
__netif_receive_skb+0x1a6/0x5a0 net/core/dev.c:5637
netif_receive_skb_internal net/core/dev.c:5723 [inline]
netif_receive_skb+0x58/0x660 net/core/dev.c:5782
tun_rx_batched+0x83b/0x920
tun_get_user+0x564c/0x6940 drivers/net/tun.c:2002
tun_chr_write_iter+0x3af/0x5d0 drivers/net/tun.c:2048
call_write_iter include/linux/fs.h:1985 [inline]
new_sync_write fs/read_write.c:491 [inline]
vfs_write+0x8ef/0x15c0 fs/read_write.c:584
ksys_write+0x20f/0x4c0 fs/read_write.c:637
__do_sys_write fs/read_write.c:649 [inline]
__se_sys_write fs/read_write.c:646 [inline]
__x64_sys_write+0x93/0xd0 fs/read_write.c:646
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+0x12f/0xb70 mm/slab.h:767
slab_alloc_node mm/slub.c:3478 [inline]
kmem_cache_alloc_node+0x577/0xa80 mm/slub.c:3523
kmalloc_reserve+0x13d/0x4a0 net/core/skbuff.c:559
__alloc_skb+0x318/0x740 net/core/skbuff.c:650
alloc_skb include/linux/skbuff.h:1286 [inline]
alloc_skb_with_frags+0xc8/0xbd0 net/core/skbuff.c:6313
sock_alloc_send_pskb+0xa80/0xbf0 net/core/sock.c:2795
tun_alloc_skb drivers/net/tun.c:1531 [inline]
tun_get_user+0x23cf/0x6940 drivers/net/tun.c:1846
tun_chr_write_iter+0x3af/0x5d0 drivers/net/tun.c:2048
call_write_iter include/linux/fs.h:1985 [inline]
new_sync_write fs/read_write.c:491 [inline]
vfs_write+0x8ef/0x15c0 fs/read_write.c:584
ksys_write+0x20f/0x4c0 fs/read_write.c:637
__do_sys_write fs/read_write.c:649 [inline]
__se_sys_write fs/read_write.c:646 [inline]
__x64_sys_write+0x93/0xd0 fs/read_write.c:646
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: 4995 Comm: syz-executor153 Not tainted 6.6.0-rc1-syzkaller-00014-ga747acc0b752 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/04/2023
Fixes: 977ad86c2a1b ("dccp: Fix out of bounds access in DCCP error handler")
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Jann Horn <jannh@google.com>
Reviewed-by: Jann Horn <jannh@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2023-09-18 07:10:31 +01:00
..
2023-08-09 15:32:43 -07:00
2023-08-18 12:44:56 -07:00
2023-06-24 15:50:13 -07:00
2023-06-24 15:50:13 -07:00
2023-08-15 15:26:17 -07:00
2023-08-24 10:51:39 -07:00
2023-09-01 09:38:00 -07:00
2023-08-30 08:36:17 +02:00
2023-05-31 13:06:57 +02:00
2023-08-29 17:39:15 -07:00
2023-06-24 15:50:13 -07:00
2023-09-01 07:27:33 +01:00
2023-08-24 11:24:37 +02:00
2023-09-16 13:32:30 +01:00
2023-08-01 21:07:46 -07:00
2023-09-18 07:10:31 +01:00
2023-08-28 08:02:24 -07:00
2023-08-09 13:08:09 -07:00
2023-08-15 15:01:03 -07:00
2023-09-01 07:25:14 +01:00
2023-09-11 08:28:36 +01:00
2023-08-29 17:39:15 -07:00
2023-09-17 15:14:58 +01:00
2023-09-07 18:33:07 -07:00
2023-09-14 10:43:51 +02:00
2023-08-18 12:44:56 -07:00
2023-08-16 11:09:16 +01:00
2023-08-09 15:34:28 -07:00
2023-08-25 18:35:09 -07:00
2023-06-24 15:41:46 -07:00
2023-06-24 15:50:13 -07:00
2023-08-15 15:26:18 -07:00
2023-09-07 18:33:07 -07:00
2023-09-18 07:06:05 +01:00
2023-09-16 11:16:00 +01:00
2023-08-02 12:28:22 -07:00
2023-08-15 15:01:03 -07:00
2023-08-28 06:58:46 +01:00
2023-09-01 09:38:00 -07:00
2023-06-10 00:11:41 -07:00
2023-08-18 12:44:56 -07:00
2023-08-10 14:10:53 -07:00
2023-06-24 15:50:13 -07:00
2023-07-17 09:02:30 +01:00
2023-08-29 17:39:15 -07:00
2023-06-24 15:50:13 -07:00
2023-06-28 16:43:10 -07:00
2023-09-05 08:54:12 +02:00
2023-09-07 18:33:07 -07:00
2023-09-10 19:31:42 +01:00
2023-08-31 15:36:41 -07:00
2023-07-21 08:54:03 +01:00
2023-08-29 14:25:26 -07:00
2023-09-12 09:51:49 +02:00
2023-09-07 18:33:07 -07:00
2023-07-31 14:41:08 -07:00
2023-08-22 21:40:40 +02:00
2023-06-24 15:50:13 -07:00
2023-08-31 13:21:11 +02:00
2023-08-29 17:39:15 -07:00
2023-07-19 10:07:27 -07:00
2023-09-07 18:33:07 -07:00
2023-08-15 15:26:17 -07:00