syzbot


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

Status: closed as invalid on 2022/01/07 18:56
Subsystems: net
[Documentation on labels]
First crash: 850d, last: 850d
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) rds C 22 2023d 2044d 10/26 fixed on 2018/09/26 21:51
upstream KASAN: use-after-free Read in __rhashtable_lookup (3) net 1 1233d 1233d 0/26 auto-closed as invalid on 2021/02/08 22:50
upstream KASAN: use-after-free Read in __rhashtable_lookup (6) net 1 948d 948d 0/26 auto-closed as invalid on 2021/11/20 20:36
upstream KASAN: use-after-free Read in __rhashtable_lookup (5) net 1 1044d 1044d 0/26 auto-closed as invalid on 2021/08/17 13:23
upstream KASAN: use-after-free Read in __rhashtable_lookup (8) net 1 796d 796d 0/26 auto-closed as invalid on 2022/04/22 11:27
upstream KASAN: use-after-free Read in __rhashtable_lookup (4) net 1 1136d 1132d 0/26 auto-closed as invalid on 2021/05/16 18:04
upstream KASAN: use-after-free Read in __rhashtable_lookup rds 1 2063d 2059d 0/26 closed as dup on 2018/08/08 09:26

Sample crash report:
bridge0: received packet on bridge_slave_0 with own address as source address (addr:24:02:48:ff:05:00, vlan:0)
==================================================================
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 ffff888027c20008 by task ksoftirqd/1/19

CPU: 1 PID: 19 Comm: ksoftirqd/1 Not tainted 5.16.0-rc2-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:247
 __kasan_report mm/kasan/report.c:433 [inline]
 kasan_report.cold+0x83/0xdf mm/kasan/report.c:450
 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:5343
 __netif_receive_skb+0x24/0x1b0 net/core/dev.c:5457
 process_backlog+0x2a5/0x6c0 net/core/dev.c:5789
 __napi_poll+0xaf/0x440 net/core/dev.c:6357
 napi_poll net/core/dev.c:6424 [inline]
 net_rx_action+0x801/0xb40 net/core/dev.c:6511
 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558
 run_ksoftirqd kernel/softirq.c:920 [inline]
 run_ksoftirqd+0x2d/0x60 kernel/softirq.c:912
 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:ffffea00009f0800 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x27c20
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000000 ffffea000102cc08 ffffea0000fff208 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 0x52dc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_ZERO), pid 6922, ts 152512404122, free_ts 2580631739599
 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:4437
 __kmalloc_node+0x2ec/0x390 mm/slub.c:4453
 kmalloc_node include/linux/slab.h:613 [inline]
 kvmalloc_node+0xb4/0x120 mm/util.c:587
 kvmalloc include/linux/slab.h:741 [inline]
 kvzalloc include/linux/slab.h:749 [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+0x40f/0xa30 net/core/net_namespace.c:326
 copy_net_ns+0x318/0x760 net/core/net_namespace.c:470
 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/0x160 net/core/net_namespace.c:168
 cleanup_net+0x4ea/0xb00 net/core/net_namespace.c:593
 process_one_work+0x9b2/0x1690 kernel/workqueue.c:2298
 worker_thread+0x658/0x11f0 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:
 ffff888027c1ff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888027c1ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888027c20000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                      ^
 ffff888027c20080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff888027c20100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/11/28 21:51 net-next-old d40ce48cb3a6 63eeac02 .config console log report info ci-upstream-net-kasan-gce KASAN: use-after-free Read in __rhashtable_lookup
* Struck through repros no longer work on HEAD.