KASAN: use-after-free Read in prepare_to_wait_event (2)

12 views
Skip to first unread message

syzbot

unread,
Jul 23, 2020, 2:13:20 AM7/23/20
to syzkaller-upst...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: f932d58a Merge tag 'scsi-fixes' of git://git.kernel.org/pu..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=115db20f100000
kernel config: https://syzkaller.appspot.com/x/.config?x=a160d1053fc89af5
dashboard link: https://syzkaller.appspot.com/bug?extid=719b61b6742dad330b17
compiler: gcc (GCC) 10.1.0-syz 20200507
CC: [b...@zurich.ibm.com dled...@redhat.com j...@ziepe.ca kris...@chelsio.com linux-...@vger.kernel.org linux...@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+719b61...@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: use-after-free in __lock_acquire+0x3c7b/0x56e0 kernel/locking/lockdep.c:4250
Read of size 8 at addr ffff8880a30b12c8 by task syz-executor.1/29002

CPU: 1 PID: 29002 Comm: syz-executor.1 Not tainted 5.8.0-rc5-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+0x18f/0x20d lib/dump_stack.c:118
print_address_description.constprop.0.cold+0xae/0x436 mm/kasan/report.c:383
__kasan_report mm/kasan/report.c:513 [inline]
kasan_report.cold+0x1f/0x37 mm/kasan/report.c:530
__lock_acquire+0x3c7b/0x56e0 kernel/locking/lockdep.c:4250
lock_acquire+0x1f1/0xad0 kernel/locking/lockdep.c:4959
__raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline]
_raw_spin_lock_irqsave+0x8c/0xc0 kernel/locking/spinlock.c:159
prepare_to_wait_event+0x5b/0x650 kernel/sched/wait.c:280
iw_cm_disconnect+0x295/0x320 drivers/infiniband/core/iwcm.c:316
rdma_disconnect+0x12a/0xab0 drivers/infiniband/core/cma.c:4307
p9_cm_event_handler+0x17c/0x2f0 net/9p/trans_rdma.c:280
cma_cm_event_handler+0xa9/0x610 drivers/infiniband/core/cma.c:1929
cma_remove_id_dev drivers/infiniband/core/cma.c:4811 [inline]
cma_process_remove drivers/infiniband/core/cma.c:4832 [inline]
cma_remove_one+0x782/0xbf0 drivers/infiniband/core/cma.c:4855
remove_client_context+0xbe/0x110 drivers/infiniband/core/device.c:736
disable_device+0x13b/0x270 drivers/infiniband/core/device.c:1282
__ib_unregister_device+0x91/0x190 drivers/infiniband/core/device.c:1450
ib_unregister_device_and_put+0x57/0x80 drivers/infiniband/core/device.c:1514
nldev_dellink+0x209/0x310 drivers/infiniband/core/nldev.c:1571
rdma_nl_rcv_msg+0x34a/0x5b0 drivers/infiniband/core/netlink.c:195
rdma_nl_rcv_skb drivers/infiniband/core/netlink.c:239 [inline]
rdma_nl_rcv+0x31a/0x470 drivers/infiniband/core/netlink.c:259
netlink_unicast_kernel net/netlink/af_netlink.c:1303 [inline]
netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1329
netlink_sendmsg+0x856/0xd90 net/netlink/af_netlink.c:1918
sock_sendmsg_nosec net/socket.c:652 [inline]
sock_sendmsg+0xcf/0x120 net/socket.c:672
____sys_sendmsg+0x6e8/0x810 net/socket.c:2352
___sys_sendmsg+0xf3/0x170 net/socket.c:2406
__sys_sendmsg+0xe5/0x1b0 net/socket.c:2439
do_syscall_64+0x60/0xe0 arch/x86/entry/common.c:384
entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x45c1d9
Code: Bad RIP value.
RSP: 002b:00007fc297ab7c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 0000000000029840 RCX: 000000000045c1d9
RDX: 0000000000000000 RSI: 0000000020002b40 RDI: 0000000000000003
RBP: 000000000078bf40 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000078bf0c
R13: 00007ffc28e3de2f R14: 00007fc297ab89c0 R15: 000000000078bf0c

