KASAN: use-after-free Read in p9_client_clunk

6 views
Skip to first unread message

syzbot

unread,
Apr 19, 2019, 8:12:06 PM4/19/19
to syzkaller...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: 58b454eb Linux 4.14.112
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=16d24447200000
kernel config: https://syzkaller.appspot.com/x/.config?x=8b0e7ab7678533ab
dashboard link: https://syzkaller.appspot.com/bug?extid=cf09ac84eeb8ec9efd46
compiler: gcc (GCC) 9.0.0 20181231 (experimental)

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

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

RBP: 000000000073bf00 R08: 0000000020000600 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f6ef67e66d4
R13: 00000000004c4c14 R14: 00000000004d88a0 R15: 0000000000000004
9pnet: Found fid 0 not clunked
==================================================================
BUG: KASAN: use-after-free in p9_client_clunk+0x131/0x150
net/9p/client.c:1505
Read of size 8 at addr ffff88808c472d00 by task syz-executor.4/13558

CPU: 1 PID: 13558 Comm: syz-executor.4 Not tainted 4.14.112 #2
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/0x19c 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+0xaf/0x2b5 mm/kasan/report.c:393
__asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430
p9_client_clunk+0x131/0x150 net/9p/client.c:1505
v9fs_mount+0x6b9/0x870 fs/9p/vfs_super.c:200
mount_fs+0x9d/0x2a7 fs/super.c:1237
vfs_kern_mount.part.0+0x5e/0x3d0 fs/namespace.c:1046
vfs_kern_mount fs/namespace.c:1036 [inline]
do_new_mount fs/namespace.c:2549 [inline]
do_mount+0x417/0x27d0 fs/namespace.c:2879
SYSC_mount fs/namespace.c:3095 [inline]
SyS_mount+0xab/0x120 fs/namespace.c:3072
do_syscall_64+0x1eb/0x630 arch/x86/entry/common.c:289
entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x458c29
RSP: 002b:00007f6ef67e5c78 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f6ef67e5c90 RCX: 0000000000458c29
RDX: 00000000200005c0 RSI: 0000000020000580 RDI: 0000000000000000
RBP: 000000000073bf00 R08: 0000000020000600 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f6ef67e66d4
R13: 00000000004c4c14 R14: 00000000004d88a0 R15: 0000000000000004

Allocated by task 13558:
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]
p9_fid_create+0x4e/0x3b0 net/9p/client.c:918
p9_client_attach+0x7f/0x6a0 net/9p/client.c:1158
v9fs_session_init+0xbe8/0x1590 fs/9p/v9fs.c:450
v9fs_mount+0x7d/0x870 fs/9p/vfs_super.c:135
mount_fs+0x9d/0x2a7 fs/super.c:1237
vfs_kern_mount.part.0+0x5e/0x3d0 fs/namespace.c:1046
vfs_kern_mount fs/namespace.c:1036 [inline]
do_new_mount fs/namespace.c:2549 [inline]
do_mount+0x417/0x27d0 fs/namespace.c:2879
SYSC_mount fs/namespace.c:3095 [inline]
SyS_mount+0xab/0x120 fs/namespace.c:3072
do_syscall_64+0x1eb/0x630 arch/x86/entry/common.c:289
entry_SYSCALL_64_after_hwframe+0x42/0xb7

Freed by task 13558:
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
p9_fid_destroy+0x1cd/0x280 net/9p/client.c:957
p9_client_destroy.cold+0x61/0xac net/9p/client.c:1121
v9fs_session_close+0x4a/0x2c0 fs/9p/v9fs.c:490
v9fs_kill_super+0x4e/0xa0 fs/9p/vfs_super.c:233
deactivate_locked_super+0x79/0xe0 fs/super.c:319
sget_userns+0x9df/0xc30 fs/super.c:537
sget+0xd6/0x120 fs/super.c:572
v9fs_mount+0xa8/0x870 fs/9p/vfs_super.c:141
mount_fs+0x9d/0x2a7 fs/super.c:1237
vfs_kern_mount.part.0+0x5e/0x3d0 fs/namespace.c:1046
vfs_kern_mount fs/namespace.c:1036 [inline]
do_new_mount fs/namespace.c:2549 [inline]
do_mount+0x417/0x27d0 fs/namespace.c:2879
SYSC_mount fs/namespace.c:3095 [inline]
SyS_mount+0xab/0x120 fs/namespace.c:3072
do_syscall_64+0x1eb/0x630 arch/x86/entry/common.c:289
entry_SYSCALL_64_after_hwframe+0x42/0xb7

