syzbot


KASAN: slab-out-of-bounds Read in ip_send_unicast_reply

Status: auto-closed as invalid on 2019/10/25 08:47
Subsystems: net
[Documentation on labels]
Reported-by: syzbot+f1741fbf71635c029556@syzkaller.appspotmail.com
First crash: 1937d, last: 1770d
Discussions (3)
Title Replies (including bot) Last reply
Reminder: 99 open syzbot bugs in net subsystem 14 (14) 2019/07/31 15:13
Reminder: 94 open syzbot bugs in net subsystem 1 (1) 2019/06/25 05:48
KASAN: slab-out-of-bounds Read in ip_send_unicast_reply 0 (1) 2019/02/06 05:02

Sample crash report:
==================================================================
BUG: KASAN: slab-out-of-bounds in sock_net include/net/sock.h:2454 [inline]
BUG: KASAN: slab-out-of-bounds in ip_send_unicast_reply+0x1032/0x11a0 net/ipv4/ip_output.c:1565
Read of size 8 at addr ffff88808c56e900 by task syz-executor.4/22464

CPU: 0 PID: 22464 Comm: syz-executor.4 Not tainted 5.2.0-rc5+ #31
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 <IRQ>
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x172/0x1f0 lib/dump_stack.c:113
 print_address_description.cold+0x7c/0x20d mm/kasan/report.c:188
 __kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317
 kasan_report+0x12/0x20 mm/kasan/common.c:614
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:132
 sock_net include/net/sock.h:2454 [inline]
 ip_send_unicast_reply+0x1032/0x11a0 net/ipv4/ip_output.c:1565
 tcp_v4_send_reset+0xe9a/0x2130 net/ipv4/tcp_ipv4.c:773
 tcp_v4_rcv+0x20ed/0x3870 net/ipv4/tcp_ipv4.c:1945
 ip_protocol_deliver_rcu+0x5a/0x8e0 net/ipv4/ip_input.c:204
 ip_local_deliver_finish+0x23b/0x390 net/ipv4/ip_input.c:231
 NF_HOOK include/linux/netfilter.h:305 [inline]
 NF_HOOK include/linux/netfilter.h:299 [inline]
 ip_local_deliver+0x1e9/0x520 net/ipv4/ip_input.c:252
 dst_input include/net/dst.h:439 [inline]
 ip_rcv_finish+0x1d9/0x2f0 net/ipv4/ip_input.c:413
 NF_HOOK include/linux/netfilter.h:305 [inline]
 NF_HOOK include/linux/netfilter.h:299 [inline]
 ip_rcv+0xe8/0x3f0 net/ipv4/ip_input.c:523
 __netif_receive_skb_one_core+0x113/0x1a0 net/core/dev.c:5009
 __netif_receive_skb+0x2c/0x1d0 net/core/dev.c:5123
 process_backlog+0x206/0x750 net/core/dev.c:5934
 napi_poll net/core/dev.c:6357 [inline]
 net_rx_action+0x4f5/0x1070 net/core/dev.c:6423
 __do_softirq+0x25c/0x94c kernel/softirq.c:292
 do_softirq_own_stack+0x2a/0x40 arch/x86/entry/entry_64.S:1040
 </IRQ>
 do_softirq.part.0+0x11a/0x170 kernel/softirq.c:337
 do_softirq kernel/softirq.c:329 [inline]
 __local_bh_enable_ip+0x211/0x270 kernel/softirq.c:189
 local_bh_enable include/linux/bottom_half.h:32 [inline]
 rcu_read_unlock_bh include/linux/rcupdate.h:682 [inline]
 ip_finish_output2+0x93a/0x24b0 net/ipv4/ip_output.c:229
 ip_finish_output+0x729/0xd40 net/ipv4/ip_output.c:315
 NF_HOOK_COND include/linux/netfilter.h:294 [inline]
 ip_output+0x21f/0x670 net/ipv4/ip_output.c:403
 dst_output include/net/dst.h:433 [inline]
 ip_local_out+0xbb/0x1b0 net/ipv4/ip_output.c:125
 __ip_queue_xmit+0x86f/0x1bf0 net/ipv4/ip_output.c:503
 ip_queue_xmit+0x5a/0x70 include/net/ip.h:198
 __tcp_transmit_skb+0x1a23/0x3740 net/ipv4/tcp_output.c:1156
 tcp_transmit_skb net/ipv4/tcp_output.c:1172 [inline]
 tcp_send_syn_data net/ipv4/tcp_output.c:3500 [inline]
 tcp_connect+0x1e89/0x42c0 net/ipv4/tcp_output.c:3539
 tcp_v4_connect+0x1514/0x1c40 net/ipv4/tcp_ipv4.c:310
 __inet_stream_connect+0x834/0xe90 net/ipv4/af_inet.c:655
 tcp_sendmsg_fastopen net/ipv4/tcp.c:1144 [inline]
 tcp_sendmsg_locked+0x2318/0x3920 net/ipv4/tcp.c:1186
 tcp_sendmsg+0x30/0x50 net/ipv4/tcp.c:1420
 inet_sendmsg+0x141/0x5d0 net/ipv4/af_inet.c:798
 sock_sendmsg_nosec net/socket.c:646 [inline]
 sock_sendmsg+0xd7/0x130 net/socket.c:665
 __sys_sendto+0x262/0x380 net/socket.c:1958
 __do_sys_sendto net/socket.c:1970 [inline]
 __se_sys_sendto net/socket.c:1966 [inline]
 __x64_sys_sendto+0xe1/0x1a0 net/socket.c:1966
 do_syscall_64+0xfd/0x680 arch/x86/entry/common.c:301
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x4592c9
Code: fd b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 cb b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f4a89706c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002c
RAX: ffffffffffffffda RBX: 0000000000000006 RCX: 00000000004592c9
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000006
RBP: 000000000075bfc8 R08: 0000000020000080 R09: 0000000000000010
R10: 1000000020000000 R11: 0000000000000246 R12: 00007f4a897076d4
R13: 00000000004c7073 R14: 00000000004dc248 R15: 00000000ffffffff

