syzbot


KASAN: use-after-free Read in ip6_hold_safe (3)

Status: closed as invalid on 2019/10/04 04:25
Subsystems: net
[Documentation on labels]
Reported-by: syzbot+1de7f57dd018a516ae89@syzkaller.appspotmail.com
First crash: 1855d, last: 1761d
Discussions (3)
Title Replies (including bot) Last reply
Reminder: 10 open syzbot bugs in "net/sctp" subsystem 1 (1) 2019/07/24 02:27
Reminder: 14 open syzbot bugs in "net/sctp" subsystem 1 (1) 2019/06/25 05:49
KASAN: use-after-free Read in ip6_hold_safe (3) 0 (1) 2019/05/07 09:39
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in ip6_hold_safe (2) net 14 1862d 1907d 0/26 closed as invalid on 2019/03/18 18:21
upstream KASAN: use-after-free Read in ip6_hold_safe net C 1 2086d 2086d 8/26 fixed on 2018/08/28 17:48

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in atomic_read include/asm-generic/atomic-instrumented.h:26 [inline]
BUG: KASAN: use-after-free in atomic_fetch_add_unless include/linux/atomic-fallback.h:1086 [inline]
BUG: KASAN: use-after-free in atomic_add_unless include/linux/atomic-fallback.h:1111 [inline]
BUG: KASAN: use-after-free in atomic_inc_not_zero include/linux/atomic-fallback.h:1127 [inline]
BUG: KASAN: use-after-free in dst_hold_safe include/net/dst.h:297 [inline]
BUG: KASAN: use-after-free in ip6_hold_safe+0xad/0x380 net/ipv6/route.c:1046
Read of size 4 at addr ffff88809fb670a8 by task syz-executor.0/12654

CPU: 1 PID: 12654 Comm: syz-executor.0 Not tainted 5.2.0-rc5+ #32
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __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
 check_memory_region_inline mm/kasan/generic.c:185 [inline]
 check_memory_region+0x123/0x190 mm/kasan/generic.c:191
 kasan_check_read+0x11/0x20 mm/kasan/common.c:94
 atomic_read include/asm-generic/atomic-instrumented.h:26 [inline]
 atomic_fetch_add_unless include/linux/atomic-fallback.h:1086 [inline]
 atomic_add_unless include/linux/atomic-fallback.h:1111 [inline]
 atomic_inc_not_zero include/linux/atomic-fallback.h:1127 [inline]
 dst_hold_safe include/net/dst.h:297 [inline]
 ip6_hold_safe+0xad/0x380 net/ipv6/route.c:1046
 rt6_get_pcpu_route net/ipv6/route.c:1273 [inline]
 ip6_pol_route+0x339/0x1050 net/ipv6/route.c:1952
 ip6_pol_route_output+0x54/0x70 net/ipv6/route.c:2128
 __fib6_rule_action net/ipv6/fib6_rules.c:227 [inline]
 fib6_rule_action+0x49c/0xb40 net/ipv6/fib6_rules.c:258
 fib_rules_lookup+0x34c/0xa90 net/core/fib_rules.c:301
 fib6_rule_lookup+0x384/0x5a0 net/ipv6/fib6_rules.c:105
 ip6_route_output_flags+0x2c4/0x350 net/ipv6/route.c:2157
 ip6_route_output include/net/ip6_route.h:89 [inline]
 ip6_dst_lookup_tail+0xd10/0x1b30 net/ipv6/ip6_output.c:962
 ip6_dst_lookup_flow+0xa8/0x220 net/ipv6/ip6_output.c:1090
 ip6_datagram_dst_update+0x5d8/0xc20 net/ipv6/datagram.c:87
 __ip6_datagram_connect+0x5e9/0x1390 net/ipv6/datagram.c:246
 ip6_datagram_connect+0x30/0x50 net/ipv6/datagram.c:269
 inet_dgram_connect+0x14a/0x2d0 net/ipv4/af_inet.c:571
 __sys_connect+0x264/0x330 net/socket.c:1834
 __do_sys_connect net/socket.c:1845 [inline]
 __se_sys_connect net/socket.c:1842 [inline]
 __x64_sys_connect+0x73/0xb0 net/socket.c:1842
 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:00007f21c58e3c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002a
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00000000004592c9
RDX: 000000000000001c RSI: 0000000020000580 RDI: 0000000000000003
RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f21c58e46d4
R13: 00000000004bf7b5 R14: 00000000004d0f38 R15: 00000000ffffffff

