linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* general protection fault in getname_kernel
@ 2018-10-07 23:44 syzbot
  2018-10-08  0:07 ` Al Viro
  0 siblings, 1 reply; 2+ messages in thread
From: syzbot @ 2018-10-07 23:44 UTC (permalink / raw)
  To: linux-fsdevel, linux-kernel, syzkaller-bugs, viro

Hello,

syzbot found the following crash on:

HEAD commit:    c1d84a1b42ef Merge git://git.kernel.org/pub/scm/linux/kern..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=10f3c6a1400000
kernel config:  https://syzkaller.appspot.com/x/.config?x=c0af03fe452b65fb
dashboard link: https://syzkaller.appspot.com/bug?extid=c54f8e94e6bba03b04e9
compiler:       gcc (GCC) 8.0.1 20180413 (experimental)
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=10688159400000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=1162aa31400000

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

kasan: CONFIG_KASAN_INLINE enabled
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 5829 Comm: syz-executor215 Not tainted 4.19.0-rc6+ #271
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS  
Google 01/01/2011
RIP: 0010:strlen+0x1f/0xa0 lib/string.c:479
Code: ff ff ff 0f 1f 84 00 00 00 00 00 48 b8 00 00 00 00 00 fc ff df 55 48  
89 fa 48 89 e5 48 c1 ea 03 41 54 49 89 fc 53 48 83 ec 08 <0f> b6 04 02 48  
89 fa 83 e2 07 38 d0 7f 04 84 c0 75 4d 41 80 3c 24
RSP: 0018:ffff8801bc30f9b0 EFLAGS: 00010282
RAX: dffffc0000000000 RBX: 0000000000000001 RCX: ffff8801bc74eec0
RDX: 0000000000000000 RSI: ffffffff81d2cccc RDI: 0000000000000000
RBP: ffff8801bc30f9c8 R08: ffff8801d7c24400 R09: ffffed003af0a800
R10: fffff94000ebc2a6 R11: ffffea00075e1537 R12: 0000000000000000
R13: 0000000000000000 R14: ffffffff89f3ee98 R15: 0000000000000000
FS:  0000000001f11880(0000) GS:ffff8801daf00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020000000 CR3: 00000001d7cc6000 CR4: 00000000001406e0
Call Trace:
  strlen include/linux/string.h:267 [inline]
  getname_kernel+0x24/0x370 fs/namei.c:218
  kern_path+0x1e/0x40 fs/namei.c:2434
  gfs2_mount_meta+0x85/0x2a0 fs/gfs2/ops_fstype.c:1336
  mount_fs+0xae/0x31d fs/super.c:1261
  vfs_kern_mount.part.35+0xdc/0x4f0 fs/namespace.c:961
  vfs_kern_mount fs/namespace.c:951 [inline]
  do_new_mount fs/namespace.c:2457 [inline]
  do_mount+0x581/0x31f0 fs/namespace.c:2787
  ksys_mount+0x12d/0x140 fs/namespace.c:3003
  __do_sys_mount fs/namespace.c:3017 [inline]
  __se_sys_mount fs/namespace.c:3014 [inline]
  __x64_sys_mount+0xbe/0x150 fs/namespace.c:3014
  do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
  entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x440059
Code: 18 89 d0 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 48 89 f8 48 89 f7  
48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff  
ff 0f 83 fb 13 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ffe32cedb58 EFLAGS: 00000217 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 0030656c69662f2e RCX: 0000000000440059
RDX: 0000000020000040 RSI: 0000000020000080 RDI: 0000000000000000
RBP: 00000000006ca018 R08: 00000000200000c0 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000217 R12: 00000000004018e0
R13: 0000000000401970 R14: 0000000000000000 R15: 0000000000000000
Modules linked in:
---[ end trace e8236b178a90d827 ]---
RIP: 0010:strlen+0x1f/0xa0 lib/string.c:479
Code: ff ff ff 0f 1f 84 00 00 00 00 00 48 b8 00 00 00 00 00 fc ff df 55 48  
89 fa 48 89 e5 48 c1 ea 03 41 54 49 89 fc 53 48 83 ec 08 <0f> b6 04 02 48  
89 fa 83 e2 07 38 d0 7f 04 84 c0 75 4d 41 80 3c 24
RSP: 0018:ffff8801bc30f9b0 EFLAGS: 00010282
RAX: dffffc0000000000 RBX: 0000000000000001 RCX: ffff8801bc74eec0
RDX: 0000000000000000 RSI: ffffffff81d2cccc RDI: 0000000000000000
RBP: ffff8801bc30f9c8 R08: ffff8801d7c24400 R09: ffffed003af0a800
R10: fffff94000ebc2a6 R11: ffffea00075e1537 R12: 0000000000000000
R13: 0000000000000000 R14: ffffffff89f3ee98 R15: 0000000000000000
FS:  0000000001f11880(0000) GS:ffff8801daf00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020000000 CR3: 00000001d7cc6000 CR4: 00000000001406e0


---
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#bug-status-tracking 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: general protection fault in getname_kernel
  2018-10-07 23:44 general protection fault in getname_kernel syzbot
@ 2018-10-08  0:07 ` Al Viro
  0 siblings, 0 replies; 2+ messages in thread
From: Al Viro @ 2018-10-08  0:07 UTC (permalink / raw)
  To: syzbot; +Cc: linux-fsdevel, linux-kernel, syzkaller-bugs

On Sun, Oct 07, 2018 at 04:44:03PM -0700, syzbot wrote:
> Hello,
> 
> syzbot found the following crash on:
> 
> HEAD commit:    c1d84a1b42ef Merge git://git.kernel.org/pub/scm/linux/kern..
> git tree:       upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=10f3c6a1400000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=c0af03fe452b65fb
> dashboard link: https://syzkaller.appspot.com/bug?extid=c54f8e94e6bba03b04e9
> compiler:       gcc (GCC) 8.0.1 20180413 (experimental)
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=10688159400000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=1162aa31400000
> 
> IMPORTANT: if you fix the bug, please add the following tag to the commit:
> Reported-by: syzbot+c54f8e94e6bba03b04e9@syzkaller.appspotmail.com

Umm...  See if this helps:
diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c
index c2469833b4fb..6b84ef6ccff3 100644
--- a/fs/gfs2/ops_fstype.c
+++ b/fs/gfs2/ops_fstype.c
@@ -1333,6 +1333,9 @@ static struct dentry *gfs2_mount_meta(struct file_system_type *fs_type,
 	struct path path;
 	int error;
 
+	if (!dev_name || !*dev_name)
+		return ERR_PTR(-EINVAL);
+
 	error = kern_path(dev_name, LOOKUP_FOLLOW, &path);
 	if (error) {
 		pr_warn("path_lookup on %s returned error %d\n",

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

end of thread, other threads:[~2018-10-08  6:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-07 23:44 general protection fault in getname_kernel syzbot
2018-10-08  0:07 ` Al Viro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).