The buggy address belongs to the object at ffff88808c472d00
which belongs to the cache kmalloc-96 of size 96
The buggy address is located 0 bytes inside of
96-byte region [ffff88808c472d00, ffff88808c472d60)
The buggy address belongs to the page:
page:ffffea0002311c80 count:1 mapcount:0 mapping:ffff88808c472000 index:0x0
flags: 0x1fffc0000000100(slab)
raw: 01fffc0000000100 ffff88808c472000 0000000000000000 0000000100000020
raw: ffffea00025b0d20 ffffea00025b77a0 ffff8880aa8004c0 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff88808c472c00: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
ffff88808c472c80: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
> ffff88808c472d00: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
^
ffff88808c472d80: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
ffff88808c472e00: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
==================================================================


---
This bug 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 bug report. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

syzbot

unread,
Apr 19, 2019, 8:31:06 PM4/19/19
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following crash on:

HEAD commit: 58b454eb Linux 4.14.112
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=10dd656b200000
kernel config: https://syzkaller.appspot.com/x/.config?x=8b0e7ab7678533ab
dashboard link: https://syzkaller.appspot.com/bug?extid=cf09ac84eeb8ec9efd46
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=17743ecb200000

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

RBP: 000000000073bf00 R08: 0000000020000600 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000001a48914
R13: 00000000004c4c14 R14: 00000000004d88a0 R15: 0000000000000004
9pnet: Found fid 0 not clunked
==================================================================
BUG: KASAN: use-after-free in p9_client_clunk+0x131/0x150
net/9p/client.c:1505
Read of size 8 at addr ffff88809ae6ff00 by task syz-executor.0/7625

CPU: 0 PID: 7625 Comm: syz-executor.0 Not tainted 4.14.112 #2
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/0x19c 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+0xaf/0x2b5 mm/kasan/report.c:393
__asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430
p9_client_clunk+0x131/0x150 net/9p/client.c:1505
v9fs_mount+0x6b9/0x870 fs/9p/vfs_super.c:200
mount_fs+0x9d/0x2a7 fs/super.c:1237
vfs_kern_mount.part.0+0x5e/0x3d0 fs/namespace.c:1046
vfs_kern_mount fs/namespace.c:1036 [inline]
do_new_mount fs/namespace.c:2549 [inline]
do_mount+0x417/0x27d0 fs/namespace.c:2879
SYSC_mount fs/namespace.c:3095 [inline]
SyS_mount+0xab/0x120 fs/namespace.c:3072
do_syscall_64+0x1eb/0x630 arch/x86/entry/common.c:289
entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x458c29
RSP: 002b:00007ffe57dc94f8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007ffe57dc9510 RCX: 0000000000458c29
RDX: 00000000200005c0 RSI: 0000000020000580 RDI: 0000000000000000
RBP: 000000000073bf00 R08: 0000000020000600 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000001a48914
R13: 00000000004c4c14 R14: 00000000004d88a0 R15: 0000000000000004

