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

5 views
Skip to first unread message

syzbot

unread,
Feb 19, 2021, 1:05:24 PM2/19/21
to syzkaller-upst...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 57baf8cc net: axienet: Handle deferred probe on clock prop..
git tree: bpf
console output: https://syzkaller.appspot.com/x/log.txt?x=11c4f822d00000
kernel config: https://syzkaller.appspot.com/x/.config?x=8cb23303ddb9411f
dashboard link: https://syzkaller.appspot.com/bug?extid=c9f7a532a091f80063b6
CC: [da...@davemloft.net dsa...@kernel.org ku...@kernel.org linux-...@vger.kernel.org net...@vger.kernel.org yosh...@linux-ipv6.org yueha...@huawei.com net...@vger.kernel.org]

Unfortunately, I don't have any reproducer for this issue yet.

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+c9f7a5...@syzkaller.appspotmail.com

==================================================================
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 ffff888011d38008 by task syz-executor.2/8433

CPU: 1 PID: 8433 Comm: syz-executor.2 Not tainted 5.11.0-rc7-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
<IRQ>
__dump_stack lib/dump_stack.c:79 [inline]
dump_stack+0x107/0x163 lib/dump_stack.c:120
print_address_description.constprop.0.cold+0x5b/0x2f8 mm/kasan/report.c:230
__kasan_report mm/kasan/report.c:396 [inline]
kasan_report.cold+0x79/0xd5 mm/kasan/report.c:413
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:307
__netif_receive_skb_one_core+0x114/0x180 net/core/dev.c:5323
__netif_receive_skb+0x27/0x1c0 net/core/dev.c:5437
process_backlog+0x232/0x6c0 net/core/dev.c:6328
napi_poll net/core/dev.c:6806 [inline]
net_rx_action+0x461/0xe10 net/core/dev.c:6889
__do_softirq+0x29b/0x9f6 kernel/softirq.c:343
asm_call_irq_on_stack+0xf/0x20
</IRQ>
__run_on_irqstack arch/x86/include/asm/irq_stack.h:26 [inline]
run_on_irqstack_cond arch/x86/include/asm/irq_stack.h:77 [inline]
do_softirq_own_stack+0xaa/0xd0 arch/x86/kernel/irq_64.c:77
do_softirq kernel/softirq.c:246 [inline]
do_softirq+0xb5/0xe0 kernel/softirq.c:233
__local_bh_enable_ip+0xf4/0x110 kernel/softirq.c:196
local_bh_enable include/linux/bottom_half.h:32 [inline]
fpregs_unlock arch/x86/include/asm/fpu/api.h:66 [inline]
fpu__copy+0x182/0x660 arch/x86/kernel/fpu/core.c:246
dup_task_struct kernel/fork.c:873 [inline]
copy_process+0x902/0x6fd0 kernel/fork.c:1940
kernel_clone+0xe7/0xab0 kernel/fork.c:2462
__do_sys_clone+0xc8/0x110 kernel/fork.c:2579
do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x46438b
Code: ed 0f 85 60 01 00 00 64 4c 8b 0c 25 10 00 00 00 45 31 c0 4d 8d 91 d0 02 00 00 31 d2 31 f6 bf 11 00 20 01 b8 38 00 00 00 0f 05 <48> 3d 00 f0 ff ff 0f 87 89 00 00 00 41 89 c5 85 c0 0f 85 90 00 00
RSP: 002b:00007ffd819be450 EFLAGS: 00000246 ORIG_RAX: 0000000000000038
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 000000000046438b
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000001200011
RBP: 0000000000000001 R08: 0000000000000000 R09: 000000000319c400
R10: 000000000319c6d0 R11: 0000000000000246 R12: 0000000000000001
R13: 0000000000000000 R14: 0000000000000001 R15: 00007ffd819be540

Allocated by task 4882:
kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38
kasan_set_track mm/kasan/common.c:46 [inline]
set_alloc_info mm/kasan/common.c:401 [inline]
____kasan_kmalloc.constprop.0+0x82/0xa0 mm/kasan/common.c:429
kmalloc include/linux/slab.h:552 [inline]
kzalloc include/linux/slab.h:682 [inline]
kernfs_iop_get_link fs/kernfs/symlink.c:135 [inline]
kernfs_iop_get_link+0x61/0x6e0 fs/kernfs/symlink.c:126
vfs_readlink+0x1d7/0x390 fs/namei.c:4558
do_readlinkat+0x27e/0x2f0 fs/stat.c:419
__do_sys_readlinkat fs/stat.c:434 [inline]
__se_sys_readlinkat fs/stat.c:431 [inline]
__x64_sys_readlinkat+0x93/0xf0 fs/stat.c:431
do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
entry_SYSCALL_64_after_hwframe+0x44/0xa9

Freed by task 4882:
kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38
kasan_set_track+0x1c/0x30 mm/kasan/common.c:46
kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:356
____kasan_slab_free+0xe1/0x110 mm/kasan/common.c:362
kasan_slab_free include/linux/kasan.h:192 [inline]
slab_free_hook mm/slub.c:1547 [inline]
slab_free_freelist_hook+0x5d/0x150 mm/slub.c:1580
slab_free mm/slub.c:3143 [inline]
kfree+0xdb/0x3b0 mm/slub.c:4139
do_delayed_call include/linux/delayed_call.h:28 [inline]
vfs_readlink+0x142/0x390 fs/namei.c:4563
do_readlinkat+0x27e/0x2f0 fs/stat.c:419
__do_sys_readlinkat fs/stat.c:434 [inline]
__se_sys_readlinkat fs/stat.c:431 [inline]
__x64_sys_readlinkat+0x93/0xf0 fs/stat.c:431
do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
entry_SYSCALL_64_after_hwframe+0x44/0xa9

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

Memory state around the buggy address:
ffff888011d37f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888011d37f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888011d38000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888011d38080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888011d38100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

syzbot

unread,
May 16, 2021, 2:04:17 PM5/16/21
to syzkaller-upst...@googlegroups.com
Auto-closing this bug as obsolete.
Crashes did not happen for a while, no reproducer and no activity.
Reply all
Reply to author
Forward
0 new messages