Allocated by task 28994:
save_stack+0x1b/0x40 mm/kasan/common.c:48
set_track mm/kasan/common.c:56 [inline]
__kasan_kmalloc.constprop.0+0xc2/0xd0 mm/kasan/common.c:494
kmem_cache_alloc_trace+0x14f/0x2d0 mm/slab.c:3551
kmalloc include/linux/slab.h:555 [inline]
kzalloc include/linux/slab.h:669 [inline]
iw_create_cm_id+0x52/0x3a0 drivers/infiniband/core/iwcm.c:248
cma_connect_iw drivers/infiniband/core/cma.c:3996 [inline]
rdma_connect+0x46f/0x1ec0 drivers/infiniband/core/cma.c:4052
rdma_create_trans+0xefc/0x13e0 net/9p/trans_rdma.c:722
p9_client_create+0x81a/0x10c0 net/9p/client.c:1039
v9fs_session_init+0x1dd/0x1770 fs/9p/v9fs.c:406
v9fs_mount+0x79/0x970 fs/9p/vfs_super.c:124
legacy_get_tree+0x105/0x220 fs/fs_context.c:592
vfs_get_tree+0x89/0x2f0 fs/super.c:1547
do_new_mount fs/namespace.c:2875 [inline]
do_mount+0x1592/0x1fe0 fs/namespace.c:3200
__do_sys_mount fs/namespace.c:3410 [inline]
__se_sys_mount fs/namespace.c:3387 [inline]
__x64_sys_mount+0x18f/0x230 fs/namespace.c:3387
do_syscall_64+0x60/0xe0 arch/x86/entry/common.c:384
entry_SYSCALL_64_after_hwframe+0x44/0xa9

Freed by task 28994:
save_stack+0x1b/0x40 mm/kasan/common.c:48
set_track mm/kasan/common.c:56 [inline]
kasan_set_free_info mm/kasan/common.c:316 [inline]
__kasan_slab_free+0xf5/0x140 mm/kasan/common.c:455
__cache_free mm/slab.c:3426 [inline]
kfree+0x103/0x2c0 mm/slab.c:3757
free_cm_id drivers/infiniband/core/iwcm.c:205 [inline]
iwcm_deref_id+0xd4/0x120 drivers/infiniband/core/iwcm.c:217
destroy_cm_id+0x266/0x520 drivers/infiniband/core/iwcm.c:444
cma_connect_iw drivers/infiniband/core/cma.c:4026 [inline]
rdma_connect+0xf22/0x1ec0 drivers/infiniband/core/cma.c:4052
rdma_create_trans+0xefc/0x13e0 net/9p/trans_rdma.c:722
p9_client_create+0x81a/0x10c0 net/9p/client.c:1039
v9fs_session_init+0x1dd/0x1770 fs/9p/v9fs.c:406
v9fs_mount+0x79/0x970 fs/9p/vfs_super.c:124
legacy_get_tree+0x105/0x220 fs/fs_context.c:592
vfs_get_tree+0x89/0x2f0 fs/super.c:1547
do_new_mount fs/namespace.c:2875 [inline]
do_mount+0x1592/0x1fe0 fs/namespace.c:3200
__do_sys_mount fs/namespace.c:3410 [inline]
__se_sys_mount fs/namespace.c:3387 [inline]
__x64_sys_mount+0x18f/0x230 fs/namespace.c:3387
do_syscall_64+0x60/0xe0 arch/x86/entry/common.c:384
entry_SYSCALL_64_after_hwframe+0x44/0xa9

The buggy address belongs to the object at ffff8880a30b1000
which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 712 bytes inside of
1024-byte region [ffff8880a30b1000, ffff8880a30b1400)
The buggy address belongs to the page:
page:ffffea00028c2c40 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0
flags: 0xfffe0000000200(slab)
raw: 00fffe0000000200 ffffea00027a5408 ffffea00029a1f08 ffff8880aa000c40
raw: 0000000000000000 ffff8880a30b1000 0000000100000002 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff8880a30b1180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880a30b1200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8880a30b1280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8880a30b1300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880a30b1380: 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,
Oct 17, 2020, 2:03:11 AM10/17/20
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