All of lore.kernel.org
 help / color / mirror / Atom feed
* KASAN: use-after-free Write in get_block
@ 2020-05-07 10:46 syzbot
  2020-05-14 16:14 ` syzbot
  0 siblings, 1 reply; 2+ messages in thread
From: syzbot @ 2020-05-07 10:46 UTC (permalink / raw)
  To: akpm, danarag, deepa.kernel, jack, linux-kernel, syzkaller-bugs, viro

Hello,

syzbot found the following crash on:

HEAD commit:    ac935d22 Add linux-next specific files for 20200415
git tree:       linux-next
console output: https://syzkaller.appspot.com/x/log.txt?x=13f7824c100000
kernel config:  https://syzkaller.appspot.com/x/.config?x=bc498783097e9019
dashboard link: https://syzkaller.appspot.com/bug?extid=c7d9ec7a1a7272dd71b3
compiler:       gcc (GCC) 9.0.0 20181231 (experimental)
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=100a1660100000

Bisection is inconclusive: the bug happens on the oldest tested release.

bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=135471e4100000
final crash:    https://syzkaller.appspot.com/x/report.txt?x=10d471e4100000
console output: https://syzkaller.appspot.com/x/log.txt?x=175471e4100000

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

==================================================================
BUG: KASAN: use-after-free in alloc_branch fs/minix/itree_common.c:92 [inline]
BUG: KASAN: use-after-free in get_block+0x1202/0x1380 fs/minix/itree_common.c:191
Write of size 2 at addr ffff888083a817b8 by task syz-executor.0/7219

CPU: 0 PID: 7219 Comm: syz-executor.0 Not tainted 5.7.0-rc1-next-20200415-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+0x188/0x20d lib/dump_stack.c:118
 print_address_description.constprop.0.cold+0xd3/0x315 mm/kasan/report.c:382
 __kasan_report.cold+0x35/0x4d mm/kasan/report.c:511
 kasan_report+0x33/0x50 mm/kasan/common.c:625
 alloc_branch fs/minix/itree_common.c:92 [inline]
 get_block+0x1202/0x1380 fs/minix/itree_common.c:191
 minix_get_block+0xe5/0x110 fs/minix/inode.c:376
 __block_write_begin_int+0x490/0x1b00 fs/buffer.c:2039
 __block_write_begin fs/buffer.c:2089 [inline]
 block_write_begin+0x58/0x2e0 fs/buffer.c:2148
 minix_write_begin+0x35/0xe0 fs/minix/inode.c:412
 generic_perform_write+0x20a/0x4e0 mm/filemap.c:3308
 __generic_file_write_iter+0x24c/0x610 mm/filemap.c:3437
 generic_file_write_iter+0x3f3/0x630 mm/filemap.c:3469
 call_write_iter include/linux/fs.h:1907 [inline]
 new_sync_write+0x4a2/0x700 fs/read_write.c:484
 __vfs_write+0xc9/0x100 fs/read_write.c:497
 __kernel_write+0x11c/0x3a0 fs/read_write.c:516
 do_acct_process+0xcdc/0x10e0 kernel/acct.c:522
 acct_pin_kill+0x29/0xf0 kernel/acct.c:174
 pin_kill+0x175/0x7c0 fs/fs_pin.c:44
 mnt_pin_kill+0x6c/0x1c0 fs/fs_pin.c:81
 cleanup_mnt+0x3c4/0x4b0 fs/namespace.c:1092
 task_work_run+0xf4/0x1b0 kernel/task_work.c:123
 tracehook_notify_resume include/linux/tracehook.h:188 [inline]
 exit_to_usermode_loop+0x2fa/0x360 arch/x86/entry/common.c:165
 prepare_exit_to_usermode arch/x86/entry/common.c:196 [inline]
 syscall_return_slowpath arch/x86/entry/common.c:279 [inline]
 do_syscall_64+0x6b1/0x7d0 arch/x86/entry/common.c:305
 entry_SYSCALL_64_after_hwframe+0x49/0xb3
RIP: 0033:0x45f257
Code: 64 89 04 25 d0 02 00 00 58 5f ff d0 48 89 c7 e8 8f be ff ff 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 a6 00 00 00 0f 05 <48> 3d 01 f0 ff ff 0f 83 ad 8c fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fff1bed8a48 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 000000000045f257
RDX: 0000000000402ff8 RSI: 0000000000000002 RDI: 00007fff1bed8af0
RBP: 0000000000000014 R08: 0000000000000000 R09: 0000000000000009
R10: 0000000000000005 R11: 0000000000000246 R12: 00007fff1bed9b80
R13: 0000000001b28940 R14: 0000000000000000 R15: 00007fff1bed9b80

The buggy address belongs to the page:
page:ffffea00020ea040 refcount:0 mapcount:0 mapping:0000000033e8f566 index:0x1
flags: 0xfffe0000000000()
raw: 00fffe0000000000 ffffea00021c95c8 ffffea00020e9d48 0000000000000000
raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff888083a81680: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff888083a81700: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff888083a81780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                                        ^
 ffff888083a81800: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff888083a81880: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================


---
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 syzkaller@googlegroups.com.

syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
For information about bisection process see: https://goo.gl/tpsmEJ#bisection
syzbot can test patches for this bug, for details see:
https://goo.gl/tpsmEJ#testing-patches

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: KASAN: use-after-free Write in get_block
  2020-05-07 10:46 KASAN: use-after-free Write in get_block syzbot
@ 2020-05-14 16:14 ` syzbot
  0 siblings, 0 replies; 2+ messages in thread
