syzbot


KASAN: use-after-free Read in __rhashtable_lookup (8)

Status: auto-closed as invalid on 2022/04/22 11:27
Reported-by: syzbot+@syzkaller.appspotmail.com
First crash: 315d, last: 315d
similar bugs (7):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in __rhashtable_lookup (2) C 22 1542d 1562d 11/24 fixed on 2018/09/26 21:51
upstream KASAN: use-after-free Read in __rhashtable_lookup (3) 1 752d 752d 0/24 auto-closed as invalid on 2021/02/08 22:50
upstream KASAN: use-after-free Read in __rhashtable_lookup (6) 1 467d 467d 0/24 auto-closed as invalid on 2021/11/20 20:36
upstream KASAN: use-after-free Read in __rhashtable_lookup (5) 1 562d 562d 0/24 auto-closed as invalid on 2021/08/17 13:23
upstream KASAN: use-after-free Read in __rhashtable_lookup (7) 1 369d 369d 0/24 closed as invalid on 2022/01/07 18:56
upstream KASAN: use-after-free Read in __rhashtable_lookup (4) 1 655d 651d 0/24 auto-closed as invalid on 2021/05/16 18:04
upstream KASAN: use-after-free Read in __rhashtable_lookup 1 1582d 1578d 0/24 closed as dup on 2018/08/08 09:26

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in rht_key_hashfn include/linux/rhashtable.h:159 [inline]
BUG: KASAN: use-after-free in __rhashtable_lookup.constprop.0+0x3e2/0x4f0 include/linux/rhashtable.h:596
Read of size 4 at addr ffff888056080008 by task ksoftirqd/1/19

CPU: 1 PID: 19 Comm: ksoftirqd/1 Not tainted 5.16.0-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
 print_address_description.constprop.0.cold+0x8d/0x320 mm/kasan/report.c:255
 __kasan_report mm/kasan/report.c:442 [inline]
 kasan_report.cold+0x83/0xdf mm/kasan/report.c:459
 rht_key_hashfn include/linux/rhashtable.h:159 [inline]
 __rhashtable_lookup.constprop.0+0x3e2/0x4f0 include/linux/rhashtable.h:596
 rhashtable_lookup include/linux/rhashtable.h:638 [inline]
 rhashtable_lookup_fast include/linux/rhashtable.h:664 [inline]
 ila_lookup_wildcards net/ipv6/ila/ila_xlat.c:133 [inline]
 ila_xlat_addr net/ipv6/ila/ila_xlat.c:652 [inline]
 ila_nf_input+0x2df/0x790 net/ipv6/ila/ila_xlat.c:191
 nf_hook_entry_hookfn include/linux/netfilter.h:142 [inline]
 nf_hook_slow+0xc5/0x1e0 net/netfilter/core.c:619
 nf_hook.constprop.0+0x3ac/0x650 include/linux/netfilter.h:262
 NF_HOOK include/linux/netfilter.h:305 [inline]
 ipv6_rcv+0x9e/0x3b0 net/ipv6/ip6_input.c:297
 __netif_receive_skb_one_core+0x114/0x180 net/core/dev.c:5351
 __netif_receive_skb+0x24/0x1b0 net/core/dev.c:5465
 process_backlog+0x2a5/0x6c0 net/core/dev.c:5797
 __napi_poll+0xaf/0x440 net/core/dev.c:6365
 napi_poll net/core/dev.c:6432 [inline]
 net_rx_action+0x801/0xb40 net/core/dev.c:6519
 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558
 run_ksoftirqd kernel/softirq.c:921 [inline]
 run_ksoftirqd+0x2d/0x60 kernel/softirq.c:913
 smpboot_thread_fn+0x645/0x9c0 kernel/smpboot.c:164
 kthread+0x405/0x4f0 kernel/kthread.c:327
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
 </TASK>

The buggy address belongs to the page:
page:ffffea0001582000 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x56080
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000000 ffffea00013f4c08 ffff8880b9c3fee0 0000000000000000
raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as freed
page last allocated via order 3, migratetype Unmovable, gfp_mask 0x152dc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_ZERO), pid 14959, ts 407575327484, free_ts 800413482867
 prep_new_page mm/page_alloc.c:2418 [inline]
 get_page_from_freelist+0xa72/0x2f50 mm/page_alloc.c:4149
 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5369
 __alloc_pages_node include/linux/gfp.h:570 [inline]
 alloc_pages_node include/linux/gfp.h:593 [inline]
 kmalloc_large_node+0x62/0x130 mm/slub.c:4438
 __kmalloc_node+0x2ec/0x390 mm/slub.c:4454
 kmalloc_node include/linux/slab.h:605 [inline]
 kvmalloc_node+0xb4/0x120 mm/util.c:587
 kvmalloc include/linux/slab.h:733 [inline]
 kvzalloc include/linux/slab.h:741 [inline]
 bucket_table_alloc.isra.0+0x8c/0x480 lib/rhashtable.c:184
 rhashtable_init+0x318/0x7f0 lib/rhashtable.c:1061
 ila_xlat_init_net+0x196/0x340 net/ipv6/ila/ila_xlat.c:613
 ops_init+0xaf/0x470 net/core/net_namespace.c:140
 setup_net+0x54f/0xbb0 net/core/net_namespace.c:330
 copy_net_ns+0x318/0x760 net/core/net_namespace.c:474
 create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110
 unshare_nsproxy_namespaces+0xc1/0x1f0 kernel/nsproxy.c:226
 ksys_unshare+0x445/0x920 kernel/fork.c:3075
 __do_sys_unshare kernel/fork.c:3146 [inline]
 __se_sys_unshare kernel/fork.c:3144 [inline]
 __x64_sys_unshare+0x2d/0x40 kernel/fork.c:3144
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1338 [inline]
 free_pcp_prepare+0x374/0x870 mm/page_alloc.c:1389
 free_unref_page_prepare mm/page_alloc.c:3309 [inline]
 free_unref_page+0x19/0x690 mm/page_alloc.c:3388
 kvfree+0x42/0x50 mm/util.c:620
 rhashtable_free_and_destroy+0x147/0x920 lib/rhashtable.c:1159
 ila_xlat_exit_net+0x146/0x360 net/ipv6/ila/ila_xlat.c:626
 ops_exit_list+0xb0/0x170 net/core/net_namespace.c:168
 cleanup_net+0x4ea/0xb00 net/core/net_namespace.c:597
 process_one_work+0x9b2/0x1660 kernel/workqueue.c:2298
 worker_thread+0x65d/0x1130 kernel/workqueue.c:2445
 kthread+0x405/0x4f0 kernel/kthread.c:327
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

Memory state around the buggy address:
 ffff88805607ff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff88805607ff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff888056080000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                      ^
 ffff888056080080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff888056080100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================

Crashes (1):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-bpf-kasan-gce 2022/01/22 11:19 bpf baa59504c1cd 214351e1 .config log report info KASAN: use-after-free Read in __rhashtable_lookup
* Struck through repros no longer work on HEAD.