Allocated by task 7625:
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]
p9_fid_create+0x4e/0x3b0 net/9p/client.c:918
p9_client_attach+0x7f/0x6a0 net/9p/client.c:1158
v9fs_session_init+0xbe8/0x1590 fs/9p/v9fs.c:450
v9fs_mount+0x7d/0x870 fs/9p/vfs_super.c:135
mount_fs+0x9d/0x2a7 fs/super.c:1237
vfs_kern_mount.part.0+0x5e/0x3d0 fs/namespace.c:1046
vfs_kern_mount fs/namespace.c:1036 [inline]
do_new_mount fs/namespace.c:2549 [inline]
do_mount+0x417/0x27d0 fs/namespace.c:2879
SYSC_mount fs/namespace.c:3095 [inline]
SyS_mount+0xab/0x120 fs/namespace.c:3072
do_syscall_64+0x1eb/0x630 arch/x86/entry/common.c:289
entry_SYSCALL_64_after_hwframe+0x42/0xb7

Freed by task 7625:
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
p9_fid_destroy+0x1cd/0x280 net/9p/client.c:957
p9_client_destroy.cold+0x61/0xac net/9p/client.c:1121
v9fs_session_close+0x4a/0x2c0 fs/9p/v9fs.c:490
v9fs_kill_super+0x4e/0xa0 fs/9p/vfs_super.c:233
deactivate_locked_super+0x79/0xe0 fs/super.c:319
sget_userns+0x9df/0xc30 fs/super.c:537
sget+0xd6/0x120 fs/super.c:572
v9fs_mount+0xa8/0x870 fs/9p/vfs_super.c:141
mount_fs+0x9d/0x2a7 fs/super.c:1237
vfs_kern_mount.part.0+0x5e/0x3d0 fs/namespace.c:1046
vfs_kern_mount fs/namespace.c:1036 [inline]
do_new_mount fs/namespace.c:2549 [inline]
do_mount+0x417/0x27d0 fs/namespace.c:2879
SYSC_mount fs/namespace.c:3095 [inline]
SyS_mount+0xab/0x120 fs/namespace.c:3072
do_syscall_64+0x1eb/0x630 arch/x86/entry/common.c:289
entry_SYSCALL_64_after_hwframe+0x42/0xb7

The buggy address belongs to the object at ffff88809ae6ff00
which belongs to the cache kmalloc-96 of size 96
The buggy address is located 0 bytes inside of
96-byte region [ffff88809ae6ff00, ffff88809ae6ff60)
The buggy address belongs to the page:
page:ffffea00026b9bc0 count:1 mapcount:0 mapping:ffff88809ae6f000 index:0x0
flags: 0x1fffc0000000100(slab)
raw: 01fffc0000000100 ffff88809ae6f000 0000000000000000 0000000100000020
raw: ffffea00026ba060 ffffea00026966a0 ffff8880aa8004c0 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff88809ae6fe00: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
ffff88809ae6fe80: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
> ffff88809ae6ff00: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
^
ffff88809ae6ff80: 00 00 00 00 00 00 00 00 00 01 fc fc fc fc fc fc
ffff88809ae70000: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00
==================================================================

syzbot

unread,
Apr 21, 2019, 4:46:06 AM4/21/19
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following crash on:

HEAD commit: 68d7a45e Linux 4.14.113
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=17342838a00000
kernel config: https://syzkaller.appspot.com/x/.config?x=dbf1fde4d7489e1c
dashboard link: https://syzkaller.appspot.com/bug?extid=cf09ac84eeb8ec9efd46
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=127fa97b200000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=11a8bb08a00000

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

RBP: 00007ffde48c7e70 R08: 0000000020000040 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: ffffffffffffffff
R13: 0000000000000004 R14: 0000000000000000 R15: 0000000000000000
9pnet: Found fid 0 not clunked
==================================================================
BUG: KASAN: use-after-free in p9_client_clunk+0x131/0x150
net/9p/client.c:1505
Read of size 8 at addr ffff8880a84ec380 by task syz-executor355/7808