From: syzbot @ 2020-05-14 16:14 UTC (permalink / raw)
  To: aeb, akpm, danarag, deepa.kernel, gregkh, jack, linux-kernel,
	pombredanne, syzkaller-bugs, tglx, viro

syzbot has found a reproducer for the following crash on:

HEAD commit:    ac935d22 Add linux-next specific files for 20200415
git tree:       linux-next
console output: https://syzkaller.appspot.com/x/log.txt?x=148bf748100000
kernel config:  https://syzkaller.appspot.com/x/.config?x=bc498783097e9019
dashboard link: https://syzkaller.appspot.com/bug?extid=c7d9ec7a1a7272dd71b3
compiler:       gcc (GCC) 9.0.0 20181231 (experimental)
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=10844a8c100000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=17978806100000

Bisection is inconclusive: the bug happens on the oldest tested release.

bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=135471e4100000
final crash:    https://syzkaller.appspot.com/x/report.txt?x=10d471e4100000
console output: https://syzkaller.appspot.com/x/log.txt?x=175471e4100000

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

==================================================================
BUG: KASAN: use-after-free in alloc_branch fs/minix/itree_common.c:92 [inline]
BUG: KASAN: use-after-free in get_block+0x1202/0x1380 fs/minix/itree_common.c:191
Write of size 2 at addr ffff88808ae27ba4 by task syz-executor461/7083

CPU: 0 PID: 7083 Comm: syz-executor461 Not tainted 5.7.0-rc1-next-20200415-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+0x188/0x20d lib/dump_stack.c:118
 print_address_description.constprop.0.cold+0xd3/0x315 mm/kasan/report.c:382
 __kasan_report.cold+0x35/0x4d mm/kasan/report.c:511
 kasan_report+0x33/0x50 mm/kasan/common.c:625
 alloc_branch fs/minix/itree_common.c:92 [inline]
 get_block+0x1202/0x1380 fs/minix/itree_common.c:191
 minix_get_block+0xe5/0x110 fs/minix/inode.c:376
 __block_write_begin_int+0x490/0x1b00 fs/buffer.c:2039
 __block_write_begin fs/buffer.c:2089 [inline]
 block_write_begin+0x58/0x2e0 fs/buffer.c:2148
 minix_write_begin+0x35/0xe0 fs/minix/inode.c:412
 generic_perform_write+0x20a/0x4e0 mm/filemap.c:3308
 __generic_file_write_iter+0x24c/0x610 mm/filemap.c:3437
 generic_file_write_iter+0x3f3/0x630 mm/filemap.c:3469
 call_write_iter include/linux/fs.h:1907 [inline]
 new_sync_write+0x4a2/0x700 fs/read_write.c:484
 __vfs_write+0xc9/0x100 fs/read_write.c:497
 __kernel_write+0x11c/0x3a0 fs/read_write.c:516
 do_acct_process+0xcdc/0x10e0 kernel/acct.c:522
 acct_pin_kill+0x29/0xf0 kernel/acct.c:174
 pin_kill+0x175/0x7c0 fs/fs_pin.c:44
 mnt_pin_kill+0x6c/0x1c0 fs/fs_pin.c:81
 cleanup_mnt+0x3c4/0x4b0 fs/namespace.c:1092
 task_work_run+0xf4/0x1b0 kernel/task_work.c:123
 exit_task_work include/linux/task_work.h:22 [inline]
 do_exit+0xb53/0x2e10 kernel/exit.c:795
 do_group_exit+0x125/0x340 kernel/exit.c:893
 __do_sys_exit_group kernel/exit.c:904 [inline]
 __se_sys_exit_group kernel/exit.c:902 [inline]
 __x64_sys_exit_group+0x3a/0x50 kernel/exit.c:902
 do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:295
 entry_SYSCALL_64_after_hwframe+0x49/0xb3
RIP: 0033:0x44b9e8
Code: Bad RIP value.
RSP: 002b:00007fff686f4e68 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 000000000044b9e8
RDX: 0000000000000001 RSI: 000000000000003c RDI: 0000000000000001
RBP: 00000000004d0a10 R08: 00000000000000e7 R09: ffffffffffffffd4
R10: 0000000000000005 R11: 0000000000000246 R12: 0000000000000001
R13: 00000000006ea9a0 R14: 0000000000000000 R15: 00007fff686f62d0

The buggy address belongs to the page:
page:ffffea00022b89c0 refcount:0 mapcount:0 mapping:00000000722a657b index:0x1
flags: 0xfffe0000000000()
raw: 00fffe0000000000 ffffea00022b1448 ffffea000231b808 0000000000000000
raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88808ae27a80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88808ae27b00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff88808ae27b80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                               ^
 ffff88808ae27c00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88808ae27c80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-14 16:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-07 10:46 KASAN: use-after-free Write in get_block syzbot
2020-05-14 16:14 ` syzbot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.