syzbot


KASAN: use-after-free Read in rht_deferred_worker

Status: auto-closed as invalid on 2021/03/01 02:23
Reported-by: syzbot+7928f2e8e6db71ec5337@syzkaller.appspotmail.com
First crash: 1483d, last: 1483d
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 KASAN: use-after-free Read in rht_deferred_worker (2) C error 4 806d 1357d 0/1 upstream: reported C repro on 2021/03/06 21:55

Sample crash report:
R13: 00007ffe5c62e42f R14: 00007f1f2e7c69c0 R15: 000000000118bf2c
FAULT_INJECTION: forcing a failure.
name failslab, interval 1, probability 0, space 0, times 0
==================================================================
CPU: 0 PID: 19126 Comm: syz-executor.4 Not tainted 4.14.203-syzkaller #0
BUG: KASAN: use-after-free in rhashtable_rehash_one lib/rhashtable.c:276 [inline]
BUG: KASAN: use-after-free in rhashtable_rehash_chain lib/rhashtable.c:316 [inline]
BUG: KASAN: use-after-free in rhashtable_rehash_table lib/rhashtable.c:364 [inline]
BUG: KASAN: use-after-free in rht_deferred_worker+0x1366/0x1890 lib/rhashtable.c:465
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Read of size 8 at addr ffff88809dc53300 by task kworker/1:3/7791
Call Trace:

 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x1b2/0x283 lib/dump_stack.c:58
 fail_dump lib/fault-inject.c:51 [inline]
 should_fail.cold+0x10a/0x154 lib/fault-inject.c:149
 should_failslab+0xd6/0x130 mm/failslab.c:32
 slab_pre_alloc_hook mm/slab.h:421 [inline]
 slab_alloc_node mm/slab.c:3297 [inline]
 kmem_cache_alloc_node+0x263/0x410 mm/slab.c:3640
 __alloc_skb+0x5c/0x510 net/core/skbuff.c:193
 alloc_skb include/linux/skbuff.h:980 [inline]
 tfilter_notify+0x89/0x240 net/sched/cls_api.c:472
 tc_ctl_tfilter+0x11af/0x1c01 net/sched/cls_api.c:743
 rtnetlink_rcv_msg+0x3be/0xb10 net/core/rtnetlink.c:4316
 netlink_rcv_skb+0x125/0x390 net/netlink/af_netlink.c:2433
 netlink_unicast_kernel net/netlink/af_netlink.c:1287 [inline]
 netlink_unicast+0x437/0x610 net/netlink/af_netlink.c:1313
 netlink_sendmsg+0x62e/0xb80 net/netlink/af_netlink.c:1878
 sock_sendmsg_nosec net/socket.c:646 [inline]
 sock_sendmsg+0xb5/0x100 net/socket.c:656
 ___sys_sendmsg+0x326/0x800 net/socket.c:2062
 __sys_sendmmsg+0x129/0x330 net/socket.c:2152
 SYSC_sendmmsg net/socket.c:2183 [inline]
 SyS_sendmmsg+0x2f/0x50 net/socket.c:2178
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x45deb9
RSP: 002b:00007f1f2e7c5c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000133
RAX: ffffffffffffffda RBX: 0000000000027fc0 RCX: 000000000045deb9
RDX: 010efe10675dec16 RSI: 0000000020000200 RDI: 0000000000000003
RBP: 00007f1f2e7c5ca0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000006
R13: 00007ffe5c62e42f R14: 00007f1f2e7c69c0 R15: 000000000118bf2c
CPU: 1 PID: 7791 Comm: kworker/1:3 Not tainted 4.14.203-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: events rht_deferred_worker
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x1b2/0x283 lib/dump_stack.c:58
 print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252
 kasan_report_error.cold+0x8a/0x194 mm/kasan/report.c:351
 kasan_report mm/kasan/report.c:409 [inline]
 __asan_report_load8_noabort+0x68/0x70 mm/kasan/report.c:430
 rhashtable_rehash_one lib/rhashtable.c:276 [inline]
 rhashtable_rehash_chain lib/rhashtable.c:316 [inline]
 rhashtable_rehash_table lib/rhashtable.c:364 [inline]
 rht_deferred_worker+0x1366/0x1890 lib/rhashtable.c:465
 process_one_work+0x793/0x14a0 kernel/workqueue.c:2116
 worker_thread+0x5cc/0xff0 kernel/workqueue.c:2250
 kthread+0x30d/0x420 kernel/kthread.c:232
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404

Allocated by task 19085:
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc+0xeb/0x160 mm/kasan/kasan.c:551
 kmem_cache_alloc_trace+0x131/0x3d0 mm/slab.c:3618
 kmalloc include/linux/slab.h:488 [inline]
 kzalloc include/linux/slab.h:661 [inline]
 fl_change+0x27e/0x4830 net/sched/cls_flower.c:919
 tc_ctl_tfilter+0xb54/0x1c01 net/sched/cls_api.c:738
 rtnetlink_rcv_msg+0x3be/0xb10 net/core/rtnetlink.c:4316
 netlink_rcv_skb+0x125/0x390 net/netlink/af_netlink.c:2433
 netlink_unicast_kernel net/netlink/af_netlink.c:1287 [inline]
 netlink_unicast+0x437/0x610 net/netlink/af_netlink.c:1313
 netlink_sendmsg+0x62e/0xb80 net/netlink/af_netlink.c:1878
 sock_sendmsg_nosec net/socket.c:646 [inline]
 sock_sendmsg+0xb5/0x100 net/socket.c:656
 ___sys_sendmsg+0x326/0x800 net/socket.c:2062
 __sys_sendmmsg+0x129/0x330 net/socket.c:2152
 SYSC_sendmmsg net/socket.c:2183 [inline]
 SyS_sendmmsg+0x2f/0x50 net/socket.c:2178
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb

Freed by task 478:
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_slab_free+0xc3/0x1a0 mm/kasan/kasan.c:524
 __cache_free mm/slab.c:3496 [inline]
 kfree+0xc9/0x250 mm/slab.c:3815
 fl_destroy_filter_work+0x1a/0x20 net/sched/cls_flower.c:234
 process_one_work+0x793/0x14a0 kernel/workqueue.c:2116
 worker_thread+0x5cc/0xff0 kernel/workqueue.c:2250
 kthread+0x30d/0x420 kernel/kthread.c:232
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404

The buggy address belongs to the object at ffff88809dc53300
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 0 bytes inside of
 512-byte region [ffff88809dc53300, ffff88809dc53500)
The buggy address belongs to the page:
page:ffffea00027714c0 count:1 mapcount:0 mapping:ffff88809dc53080 index:0x0
flags: 0xfff00000000100(slab)
raw: 00fff00000000100 ffff88809dc53080 0000000000000000 0000000100000006
raw: ffffea000268d6a0 ffffea00028cd7a0 ffff88813fe80940 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88809dc53200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff88809dc53280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88809dc53300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                   ^
 ffff88809dc53380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88809dc53400: 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/01 02:22 linux-4.14.y 2b7915014161 8bc4594f .config console log report info ci2-linux-4-14
* Struck through repros no longer work on HEAD.