syzbot


KASAN: use-after-free Read in __rxrpc_put_peer

Status: auto-closed as invalid on 2020/02/18 20:47
Reported-by: syzbot+d75ab31392f2a068a8d4@syzkaller.appspotmail.com
First crash: 1865d, last: 1859d

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in __rxrpc_put_peer+0x1a5/0x1df net/rxrpc/peer_object.c:389
Read of size 8 at addr ffff8880887b0918 by task ksoftirqd/0/7

CPU: 0 PID: 7 Comm: ksoftirqd/0 Not tainted 4.14.150 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x138/0x197 lib/dump_stack.c:53
 print_address_description.cold+0x7c/0x1dc mm/kasan/report.c:252
 kasan_report_error mm/kasan/report.c:351 [inline]
 kasan_report mm/kasan/report.c:409 [inline]
 kasan_report.cold+0xa9/0x2af mm/kasan/report.c:393
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430
 __rxrpc_put_peer+0x1a5/0x1df net/rxrpc/peer_object.c:389
 rxrpc_put_peer net/rxrpc/ar-internal.h:999 [inline]
 rxrpc_rcu_destroy_call+0xc5/0xf0 net/rxrpc/call_object.c:642
 __rcu_reclaim kernel/rcu/rcu.h:195 [inline]
 rcu_do_batch kernel/rcu/tree.c:2699 [inline]
 invoke_rcu_callbacks kernel/rcu/tree.c:2962 [inline]
 __rcu_process_callbacks kernel/rcu/tree.c:2929 [inline]
 rcu_process_callbacks+0x7b8/0x12b0 kernel/rcu/tree.c:2946
 __do_softirq+0x244/0x9a0 kernel/softirq.c:288
 run_ksoftirqd kernel/softirq.c:670 [inline]
 run_ksoftirqd+0x8c/0x1b0 kernel/softirq.c:662
 smpboot_thread_fn+0x5f4/0x960 kernel/smpboot.c:164
 kthread+0x319/0x430 kernel/kthread.c:232
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404

Allocated by task 3152:
 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
 save_stack+0x45/0xd0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc mm/kasan/kasan.c:551 [inline]
 kasan_kmalloc+0xce/0xf0 mm/kasan/kasan.c:529
 kmem_cache_alloc_trace+0x152/0x790 mm/slab.c:3618
 kmalloc include/linux/slab.h:488 [inline]
 kzalloc include/linux/slab.h:661 [inline]
 rxrpc_alloc_local net/rxrpc/local_object.c:82 [inline]
 rxrpc_lookup_local+0x586/0x14a0 net/rxrpc/local_object.c:252
 rxrpc_sendmsg+0x3b1/0x610 net/rxrpc/af_rxrpc.c:525
 sock_sendmsg_nosec net/socket.c:646 [inline]
 sock_sendmsg+0xce/0x110 net/socket.c:656
 ___sys_sendmsg+0x349/0x840 net/socket.c:2062
 __sys_sendmmsg+0x152/0x3a0 net/socket.c:2152
 SYSC_sendmmsg net/socket.c:2183 [inline]
 SyS_sendmmsg+0x35/0x60 net/socket.c:2178
 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7

Freed by task 17:
 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
 save_stack+0x45/0xd0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_slab_free+0x75/0xc0 mm/kasan/kasan.c:524
 __cache_free mm/slab.c:3496 [inline]
 kfree+0xcc/0x270 mm/slab.c:3815
 rxrpc_local_rcu+0x44/0x50 net/rxrpc/local_object.c:383
 __rcu_reclaim kernel/rcu/rcu.h:195 [inline]
 rcu_do_batch kernel/rcu/tree.c:2699 [inline]
 invoke_rcu_callbacks kernel/rcu/tree.c:2962 [inline]
 __rcu_process_callbacks kernel/rcu/tree.c:2929 [inline]
 rcu_process_callbacks+0x7b8/0x12b0 kernel/rcu/tree.c:2946
 __do_softirq+0x244/0x9a0 kernel/softirq.c:288

The buggy address belongs to the object at ffff8880887b0900
 which belongs to the cache kmalloc-1024 of size 1024
The buggy address is located 24 bytes inside of
 1024-byte region [ffff8880887b0900, ffff8880887b0d00)
The buggy address belongs to the page:
page:ffffea000221ec00 count:1 mapcount:0 mapping:ffff8880887b0000 index:0x0 compound_mapcount: 0
flags: 0x1fffc0000008100(slab|head)
raw: 01fffc0000008100 ffff8880887b0000 0000000000000000 0000000100000007
raw: ffffea00027e51a0 ffffea000220f020 ffff8880aa800ac0 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880887b0800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8880887b0880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8880887b0900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                            ^
 ffff8880887b0980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8880887b0a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/10/21 20:47 linux-4.14.y b98aebd29824 b24d2b8a .config console log report ci2-linux-4-14
2019/10/16 05:34 linux-4.14.y e132c8d7b58d d4ea592f .config console log report ci2-linux-4-14
* Struck through repros no longer work on HEAD.