Linux-mm Archive on lore.kernel.org
 help / color / Atom feed
* kernel panic: stack is corrupted in mpol_to_str
@ 2020-03-26  2:24 syzbot
  2020-03-26 11:21 ` Tetsuo Handa
  0 siblings, 1 reply; 2+ messages in thread
From: syzbot @ 2020-03-26  2:24 UTC (permalink / raw)
  To: akpm, linux-kernel, linux-mm, syzkaller-bugs

Hello,

syzbot found the following crash on:

HEAD commit:    e2cf67f6 Merge tag 'zonefs-5.6-rc7' of git://git.kernel.or..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=1217e987e00000
kernel config:  https://syzkaller.appspot.com/x/.config?x=90791b5aec4dc636
dashboard link: https://syzkaller.appspot.com/bug?extid=b636fe4123f39f69c35b
compiler:       clang version 10.0.0 (https://github.com/llvm/llvm-project/ c2443155a0fb245c8f17f2c1c72b6ea391e86e81)
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=16773d8de00000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=1309b523e00000

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

Kernel panic - not syncing: stack-protector: Kernel stack is corrupted in: mpol_to_str+0x3ec/0x3f0 mm/mempolicy.c:2962
CPU: 1 PID: 1 Comm: systemd Not tainted 5.6.0-rc7-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+0x1e9/0x30e lib/dump_stack.c:118
 panic+0x264/0x7a0 kernel/panic.c:221
 __stack_chk_fail+0x1c/0x20 kernel/panic.c:667
 mpol_to_str+0x3ec/0x3f0 mm/mempolicy.c:2962
 shmem_show_mpol mm/shmem.c:1406 [inline]
 shmem_show_options+0x3d9/0x4c0 mm/shmem.c:3609
 show_mountinfo+0x68d/0x790 fs/proc_namespace.c:187
 seq_read+0x9df/0xd20 fs/seq_file.c:268
 __vfs_read+0xa7/0x6f0 fs/read_write.c:425
 vfs_read+0x1c0/0x3f0 fs/read_write.c:461
 ksys_read+0x115/0x220 fs/read_write.c:587
 do_syscall_64+0xf3/0x1b0 arch/x86/entry/common.c:294
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7f83e3f3f92d
Code: 2d 2c 00 00 75 10 b8 00 00 00 00 0f 05 48 3d 01 f0 ff ff 73 31 c3 48 83 ec 08 e8 de 9b 01 00 48 89 04 24 b8 00 00 00 00 0f 05 <48> 8b 3c 24 48 89 c2 e8 27 9c 01 00 48 89 d0 48 83 c4 08 48 3d 01
RSP: 002b:00007ffe6d4b18c0 EFLAGS: 00000293 ORIG_RAX: 0000000000000000
RAX: ffffffffffffffda RBX: 000055840db5f6d0 RCX: 00007f83e3f3f92d
RDX: 0000000000000400 RSI: 000055840db5f900 RDI: 000000000000002b
RBP: 0000000000000d68 R08: 00007f83e5975500 R09: 00000000000000e0
R10: 000055840db5fce2 R11: 0000000000000293 R12: 00007f83e41fa440
R13: 00007f83e41f9900 R14: 000000000000001e R15: 0000000000000000
Kernel Offset: disabled
Rebooting in 86400 seconds..


---
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.
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: kernel panic: stack is corrupted in mpol_to_str
  2020-03-26  2:24 kernel panic: stack is corrupted in mpol_to_str syzbot
@ 2020-03-26 11:21 ` Tetsuo Handa
  0 siblings, 0 replies; 2+ messages in thread
From: Tetsuo Handa @ 2020-03-26 11:21 UTC (permalink / raw)
  To: syzbot; +Cc: linux-mm, syzkaller-bugs

Two reproducers have only offset difference.

1c1
< // https://syzkaller.appspot.com/bug?id=95622e9b1d82dd9e1368d04b2d11f9daa102b685
---
> // https://syzkaller.appspot.com/bug?id=b642faac21312365cd30cc83ec73b2a05f73bf8a
134,142c134,142
<   memcpy((void*)0x20000000, "tmpfs\000", 6);
<   memcpy((void*)0x20002140, "./file0\000", 8);
<   memcpy((void*)0x200000c0, "mpol", 4);
<   *(uint8_t*)0x200000c4 = 0x3d;
<   memcpy((void*)0x200000c5, "prefer", 6);
<   *(uint8_t*)0x200000cb = 0x3a;
<   *(uint8_t*)0x200000cc = 0x2c;
<   *(uint8_t*)0x200000cd = 0;
<   syz_mount_image(0x20000000, 0x20002140, 0, 0, 0, 0, 0x200000c0);
---
>   memcpy((void*)0x200000c0, "tmpfs\000", 6);
>   memcpy((void*)0x20000000, "./file0\000", 8);
>   memcpy((void*)0x20000100, "mpol", 4);
>   *(uint8_t*)0x20000104 = 0x3d;
>   memcpy((void*)0x20000105, "prefer", 6);
>   *(uint8_t*)0x2000010b = 0x3a;
>   *(uint8_t*)0x2000010c = 0x2c;
>   *(uint8_t*)0x2000010d = 0;
>   syz_mount_image(0x200000c0, 0x20000000, 0, 0, 0, 0, 0x20000100);

#syz dup: KASAN: stack-out-of-bounds Write in mpol_to_str



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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-26  2:24 kernel panic: stack is corrupted in mpol_to_str syzbot
2020-03-26 11:21 ` Tetsuo Handa

Linux-mm Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-mm/0 linux-mm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mm linux-mm/ https://lore.kernel.org/linux-mm \
		linux-mm@kvack.org
	public-inbox-index linux-mm

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kvack.linux-mm


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git