CPU: 1 PID: 7808 Comm: syz-executor355 Not tainted 4.14.113 #3
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/0x19c 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+0xaf/0x2b5 mm/kasan/report.c:393
__asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430
p9_client_clunk+0x131/0x150 net/9p/client.c:1505
v9fs_mount+0x6b9/0x870 fs/9p/vfs_super.c:200
mount_fs+0x9d/0x2a7 fs/super.c:1237
vfs_kern_mount.part.0+0x5e/0x3d0 fs/namespace.c:1046
vfs_kern_mount fs/namespace.c:1036 [inline]
do_new_mount fs/namespace.c:2549 [inline]
do_mount+0x417/0x27d0 fs/namespace.c:2879
SYSC_mount fs/namespace.c:3095 [inline]
SyS_mount+0xab/0x120 fs/namespace.c:3072
do_syscall_64+0x1eb/0x630 arch/x86/entry/common.c:289
entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x441249
RSP: 002b:00007ffde48c7e58 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000441249
RDX: 00000000200005c0 RSI: 0000000020000580 RDI: 0000000000000000
RBP: 00007ffde48c7e70 R08: 0000000020000040 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: ffffffffffffffff
R13: 0000000000000004 R14: 0000000000000000 R15: 0000000000000000

Allocated by task 7808:
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]
p9_fid_create+0x4e/0x3b0 net/9p/client.c:918
p9_client_attach+0x7f/0x6a0 net/9p/client.c:1158
v9fs_session_init+0xc5c/0x1630 fs/9p/v9fs.c:471
v9fs_mount+0x7d/0x870 fs/9p/vfs_super.c:135
mount_fs+0x9d/0x2a7 fs/super.c:1237
vfs_kern_mount.part.0+0x5e/0x3d0 fs/namespace.c:1046
vfs_kern_mount fs/namespace.c:1036 [inline]
do_new_mount fs/namespace.c:2549 [inline]
do_mount+0x417/0x27d0 fs/namespace.c:2879
SYSC_mount fs/namespace.c:3095 [inline]
SyS_mount+0xab/0x120 fs/namespace.c:3072
do_syscall_64+0x1eb/0x630 arch/x86/entry/common.c:289
entry_SYSCALL_64_after_hwframe+0x42/0xb7

Freed by task 7808:
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
p9_fid_destroy+0x1cd/0x280 net/9p/client.c:957
p9_client_destroy.cold+0x61/0xac net/9p/client.c:1121
v9fs_session_close+0x4a/0x2c0 fs/9p/v9fs.c:511
v9fs_kill_super+0x4e/0xa0 fs/9p/vfs_super.c:233
deactivate_locked_super+0x79/0xe0 fs/super.c:319
sget_userns+0x9df/0xc30 fs/super.c:537
sget+0xd6/0x120 fs/super.c:572
v9fs_mount+0xa8/0x870 fs/9p/vfs_super.c:141
mount_fs+0x9d/0x2a7 fs/super.c:1237
vfs_kern_mount.part.0+0x5e/0x3d0 fs/namespace.c:1046
vfs_kern_mount fs/namespace.c:1036 [inline]
do_new_mount fs/namespace.c:2549 [inline]
do_mount+0x417/0x27d0 fs/namespace.c:2879
SYSC_mount fs/namespace.c:3095 [inline]
SyS_mount+0xab/0x120 fs/namespace.c:3072
do_syscall_64+0x1eb/0x630 arch/x86/entry/common.c:289
entry_SYSCALL_64_after_hwframe+0x42/0xb7

The buggy address belongs to the object at ffff8880a84ec380
which belongs to the cache kmalloc-96 of size 96
The buggy address is located 0 bytes inside of
96-byte region [ffff8880a84ec380, ffff8880a84ec3e0)
The buggy address belongs to the page:
page:ffffea0002a13b00 count:1 mapcount:0 mapping:ffff8880a84ec000 index:0x0
flags: 0x1fffc0000000100(slab)
raw: 01fffc0000000100 ffff8880a84ec000 0000000000000000 0000000100000020
raw: ffffea00025f64a0 ffffea00027e2460 ffff8880aa8004c0 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff8880a84ec280: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
ffff8880a84ec300: 00 00 00 00 00 00 00 00 02 fc fc fc fc fc fc fc
> ffff8880a84ec380: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
^
ffff8880a84ec400: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
ffff8880a84ec480: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
==================================================================

Reply all
Reply to author
Forward
0 new messages