Re: general protection fault in dax_alloc_inode

From: Eric Biggers
Date: Sun Dec 03 2017 - 15:38:44 EST


On Tue, Nov 14, 2017 at 04:46:01AM -0800, syzbot wrote:
> RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
> R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
> R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
> kasan: CONFIG_KASAN_INLINE enabled
> kasan: GPF could be caused by NULL-ptr deref or user memory access
> general protection fault: 0000 [#1] SMP KASAN
> Dumping ftrace buffer:
> (ftrace buffer empty)
> Modules linked in:
> CPU: 1 PID: 31095 Comm: syz-executor3 Not tainted 4.14.0-rc8+ #75
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
> Google 01/01/2011
> task: ffff8801cae96000 task.stack: ffff8801d2438000
> RIP: 0010:dax_alloc_inode+0x3b/0x70 drivers/dax/super.c:348
> RSP: 0018:ffff8801d243f8d0 EFLAGS: 00010203
> RAX: 0000000000000010 RBX: 0000000000000000 RCX: 000000000000000b
> RDX: dffffc0000000000 RSI: ffffffff85b34340 RDI: 000000000000005c
> RBP: ffff8801d243f8e0 R08: 0000000000000001 R09: 0000000000000000
> R10: 0000000000000000 R11: 0000000000000000 R12: ffffffff83595ba0
> R13: dffffc0000000000 R14: ffff8801cedbc5c0 R15: 0000000064646178
> FS: 0000000000000000(0000) GS:ffff8801db300000(0063) knlGS:00000000f7742b40
> CS: 0010 DS: 002b ES: 002b CR0: 0000000080050033
> CR2: 00000000f778cdb0 CR3: 00000001c5739000 CR4: 00000000001406e0
> DR0: 0000000020000000 DR1: 0000000020000000 DR2: 0000000000000000
> DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000600
> Call Trace:
> alloc_inode+0x65/0x180 fs/inode.c:208
> new_inode_pseudo+0x69/0x190 fs/inode.c:890
> new_inode+0x1c/0x40 fs/inode.c:919
> mount_pseudo_xattr+0x288/0x560 fs/libfs.c:261
> mount_pseudo include/linux/fs.h:2137 [inline]
> dax_mount+0x2e/0x40 drivers/dax/super.c:388
> mount_fs+0x66/0x2d0 fs/super.c:1223
> vfs_kern_mount.part.26+0xc6/0x4a0 fs/namespace.c:1037
> vfs_kern_mount fs/namespace.c:2509 [inline]
> do_new_mount fs/namespace.c:2512 [inline]
> do_mount+0xea1/0x2bb0 fs/namespace.c:2841
> C_SYSC_mount fs/compat.c:195 [inline]
> compat_SyS_mount+0xd0/0x1070 fs/compat.c:160
> do_syscall_32_irqs_on arch/x86/entry/common.c:329 [inline]
> do_fast_syscall_32+0x3f2/0xf05 arch/x86/entry/common.c:391
> entry_SYSENTER_compat+0x51/0x60 arch/x86/entry/entry_64_compat.S:125

#syz fix: dax: fix general protection fault in dax_alloc_inode