syzbot


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

Status: closed as invalid on 2019/03/18 18:21
Subsystems: net
[Documentation on labels]
First crash: 1908d, last: 1863d
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 (3) net 17 1761d 1808d 0/26 closed as invalid on 2019/10/04 04:25
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:
A link change request failed with some changes committed already. Interface gretap0 may have been left with an inconsistent configuration, please check.
IPVS: ftp: loaded support on port[0] = 21
A link change request failed with some changes committed already. Interface gretap0 may have been left with an inconsistent configuration, please check.
IPVS: ftp: loaded support on port[0] = 21
==================================================================
BUG: KASAN: use-after-free in atomic_read include/asm-generic/atomic-instrumented.h:21 [inline]
BUG: KASAN: use-after-free in atomic_fetch_add_unless include/linux/atomic.h:575 [inline]
BUG: KASAN: use-after-free in atomic_add_unless include/linux/atomic.h:597 [inline]
BUG: KASAN: use-after-free in dst_hold_safe include/net/dst.h:308 [inline]
BUG: KASAN: use-after-free in ip6_hold_safe+0xa7/0x3a0 net/ipv6/route.c:1023
Read of size 4 at addr ffff888090e2ccf4 by task rs:main Q:Reg/7517

CPU: 0 PID: 7517 Comm: rs:main Q:Reg Not tainted 5.0.0-rc8+ #88
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:187
 kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317
 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:100
 atomic_read include/asm-generic/atomic-instrumented.h:21 [inline]
 atomic_fetch_add_unless include/linux/atomic.h:575 [inline]
 atomic_add_unless include/linux/atomic.h:597 [inline]
 dst_hold_safe include/net/dst.h:308 [inline]
 ip6_hold_safe+0xa7/0x3a0 net/ipv6/route.c:1023
 rt6_get_pcpu_route net/ipv6/route.c:1243 [inline]
 ip6_pol_route+0x33d/0xf00 net/ipv6/route.c:1904
 ip6_pol_route_input+0x65/0x80 net/ipv6/route.c:1923
 fib6_rule_lookup+0x128/0x560 net/ipv6/fib6_rules.c:118
 ip6_route_input_lookup+0xb7/0xd0 net/ipv6/route.c:1935
 ip6_route_input+0x5e6/0x9e0 net/ipv6/route.c:2070
 ip6_rcv_finish_core.isra.0+0x174/0x590 net/ipv6/ip6_input.c:63
 ip6_rcv_finish+0x17d/0x320 net/ipv6/ip6_input.c:74
 NF_HOOK include/linux/netfilter.h:289 [inline]
 NF_HOOK include/linux/netfilter.h:283 [inline]
 ipv6_rcv+0x10e/0x420 net/ipv6/ip6_input.c:272
 __netif_receive_skb_one_core+0x115/0x1a0 net/core/dev.c:4973
 __netif_receive_skb+0x2c/0x1c0 net/core/dev.c:5083
 process_backlog+0x206/0x750 net/core/dev.c:5923
 napi_poll net/core/dev.c:6346 [inline]
 net_rx_action+0x4fa/0x1070 net/core/dev.c:6412
 __do_softirq+0x266/0x95a kernel/softirq.c:292
 invoke_softirq kernel/softirq.c:373 [inline]
 irq_exit+0x180/0x1d0 kernel/softirq.c:413
 exiting_irq arch/x86/include/asm/apic.h:536 [inline]
 smp_apic_timer_interrupt+0x14a/0x570 arch/x86/kernel/apic/apic.c:1062
 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:807
 </IRQ>
RIP: 0010:get_current arch/x86/include/asm/current.h:15 [inline]
RIP: 0010:__sanitizer_cov_trace_pc+0x8/0x50 kernel/kcov.c:100
Code: e8 11 9f ea ff 48 c7 05 72 fd e5 08 00 00 00 00 e9 c8 e9 ff ff 90 90 90 90 90 90 90 90 90 90 90 90 90 55 48 89 e5 48 8b 75 08 <65> 48 8b 04 25 40 ee 01 00 65 8b 15 98 0e 92 7e 81 e2 00 01 1f 00
RSP: 0018:ffff8880a447f7d8 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13
RAX: dffffc0000000000 RBX: ffff888099da01c0 RCX: ffffffff81e7c0ac
RDX: 1ffff110133b4238 RSI: ffffffff81e7bf0d RDI: ffff888099da11c0
RBP: ffff8880a447f7d8 R08: ffff888099da01c0 R09: ffffed1015d05bd0
R10: ffffed1015d05bcf R11: ffff8880ae82de7b R12: 0000000000000002
R13: 0000000000000000 R14: 0000000000000002 R15: 0000000000000001
 __ext4_journal_start_sb+0x12d/0x4a0 fs/ext4/ext4_jbd2.c:81
 __ext4_journal_start fs/ext4/ext4_jbd2.h:311 [inline]
 ext4_dirty_inode+0x64/0xc0 fs/ext4/inode.c:6081
 __mark_inode_dirty+0x919/0x1290 fs/fs-writeback.c:2155
 mark_inode_dirty include/linux/fs.h:2125 [inline]
 __generic_write_end+0x1b9/0x240 fs/buffer.c:2118
 generic_write_end+0x6c/0x90 fs/buffer.c:2163
 ext4_da_write_end+0x3c8/0xa50 fs/ext4/inode.c:3204
 generic_perform_write+0x2f0/0x530 mm/filemap.c:3219
 __generic_file_write_iter+0x25e/0x630 mm/filemap.c:3333
 ext4_file_write_iter+0x33f/0x1160 fs/ext4/file.c:266
 call_write_iter include/linux/fs.h:1863 [inline]
 new_sync_write fs/read_write.c:474 [inline]
 __vfs_write+0x613/0x8e0 fs/read_write.c:487
 vfs_write+0x20c/0x580 fs/read_write.c:549
 ksys_write+0xea/0x1f0 fs/read_write.c:598
 __do_sys_write fs/read_write.c:610 [inline]
 __se_sys_write fs/read_write.c:607 [inline]
 __x64_sys_write+0x73/0xb0 fs/read_write.c:607
 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7f96ffc4f19d