Allocated by task 9656:
 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_slab_alloc+0xf/0x20 mm/kasan/common.c:497
 slab_post_alloc_hook mm/slab.h:437 [inline]
 slab_alloc mm/slab.c:3326 [inline]
 kmem_cache_alloc+0x11a/0x6f0 mm/slab.c:3488
 kmem_cache_zalloc include/linux/slab.h:732 [inline]
 __alloc_file+0x27/0x300 fs/file_table.c:101
 alloc_empty_file+0x72/0x170 fs/file_table.c:151
 alloc_file+0x5e/0x4d0 fs/file_table.c:193
 alloc_file_pseudo+0x189/0x280 fs/file_table.c:232
 sock_alloc_file+0x4d/0x170 net/socket.c:408
 sock_map_fd net/socket.c:431 [inline]
 __sys_socket+0x150/0x220 net/socket.c:1521
 __do_sys_socket net/socket.c:1526 [inline]
 __se_sys_socket net/socket.c:1524 [inline]
 __x64_sys_socket+0x73/0xb0 net/socket.c:1524
 do_syscall_64+0xfd/0x680 arch/x86/entry/common.c:301
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 9:
 save_stack+0x23/0x90 mm/kasan/common.c:71
 set_track mm/kasan/common.c:79 [inline]
 __kasan_slab_free+0x102/0x150 mm/kasan/common.c:451
 kasan_slab_free+0xe/0x10 mm/kasan/common.c:459
 __cache_free mm/slab.c:3432 [inline]
 kmem_cache_free+0x86/0x260 mm/slab.c:3698
 file_free_rcu+0x98/0xe0 fs/file_table.c:50
 __rcu_reclaim kernel/rcu/rcu.h:222 [inline]
 rcu_do_batch kernel/rcu/tree.c:2092 [inline]
 invoke_rcu_callbacks kernel/rcu/tree.c:2310 [inline]
 rcu_core+0xba5/0x1500 kernel/rcu/tree.c:2291
 __do_softirq+0x25c/0x94c kernel/softirq.c:292

The buggy address belongs to the object at ffff88809fb67000
 which belongs to the cache filp(49:syz2) of size 456
The buggy address is located 168 bytes inside of
 456-byte region [ffff88809fb67000, ffff88809fb671c8)
The buggy address belongs to the page:
page:ffffea00027ed9c0 refcount:1 mapcount:0 mapping:ffff888092a5eb00 index:0xffff88809fb67a00
flags: 0x1fffc0000000200(slab)
raw: 01fffc0000000200 ffffea00016e4208 ffffea00024a1a08 ffff888092a5eb00
raw: ffff88809fb67a00 ffff88809fb67000 0000000100000002 ffff88809e948080
page dumped because: kasan: bad access detected
page->mem_cgroup:ffff88809e948080

Memory state around the buggy address:
 ffff88809fb66f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff88809fb67000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88809fb67080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                  ^
 ffff88809fb67100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88809fb67180: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc
==================================================================

Crashes (17):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/06/23 15:32 upstream 241e39004581 472f0082 .config console log report ci-upstream-kasan-gce-selinux-root
2019/06/15 02:58 net-old 385097a36757 442206d7 .config console log report ci-upstream-net-this-kasan-gce
2019/06/08 20:35 net-old 38e406f600a2 0159583c .config console log report ci-upstream-net-this-kasan-gce
2019/06/01 09:53 net-old e8d67fa5696e 53c81ea5 .config console log report ci-upstream-net-this-kasan-gce
2019/05/28 12:14 net-old 3e66b7cc50ef 6bd61501 .config console log report ci-upstream-net-this-kasan-gce
2019/05/11 11:08 net-old daf3ddbe11a2 46caad94 .config console log report ci-upstream-net-this-kasan-gce
2019/05/03 05:32 net-old 4dd2b82d5adf e9039493 .config console log report ci-upstream-net-this-kasan-gce
2019/04/29 23:15 net-old 2ae7a39770c7 b617407b .config console log report ci-upstream-net-this-kasan-gce
2019/04/27 05:33 net-old fdfdf86720a3 b617407b .config console log report ci-upstream-net-this-kasan-gce
2019/04/14 00:02 net-old ed0de45a1008 c402d8f1 .config console log report ci-upstream-net-this-kasan-gce
2019/06/15 18:37 net-next-old 877cd9ffbc9c 442206d7 .config console log report ci-upstream-net-kasan-gce
2019/06/13 17:20 net-next-old a842fe1425cb a139f92f .config console log report ci-upstream-net-kasan-gce
2019/06/13 01:14 net-next-old 7a096d579e8e 794a1ad7 .config console log report ci-upstream-net-kasan-gce
2019/06/09 04:28 net-next-old 8d94a8733c94 0159583c .config console log report ci-upstream-net-kasan-gce
2019/05/31 12:24 net-next-old 517f4c49aafc 142ce681 .config console log report ci-upstream-net-kasan-gce
2019/05/28 14:56 net-next-old cec4f328c929 6bd61501 .config console log report ci-upstream-net-kasan-gce
2019/03/21 14:39 net-next-old a534ea30e70f 427ea487 .config console log report ci-upstream-net-kasan-gce
* Struck through repros no longer work on HEAD.