syzbot


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

Status: auto-closed as invalid on 2021/08/17 13:23
Subsystems: net
[Documentation on labels]
First crash: 1065d, last: 1065d
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 2045d 2065d 10/26 fixed on 2018/09/26 21:51
upstream KASAN: use-after-free Read in __rhashtable_lookup (3) net 1 1255d 1255d 0/26 auto-closed as invalid on 2021/02/08 22:50
upstream KASAN: use-after-free Read in __rhashtable_lookup (6) net 1 970d 970d 0/26 auto-closed as invalid on 2021/11/20 20:36
upstream KASAN: use-after-free Read in __rhashtable_lookup (8) net 1 817d 817d 0/26 auto-closed as invalid on 2022/04/22 11:27
upstream KASAN: use-after-free Read in __rhashtable_lookup (7) net 1 872d 872d 0/26 closed as invalid on 2022/01/07 18:56
upstream KASAN: use-after-free Read in __rhashtable_lookup (4) net 1 1158d 1154d 0/26 auto-closed as invalid on 2021/05/16 18:04
upstream KASAN: use-after-free Read in __rhashtable_lookup rds 1 2084d 2080d 0/26 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+0x400/0x4e0 include/linux/rhashtable.h:596
Read of size 4 at addr ffff88801f6a0008 by task ksoftirqd/1/19

CPU: 1 PID: 19 Comm: ksoftirqd/1 Not tainted 5.12.0-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:79 [inline]
 dump_stack+0x141/0x1d7 lib/dump_stack.c:120
 print_address_description.constprop.0.cold+0x5b/0x2f8 mm/kasan/report.c:233
 __kasan_report mm/kasan/report.c:419 [inline]
 kasan_report.cold+0x7c/0xd8 mm/kasan/report.c:436
 rht_key_hashfn include/linux/rhashtable.h:159 [inline]
 __rhashtable_lookup.constprop.0+0x400/0x4e0 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:648 [inline]
 ila_nf_input+0x368/0x770 net/ipv6/ila/ila_xlat.c:191
 nf_hook_entry_hookfn include/linux/netfilter.h:136 [inline]
 nf_hook_slow+0xc5/0x1e0 net/netfilter/core.c:589
 nf_hook.constprop.0+0x377/0x650 include/linux/netfilter.h:256
 NF_HOOK include/linux/netfilter.h:299 [inline]
 ipv6_rcv+0x9e/0x3c0 net/ipv6/ip6_input.c:297
 __netif_receive_skb_one_core+0x114/0x180 net/core/dev.c:5440
 __netif_receive_skb+0x27/0x1c0 net/core/dev.c:5554
 process_backlog+0x232/0x6c0 net/core/dev.c:6418
 __napi_poll+0xaf/0x440 net/core/dev.c:6966
 napi_poll net/core/dev.c:7033 [inline]
 net_rx_action+0x801/0xb40 net/core/dev.c:7120
 __do_softirq+0x29b/0x9f6 kernel/softirq.c:559
 run_ksoftirqd kernel/softirq.c:921 [inline]
 run_ksoftirqd+0x2d/0x60 kernel/softirq.c:913
 smpboot_thread_fn+0x655/0x9e0 kernel/smpboot.c:165
 kthread+0x3b1/0x4a0 kernel/kthread.c:313
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294

The buggy address belongs to the page:
page:ffffea00007da800 refcount:0 mapcount:-128 mapping:0000000000000000 index:0x0 pfn:0x1f6a0
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000000 ffffea0001469c08 ffff88813fffb978 0000000000000000
raw: 0000000000000000 0000000000000003 00000000ffffff7f 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 8467, ts 120944534219, free_ts 2362377596912
 prep_new_page mm/page_alloc.c:2358 [inline]
 get_page_from_freelist+0x1033/0x2b60 mm/page_alloc.c:3994
 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5200
 __alloc_pages_node include/linux/gfp.h:549 [inline]
 alloc_pages_node include/linux/gfp.h:563 [inline]
 kmalloc_large_node+0x62/0x130 mm/slub.c:4081
 __kmalloc_node+0x303/0x380 mm/slub.c:4097
 kmalloc_node include/linux/slab.h:579 [inline]
 kvmalloc_node+0xb4/0xf0 mm/util.c:587
 kvmalloc include/linux/mm.h:804 [inline]
 kvzalloc include/linux/mm.h:812 [inline]
 bucket_table_alloc.isra.0+0x8b/0x490 lib/rhashtable.c:184
 rhashtable_init+0x318/0x7f0 lib/rhashtable.c:1061
 ila_xlat_init_net+0x1d1/0x2e0 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:333
 copy_net_ns+0x31e/0x760 net/core/net_namespace.c:474
 create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110
 unshare_nsproxy_namespaces+0xbd/0x1f0 kernel/nsproxy.c:226
 ksys_unshare+0x445/0x8e0 kernel/fork.c:2996
 __do_sys_unshare kernel/fork.c:3064 [inline]
 __se_sys_unshare kernel/fork.c:3062 [inline]
 __x64_sys_unshare+0x2d/0x40 kernel/fork.c:3062
 do_syscall_64+0x3a/0xb0 arch/x86/entry/common.c:47
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1298 [inline]
 __free_pages_ok+0x476/0xce0 mm/page_alloc.c:1572
 kvfree+0x42/0x50 mm/util.c:616
 rhashtable_free_and_destroy+0x164/0x920 lib/rhashtable.c:1159
 ila_xlat_exit_net+0x19a/0x350 net/ipv6/ila/ila_xlat.c:622
 ops_exit_list+0xb0/0x160 net/core/net_namespace.c:175
 cleanup_net+0x4ea/0xb10 net/core/net_namespace.c:595
 process_one_work+0x98d/0x1600 kernel/workqueue.c:2275
 worker_thread+0x64c/0x1120 kernel/workqueue.c:2421
 kthread+0x3b1/0x4a0 kernel/kthread.c:313
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294

Memory state around the buggy address:
 ffff88801f69ff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88801f69ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88801f6a0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                      ^
 ffff88801f6a0080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88801f6a0100: 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/05/19 13:23 bpf-next 1a532eb28df3 a343ba6b .config console log report info ci-upstream-bpf-next-kasan-gce KASAN: use-after-free Read in __rhashtable_lookup
* Struck through repros no longer work on HEAD.