syzbot


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

Status: auto-closed as invalid on 2021/02/08 22:50
Subsystems: net
[Documentation on labels]
First crash: 1455d, last: 1455d
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 2245d 2265d 10/28 fixed on 2018/09/26 21:51
upstream KASAN: use-after-free Read in __rhashtable_lookup (6) net 1 1170d 1170d 0/28 auto-closed as invalid on 2021/11/20 20:36
upstream KASAN: use-after-free Read in __rhashtable_lookup (5) net 1 1265d 1265d 0/28 auto-closed as invalid on 2021/08/17 13:23
upstream KASAN: use-after-free Read in __rhashtable_lookup (8) net 1 1018d 1018d 0/28 auto-closed as invalid on 2022/04/22 11:27
upstream KASAN: use-after-free Read in __rhashtable_lookup (7) net 1 1072d 1072d 0/28 closed as invalid on 2022/01/07 18:56
upstream KASAN: use-after-free Read in __rhashtable_lookup (4) net 1 1358d 1354d 0/28 auto-closed as invalid on 2021/05/16 18:04
upstream KASAN: use-after-free Read in __rhashtable_lookup rds 1 2285d 2281d 0/28 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 ffff888061142008 by task ksoftirqd/0/10

CPU: 0 PID: 10 Comm: ksoftirqd/0 Not tainted 5.10.0-rc2-syzkaller #0
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+0x107/0x163 lib/dump_stack.c:118
 print_address_description.constprop.0.cold+0xae/0x4c8 mm/kasan/report.c:385
 __kasan_report mm/kasan/report.c:545 [inline]
 kasan_report.cold+0x1f/0x37 mm/kasan/report.c:562
 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+0x379/0x650 include/linux/netfilter.h:256
 NF_HOOK include/linux/netfilter.h:299 [inline]
 ipv6_rcv+0x9e/0x3c0 net/ipv6/ip6_input.c:307
 __netif_receive_skb_one_core+0x114/0x180 net/core/dev.c:5315
 __netif_receive_skb+0x27/0x1c0 net/core/dev.c:5429
 process_backlog+0x232/0x6c0 net/core/dev.c:6319
 napi_poll net/core/dev.c:6763 [inline]
 net_rx_action+0x4dc/0x1100 net/core/dev.c:6833
 __do_softirq+0x2a0/0x9f6 kernel/softirq.c:298
 run_ksoftirqd kernel/softirq.c:653 [inline]
 run_ksoftirqd+0x2d/0x50 kernel/softirq.c:645
 smpboot_thread_fn+0x655/0x9e0 kernel/smpboot.c:165
 kthread+0x3af/0x4a0 kernel/kthread.c:292
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296

Allocated by task 9755:
 kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48
 kasan_set_track mm/kasan/common.c:56 [inline]
 __kasan_kmalloc.constprop.0+0xc2/0xd0 mm/kasan/common.c:461
 kmalloc_node include/linux/slab.h:575 [inline]
 kvmalloc_node+0x61/0xf0 mm/util.c:575
 kvmalloc include/linux/mm.h:765 [inline]
 kvzalloc include/linux/mm.h:773 [inline]
 bucket_table_alloc.isra.0+0x8b/0x480 lib/rhashtable.c:184
 rhashtable_rehash_alloc+0x68/0x110 lib/rhashtable.c:360
 rhashtable_shrink lib/rhashtable.c:404 [inline]
 rht_deferred_worker+0x178c/0x1d40 lib/rhashtable.c:422
 process_one_work+0x933/0x15a0 kernel/workqueue.c:2272
 worker_thread+0x64c/0x1120 kernel/workqueue.c:2418
 kthread+0x3af/0x4a0 kernel/kthread.c:292
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296

Freed by task 639:
 kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48
 kasan_set_track+0x1c/0x30 mm/kasan/common.c:56
 kasan_set_free_info+0x1b/0x30 mm/kasan/generic.c:355
 __kasan_slab_free+0x102/0x140 mm/kasan/common.c:422
 slab_free_hook mm/slub.c:1544 [inline]
 slab_free_freelist_hook+0x5d/0x150 mm/slub.c:1577
 slab_free mm/slub.c:3142 [inline]
 kfree+0xdb/0x360 mm/slub.c:4124
 kvfree+0x42/0x50 mm/util.c:604
 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:187
 cleanup_net+0x4ea/0xa00 net/core/net_namespace.c:604
 process_one_work+0x933/0x15a0 kernel/workqueue.c:2272
 worker_thread+0x64c/0x1120 kernel/workqueue.c:2418
 kthread+0x3af/0x4a0 kernel/kthread.c:292
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296

The buggy address belongs to the object at ffff888061142000
 which belongs to the cache kmalloc-4k of size 4096
The buggy address is located 8 bytes inside of
 4096-byte region [ffff888061142000, ffff888061143000)
The buggy address belongs to the page:
page:0000000017a2c172 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x61140
head:0000000017a2c172 order:3 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head)
raw: 00fff00000010200 dead000000000100 dead000000000122 ffff888010042140
raw: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff888061141f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888061141f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888061142000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                      ^
 ffff888061142080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888061142100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/11/10 22:48 bpf abbaa433de07 cca87986 .config console log report info ci-upstream-bpf-kasan-gce
* Struck through repros no longer work on HEAD.