Allocated by task 9646:
 save_stack+0x23/0x90 mm/kasan/common.c:71
 set_track mm/kasan/common.c:79 [inline]
 __kasan_kmalloc mm/kasan/common.c:489 [inline]
 __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:462
 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:503
 kmem_cache_alloc_trace+0x151/0x750 mm/slab.c:3555
 kmalloc include/linux/slab.h:547 [inline]
 kzalloc include/linux/slab.h:742 [inline]
 mr_table_alloc+0x5b/0x310 net/ipv4/ipmr_base.c:41
 ipmr_new_table net/ipv4/ipmr.c:405 [inline]
 ipmr_new_table+0x11c/0x150 net/ipv4/ipmr.c:393
 ipmr_rules_init net/ipv4/ipmr.c:248 [inline]
 ipmr_net_init+0x138/0x3f0 net/ipv4/ipmr.c:3085
 ops_init+0xb3/0x410 net/core/net_namespace.c:130
 setup_net+0x2d3/0x740 net/core/net_namespace.c:316
 copy_net_ns+0x1df/0x340 net/core/net_namespace.c:439
 create_new_namespaces+0x400/0x7b0 kernel/nsproxy.c:103
 unshare_nsproxy_namespaces+0xc2/0x200 kernel/nsproxy.c:202
 ksys_unshare+0x440/0x980 kernel/fork.c:2692
 __do_sys_unshare kernel/fork.c:2760 [inline]
 __se_sys_unshare kernel/fork.c:2758 [inline]
 __x64_sys_unshare+0x31/0x40 kernel/fork.c:2758
 do_syscall_64+0xfd/0x680 arch/x86/entry/common.c:301
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 0:
(stack is not available)

The buggy address belongs to the object at ffff88808c56ea40
 which belongs to the cache kmalloc-4k of size 4096
The buggy address is located 320 bytes to the left of
 4096-byte region [ffff88808c56ea40, ffff88808c56fa40)
The buggy address belongs to the page:
page:ffffea0002315b80 refcount:1 mapcount:0 mapping:ffff8880aa400dc0 index:0x0 compound_mapcount: 0
flags: 0x1fffc0000010200(slab|head)
raw: 01fffc0000010200 ffffea0002315888 ffffea0002324408 ffff8880aa400dc0
raw: 0000000000000000 ffff88808c56ea40 0000000100000001 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88808c56e800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88808c56e880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88808c56e900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                   ^
 ffff88808c56e980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88808c56ea00: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00
==================================================================

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/06/22 04:31 upstream abf02e2964b3 34bf9440 .config console log report ci-upstream-kasan-gce-selinux-root
2019/03/04 20:32 upstream 736706bee329 7c693b52 .config console log report ci-upstream-kasan-gce-smack-root
2019/02/06 00:37 net-next-old 5468e82f7034 d672172c .config console log report ci-upstream-net-kasan-gce
2019/01/06 15:31 net-next-old b71acb0e3721 94f8adb5 .config console log report ci-upstream-net-kasan-gce
* Struck through repros no longer work on HEAD.