Code: d1 20 00 00 75 10 b8 01 00 00 00 0f 05 48 3d 01 f0 ff ff 73 31 c3 48 83 ec 08 e8 be fa ff ff 48 89 04 24 b8 01 00 00 00 0f 05 <48> 8b 3c 24 48 89 c2 e8 07 fb ff ff 48 89 d0 48 83 c4 08 48 3d 01
RSP: 002b:00007f96fe1eff90 EFLAGS: 00000293 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000000000000400 RCX: 00007f96ffc4f19d
RDX: 0000000000000400 RSI: 0000000000c17a90 RDI: 0000000000000005
RBP: 0000000000c17a90 R08: 0000000000c7d610 R09: 39363820205b203a
R10: 5d3831363539352e R11: 0000000000000293 R12: 0000000000000000
R13: 00007f96fe1f0410 R14: 0000000000c7d610 R15: 0000000000c17890

Allocated by task 8746:
 save_stack+0x45/0xd0 mm/kasan/common.c:73
 set_track mm/kasan/common.c:85 [inline]
 __kasan_kmalloc mm/kasan/common.c:495 [inline]
 __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:468
 kasan_slab_alloc+0xf/0x20 mm/kasan/common.c:503
 slab_post_alloc_hook mm/slab.h:440 [inline]
 slab_alloc mm/slab.c:3388 [inline]
 kmem_cache_alloc+0x11a/0x6f0 mm/slab.c:3548
 getname_flags fs/namei.c:140 [inline]
 getname_flags+0xd6/0x5b0 fs/namei.c:129
 getname+0x1a/0x20 fs/namei.c:211
 do_sys_open+0x2c9/0x5d0 fs/open.c:1057
 __do_sys_open fs/open.c:1081 [inline]
 __se_sys_open fs/open.c:1076 [inline]
 __x64_sys_open+0x7e/0xc0 fs/open.c:1076
 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 8746:
 save_stack+0x45/0xd0 mm/kasan/common.c:73
 set_track mm/kasan/common.c:85 [inline]
 __kasan_slab_free+0x102/0x150 mm/kasan/common.c:457
 kasan_slab_free+0xe/0x10 mm/kasan/common.c:465
 __cache_free mm/slab.c:3494 [inline]
 kmem_cache_free+0x86/0x260 mm/slab.c:3754
 putname+0xef/0x130 fs/namei.c:261
 do_sys_open+0x318/0x5d0 fs/open.c:1072
 __do_sys_open fs/open.c:1081 [inline]
 __se_sys_open fs/open.c:1076 [inline]
 __x64_sys_open+0x7e/0xc0 fs/open.c:1076
 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

The buggy address belongs to the object at ffff888090e2c800
 which belongs to the cache names_cache of size 4096
The buggy address is located 1268 bytes inside of
 4096-byte region [ffff888090e2c800, ffff888090e2d800)
The buggy address belongs to the page:
page:ffffea0002438b00 count:1 mapcount:0 mapping:ffff88812c291180 index:0x0 compound_mapcount: 0
flags: 0x1fffc0000010200(slab|head)
raw: 01fffc0000010200 ffffea0002230888 ffffea00021a4888 ffff88812c291180
raw: 0000000000000000 ffff888090e2c800 0000000100000001 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff888090e2cb80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888090e2cc00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888090e2cc80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                             ^
 ffff888090e2cd00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888090e2cd80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (14):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/02/27 05:01 upstream 7d762d69145a f2468c12 .config console log report ci-upstream-kasan-gce
2019/03/05 05:01 upstream 736706bee329 7c693b52 .config console log report ci-upstream-kasan-gce-386
2019/02/28 18:09 upstream 7d762d69145a 09aeeba4 .config console log report ci-upstream-kasan-gce-386
2019/02/17 18:33 upstream 8d33316d5205 3e98cc30 .config console log report ci-upstream-kasan-gce-386
2019/03/10 04:17 net-old 1f5d861f7fef 12365b99 .config console log report ci-upstream-net-this-kasan-gce
2019/03/06 13:50 net-old 4177c5d94264 05cf83bf .config console log report ci-upstream-net-this-kasan-gce
2019/02/27 11:55 net-old bfd07f3dd4f1 083cfd0e .config console log report ci-upstream-net-this-kasan-gce
2019/02/25 16:13 net-old 71828b224069 a70141bf .config console log report ci-upstream-net-this-kasan-gce
2019/02/21 13:12 net-old ae3b564179bf 3133098b .config console log report ci-upstream-net-this-kasan-gce
2019/03/14 05:39 net-next-old d9862cfbe209 2881fc25 .config console log report ci-upstream-net-kasan-gce
2019/03/12 14:05 net-next-old d9862cfbe209 a71bfb62 .config console log report ci-upstream-net-kasan-gce
2019/02/22 22:24 net-next-old 7a25c6c0aac8 6a5fcca4 .config console log report ci-upstream-net-kasan-gce
2019/02/12 13:35 net-next-old 6663cf821c13 6ecc6d0f .config console log report ci-upstream-net-kasan-gce
2019/01/27 22:10 net-next-old 085c4c7dd2b6 c73f090a .config console log report ci-upstream-net-kasan-gce
* Struck through repros no longer work on HEAD.