Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [syzbot] [btrfs?] general protection fault in getname_kernel (2)
@ 2024-10-09 13:48 syzbot
  2024-10-09 23:21 ` Qu Wenruo
  2024-10-10  4:30 ` syzbot
  0 siblings, 2 replies; 8+ messages in thread
From: syzbot @ 2024-10-09 13:48 UTC (permalink / raw)
  To: clm, dsterba, josef, linux-btrfs, linux-kernel, syzkaller-bugs

Hello,

syzbot found the following issue on:

HEAD commit:    33ce24234fca Add linux-next specific files for 20241008
git tree:       linux-next
console+strace: https://syzkaller.appspot.com/x/log.txt?x=10df97d0580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=4750ca93740b938d
dashboard link: https://syzkaller.appspot.com/bug?extid=cee29f5a48caf10cd475
compiler:       Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=160ce327980000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=15ea7707980000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/ee8dc2df0c57/disk-33ce2423.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/dc473c0fa06e/vmlinux-33ce2423.xz
kernel image: https://storage.googleapis.com/syzbot-assets/4671f1ca2e61/bzImage-33ce2423.xz

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

Oops: general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN PTI
KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
CPU: 0 UID: 0 PID: 5235 Comm: syz-executor338 Not tainted 6.12.0-rc2-next-20241008-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
RIP: 0010:strlen+0x2c/0x70 lib/string.c:402
Code: 1e fa 41 57 41 56 41 54 53 49 89 fe 48 c7 c0 ff ff ff ff 49 bf 00 00 00 00 00 fc ff df 48 89 fb 49 89 c4 48 89 d8 48 c1 e8 03 <42> 0f b6 04 38 84 c0 75 12 48 ff c3 49 8d 44 24 01 43 80 7c 26 01
RSP: 0018:ffffc90003b7f8a8 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff88802c5cda00
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: ffffffff901d3f2f R09: 1ffffffff203a7e5
R10: dffffc0000000000 R11: fffffbfff203a7e6 R12: ffffffffffffffff
R13: ffff888028a7e000 R14: 0000000000000000 R15: dffffc0000000000
FS:  000055557da91380(0000) GS:ffff8880b8600000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000200000c0 CR3: 000000004fdaa000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 getname_kernel+0x1d/0x2f0 fs/namei.c:232
 kern_path+0x1d/0x50 fs/namei.c:2716
 is_good_dev_path fs/btrfs/volumes.c:760 [inline]
 btrfs_scan_one_device+0x19e/0xd90 fs/btrfs/volumes.c:1484
 btrfs_get_tree_super fs/btrfs/super.c:1841 [inline]
 btrfs_get_tree+0x30e/0x1920 fs/btrfs/super.c:2114
 vfs_get_tree+0x90/0x2b0 fs/super.c:1800
 fc_mount+0x1b/0xb0 fs/namespace.c:1231
 btrfs_get_tree_subvol fs/btrfs/super.c:2077 [inline]
 btrfs_get_tree+0x652/0x1920 fs/btrfs/super.c:2115
 vfs_get_tree+0x90/0x2b0 fs/super.c:1800
 vfs_cmd_create+0xa0/0x1f0 fs/fsopen.c:225
 __do_sys_fsconfig fs/fsopen.c:472 [inline]
 __se_sys_fsconfig+0xa1f/0xf70 fs/fsopen.c:344
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fe8c78542a9
Code: 48 83 c4 28 c3 e8 37 17 00 00 0f 1f 80 00 00 00 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 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffd2c4992f8 EFLAGS: 00000246 ORIG_RAX: 00000000000001af
RAX: ffffffffffffffda RBX: 00007ffd2c4994c8 RCX: 00007fe8c78542a9
RDX: 0000000000000000 RSI: 0000000000000006 RDI: 0000000000000003
RBP: 00007fe8c78c7610 R08: 0000000000000000 R09: 00007ffd2c4994c8
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffd2c4994b8 R14: 0000000000000001 R15: 0000000000000001
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:strlen+0x2c/0x70 lib/string.c:402
Code: 1e fa 41 57 41 56 41 54 53 49 89 fe 48 c7 c0 ff ff ff ff 49 bf 00 00 00 00 00 fc ff df 48 89 fb 49 89 c4 48 89 d8 48 c1 e8 03 <42> 0f b6 04 38 84 c0 75 12 48 ff c3 49 8d 44 24 01 43 80 7c 26 01
RSP: 0018:ffffc90003b7f8a8 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff88802c5cda00
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: ffffffff901d3f2f R09: 1ffffffff203a7e5
R10: dffffc0000000000 R11: fffffbfff203a7e6 R12: ffffffffffffffff
R13: ffff888028a7e000 R14: 0000000000000000 R15: dffffc0000000000
FS:  000055557da91380(0000) GS:ffff8880b8700000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00005606b6327058 CR3: 000000004fdaa000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess), 1 bytes skipped:
   0:	fa                   	cli
   1:	41 57                	push   %r15
   3:	41 56                	push   %r14
   5:	41 54                	push   %r12
   7:	53                   	push   %rbx
   8:	49 89 fe             	mov    %rdi,%r14
   b:	48 c7 c0 ff ff ff ff 	mov    $0xffffffffffffffff,%rax
  12:	49 bf 00 00 00 00 00 	movabs $0xdffffc0000000000,%r15
  19:	fc ff df
  1c:	48 89 fb             	mov    %rdi,%rbx
  1f:	49 89 c4             	mov    %rax,%r12
  22:	48 89 d8             	mov    %rbx,%rax
  25:	48 c1 e8 03          	shr    $0x3,%rax
* 29:	42 0f b6 04 38       	movzbl (%rax,%r15,1),%eax <-- trapping instruction
  2e:	84 c0                	test   %al,%al
  30:	75 12                	jne    0x44
  32:	48 ff c3             	inc    %rbx
  35:	49 8d 44 24 01       	lea    0x1(%r12),%rax
  3a:	43                   	rex.XB
  3b:	80                   	.byte 0x80
  3c:	7c 26                	jl     0x64
  3e:	01                   	.byte 0x1


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

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

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

* Re: [syzbot] [btrfs?] general protection fault in getname_kernel (2)
  2024-10-09 13:48 [syzbot] [btrfs?] general protection fault in getname_kernel (2) syzbot
@ 2024-10-09 23:21 ` Qu Wenruo
  2024-10-10  0:29   ` syzbot
  2024-10-10  4:30 ` syzbot
  1 sibling, 1 reply; 8+ messages in thread
From: Qu Wenruo @ 2024-10-09 23:21 UTC (permalink / raw)
  To: syzbot, clm, dsterba, josef, linux-btrfs, linux-kernel,
	syzkaller-bugs

#syz test: https://github.com/adam900710/linux.git subpage_read

在 2024/10/10 00:18, syzbot 写道:
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit:    33ce24234fca Add linux-next specific files for 20241008
> git tree:       linux-next
> console+strace: https://syzkaller.appspot.com/x/log.txt?x=10df97d0580000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=4750ca93740b938d
> dashboard link: https://syzkaller.appspot.com/bug?extid=cee29f5a48caf10cd475
> compiler:       Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=160ce327980000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=15ea7707980000
>
> Downloadable assets:
> disk image: https://storage.googleapis.com/syzbot-assets/ee8dc2df0c57/disk-33ce2423.raw.xz
> vmlinux: https://storage.googleapis.com/syzbot-assets/dc473c0fa06e/vmlinux-33ce2423.xz
> kernel image: https://storage.googleapis.com/syzbot-assets/4671f1ca2e61/bzImage-33ce2423.xz
>
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+cee29f5a48caf10cd475@syzkaller.appspotmail.com
>
> Oops: general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN PTI
> KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
> CPU: 0 UID: 0 PID: 5235 Comm: syz-executor338 Not tainted 6.12.0-rc2-next-20241008-syzkaller #0
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
> RIP: 0010:strlen+0x2c/0x70 lib/string.c:402
> Code: 1e fa 41 57 41 56 41 54 53 49 89 fe 48 c7 c0 ff ff ff ff 49 bf 00 00 00 00 00 fc ff df 48 89 fb 49 89 c4 48 89 d8 48 c1 e8 03 <42> 0f b6 04 38 84 c0 75 12 48 ff c3 49 8d 44 24 01 43 80 7c 26 01
> RSP: 0018:ffffc90003b7f8a8 EFLAGS: 00010246
> RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff88802c5cda00
> RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
> RBP: 0000000000000000 R08: ffffffff901d3f2f R09: 1ffffffff203a7e5
> R10: dffffc0000000000 R11: fffffbfff203a7e6 R12: ffffffffffffffff
> R13: ffff888028a7e000 R14: 0000000000000000 R15: dffffc0000000000
> FS:  000055557da91380(0000) GS:ffff8880b8600000(0000) knlGS:0000000000000000
> CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> CR2: 00000000200000c0 CR3: 000000004fdaa000 CR4: 00000000003526f0
> DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
> Call Trace:
>   <TASK>
>   getname_kernel+0x1d/0x2f0 fs/namei.c:232
>   kern_path+0x1d/0x50 fs/namei.c:2716
>   is_good_dev_path fs/btrfs/volumes.c:760 [inline]
>   btrfs_scan_one_device+0x19e/0xd90 fs/btrfs/volumes.c:1484
>   btrfs_get_tree_super fs/btrfs/super.c:1841 [inline]
>   btrfs_get_tree+0x30e/0x1920 fs/btrfs/super.c:2114
>   vfs_get_tree+0x90/0x2b0 fs/super.c:1800
>   fc_mount+0x1b/0xb0 fs/namespace.c:1231
>   btrfs_get_tree_subvol fs/btrfs/super.c:2077 [inline]
>   btrfs_get_tree+0x652/0x1920 fs/btrfs/super.c:2115
>   vfs_get_tree+0x90/0x2b0 fs/super.c:1800
>   vfs_cmd_create+0xa0/0x1f0 fs/fsopen.c:225
>   __do_sys_fsconfig fs/fsopen.c:472 [inline]
>   __se_sys_fsconfig+0xa1f/0xf70 fs/fsopen.c:344
>   do_syscall_x64 arch/x86/entry/common.c:52 [inline]
>   do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
>   entry_SYSCALL_64_after_hwframe+0x77/0x7f
> RIP: 0033:0x7fe8c78542a9
> Code: 48 83 c4 28 c3 e8 37 17 00 00 0f 1f 80 00 00 00 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 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
> RSP: 002b:00007ffd2c4992f8 EFLAGS: 00000246 ORIG_RAX: 00000000000001af
> RAX: ffffffffffffffda RBX: 00007ffd2c4994c8 RCX: 00007fe8c78542a9
> RDX: 0000000000000000 RSI: 0000000000000006 RDI: 0000000000000003
> RBP: 00007fe8c78c7610 R08: 0000000000000000 R09: 00007ffd2c4994c8
> R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
> R13: 00007ffd2c4994b8 R14: 0000000000000001 R15: 0000000000000001
>   </TASK>
> Modules linked in:
> ---[ end trace 0000000000000000 ]---
> RIP: 0010:strlen+0x2c/0x70 lib/string.c:402
> Code: 1e fa 41 57 41 56 41 54 53 49 89 fe 48 c7 c0 ff ff ff ff 49 bf 00 00 00 00 00 fc ff df 48 89 fb 49 89 c4 48 89 d8 48 c1 e8 03 <42> 0f b6 04 38 84 c0 75 12 48 ff c3 49 8d 44 24 01 43 80 7c 26 01
> RSP: 0018:ffffc90003b7f8a8 EFLAGS: 00010246
> RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff88802c5cda00
> RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
> RBP: 0000000000000000 R08: ffffffff901d3f2f R09: 1ffffffff203a7e5
> R10: dffffc0000000000 R11: fffffbfff203a7e6 R12: ffffffffffffffff
> R13: ffff888028a7e000 R14: 0000000000000000 R15: dffffc0000000000
> FS:  000055557da91380(0000) GS:ffff8880b8700000(0000) knlGS:0000000000000000
> CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> CR2: 00005606b6327058 CR3: 000000004fdaa000 CR4: 00000000003526f0
> DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
> ----------------
> Code disassembly (best guess), 1 bytes skipped:
>     0:	fa                   	cli
>     1:	41 57                	push   %r15
>     3:	41 56                	push   %r14
>     5:	41 54                	push   %r12
>     7:	53                   	push   %rbx
>     8:	49 89 fe             	mov    %rdi,%r14
>     b:	48 c7 c0 ff ff ff ff 	mov    $0xffffffffffffffff,%rax
>    12:	49 bf 00 00 00 00 00 	movabs $0xdffffc0000000000,%r15
>    19:	fc ff df
>    1c:	48 89 fb             	mov    %rdi,%rbx
>    1f:	49 89 c4             	mov    %rax,%r12
>    22:	48 89 d8             	mov    %rbx,%rax
>    25:	48 c1 e8 03          	shr    $0x3,%rax
> * 29:	42 0f b6 04 38       	movzbl (%rax,%r15,1),%eax <-- trapping instruction
>    2e:	84 c0                	test   %al,%al
>    30:	75 12                	jne    0x44
>    32:	48 ff c3             	inc    %rbx
>    35:	49 8d 44 24 01       	lea    0x1(%r12),%rax
>    3a:	43                   	rex.XB
>    3b:	80                   	.byte 0x80
>    3c:	7c 26                	jl     0x64
>    3e:	01                   	.byte 0x1
>
>
> ---
> This report 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 issue. See:
> https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
>
> If the report is already addressed, let syzbot know by replying with:
> #syz fix: exact-commit-title
>
> If you want syzbot to run the reproducer, reply with:
> #syz test: git://repo/address.git branch-or-commit-hash
> If you attach or paste a git patch, syzbot will apply it before testing.
>
> If you want to overwrite report's subsystems, reply with:
> #syz set subsystems: new-subsystem
> (See the list of subsystem names on the web dashboard)
>
> If the report is a duplicate of another one, reply with:
> #syz dup: exact-subject-of-another-report
>
> If you want to undo deduplication, reply with:
> #syz undup
>


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

* Re: [syzbot] [btrfs?] general protection fault in getname_kernel (2)
  2024-10-09 23:21 ` Qu Wenruo
@ 2024-10-10  0:29   ` syzbot
  2024-10-10  2:26     ` Qu Wenruo
  0 siblings, 1 reply; 8+ messages in thread
From: syzbot @ 2024-10-10  0:29 UTC (permalink / raw)
  To: clm, dsterba, josef, linux-btrfs, linux-kernel, quwenruo.btrfs,
	syzkaller-bugs

Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
general protection fault in getname_kernel

Oops: general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN PTI
KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
CPU: 1 UID: 0 PID: 6008 Comm: syz.0.15 Not tainted 6.12.0-rc2-syzkaller-00045-g964c2da72390 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
RIP: 0010:strlen+0x2c/0x70 lib/string.c:402
Code: 1e fa 41 57 41 56 41 54 53 49 89 fe 48 c7 c0 ff ff ff ff 49 bf 00 00 00 00 00 fc ff df 48 89 fb 49 89 c4 48 89 d8 48 c1 e8 03 <42> 0f b6 04 38 84 c0 75 12 48 ff c3 49 8d 44 24 01 43 80 7c 26 01
RSP: 0018:ffffc900035af8a8 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff88802d46bc00
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: ffffffff942c58f7 R09: 1ffffffff2858b1e
R10: dffffc0000000000 R11: fffffbfff2858b1f R12: ffffffffffffffff
R13: ffff8880727f8000 R14: 0000000000000000 R15: dffffc0000000000
FS:  00007f01495d76c0(0000) GS:ffff8880b8700000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b2f75ffff CR3: 000000002cffe000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 getname_kernel+0x1d/0x2f0 fs/namei.c:232
 kern_path+0x1d/0x50 fs/namei.c:2716
 is_good_dev_path fs/btrfs/volumes.c:760 [inline]
 btrfs_scan_one_device+0x19e/0xd90 fs/btrfs/volumes.c:1492
 btrfs_get_tree_super fs/btrfs/super.c:1841 [inline]
 btrfs_get_tree+0x30e/0x1920 fs/btrfs/super.c:2114
 vfs_get_tree+0x90/0x2b0 fs/super.c:1800
 fc_mount+0x1b/0xb0 fs/namespace.c:1231
 btrfs_get_tree_subvol fs/btrfs/super.c:2077 [inline]
 btrfs_get_tree+0x652/0x1920 fs/btrfs/super.c:2115
 vfs_get_tree+0x90/0x2b0 fs/super.c:1800
 vfs_cmd_create+0xa0/0x1f0 fs/fsopen.c:225
 __do_sys_fsconfig fs/fsopen.c:472 [inline]
 __se_sys_fsconfig+0xa1f/0xf70 fs/fsopen.c:344
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f014877dff9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f01495d7038 EFLAGS: 00000246 ORIG_RAX: 00000000000001af
RAX: ffffffffffffffda RBX: 00007f0148935f80 RCX: 00007f014877dff9
RDX: 0000000000000000 RSI: 0000000000000006 RDI: 0000000000000003
RBP: 00007f01487f0296 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f0148935f80 R15: 00007ffe7a9c13b8
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:strlen+0x2c/0x70 lib/string.c:402
Code: 1e fa 41 57 41 56 41 54 53 49 89 fe 48 c7 c0 ff ff ff ff 49 bf 00 00 00 00 00 fc ff df 48 89 fb 49 89 c4 48 89 d8 48 c1 e8 03 <42> 0f b6 04 38 84 c0 75 12 48 ff c3 49 8d 44 24 01 43 80 7c 26 01
RSP: 0018:ffffc900035af8a8 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff88802d46bc00
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: ffffffff942c58f7 R09: 1ffffffff2858b1e
R10: dffffc0000000000 R11: fffffbfff2858b1f R12: ffffffffffffffff
R13: ffff8880727f8000 R14: 0000000000000000 R15: dffffc0000000000
FS:  00007f01495d76c0(0000) GS:ffff8880b8700000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b2f75ffff CR3: 000000002cffe000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess), 1 bytes skipped:
   0:	fa                   	cli
   1:	41 57                	push   %r15
   3:	41 56                	push   %r14
   5:	41 54                	push   %r12
   7:	53                   	push   %rbx
   8:	49 89 fe             	mov    %rdi,%r14
   b:	48 c7 c0 ff ff ff ff 	mov    $0xffffffffffffffff,%rax
  12:	49 bf 00 00 00 00 00 	movabs $0xdffffc0000000000,%r15
  19:	fc ff df
  1c:	48 89 fb             	mov    %rdi,%rbx
  1f:	49 89 c4             	mov    %rax,%r12
  22:	48 89 d8             	mov    %rbx,%rax
  25:	48 c1 e8 03          	shr    $0x3,%rax
* 29:	42 0f b6 04 38       	movzbl (%rax,%r15,1),%eax <-- trapping instruction
  2e:	84 c0                	test   %al,%al
  30:	75 12                	jne    0x44
  32:	48 ff c3             	inc    %rbx
  35:	49 8d 44 24 01       	lea    0x1(%r12),%rax
  3a:	43                   	rex.XB
  3b:	80                   	.byte 0x80
  3c:	7c 26                	jl     0x64
  3e:	01                   	.byte 0x1


Tested on:

commit:         964c2da7 btrfs: make buffered write to copy one page a..
git tree:       https://github.com/adam900710/linux.git subpage_read
console output: https://syzkaller.appspot.com/x/log.txt?x=1296b7d0580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=3ec5955a0d4f6ede
dashboard link: https://syzkaller.appspot.com/bug?extid=cee29f5a48caf10cd475
compiler:       Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40

Note: no patches were applied.

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

* Re: [syzbot] [btrfs?] general protection fault in getname_kernel (2)
  2024-10-10  0:29   ` syzbot
@ 2024-10-10  2:26     ` Qu Wenruo
  2024-10-10  3:02       ` syzbot
  0 siblings, 1 reply; 8+ messages in thread
From: Qu Wenruo @ 2024-10-10  2:26 UTC (permalink / raw)
  To: syzbot, clm, dsterba, josef, linux-btrfs, linux-kernel,
	syzkaller-bugs

#syz test: https://github.com/adam900710/linux.git subpage_read

在 2024/10/10 10:59, syzbot 写道:
> Hello,
>
> syzbot has tested the proposed patch but the reproducer is still triggering an issue:
> general protection fault in getname_kernel
>
> Oops: general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN PTI
> KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
> CPU: 1 UID: 0 PID: 6008 Comm: syz.0.15 Not tainted 6.12.0-rc2-syzkaller-00045-g964c2da72390 #0
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
> RIP: 0010:strlen+0x2c/0x70 lib/string.c:402
> Code: 1e fa 41 57 41 56 41 54 53 49 89 fe 48 c7 c0 ff ff ff ff 49 bf 00 00 00 00 00 fc ff df 48 89 fb 49 89 c4 48 89 d8 48 c1 e8 03 <42> 0f b6 04 38 84 c0 75 12 48 ff c3 49 8d 44 24 01 43 80 7c 26 01
> RSP: 0018:ffffc900035af8a8 EFLAGS: 00010246
> RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff88802d46bc00
> RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
> RBP: 0000000000000000 R08: ffffffff942c58f7 R09: 1ffffffff2858b1e
> R10: dffffc0000000000 R11: fffffbfff2858b1f R12: ffffffffffffffff
> R13: ffff8880727f8000 R14: 0000000000000000 R15: dffffc0000000000
> FS:  00007f01495d76c0(0000) GS:ffff8880b8700000(0000) knlGS:0000000000000000
> CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> CR2: 0000001b2f75ffff CR3: 000000002cffe000 CR4: 00000000003526f0
> DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
> Call Trace:
>   <TASK>
>   getname_kernel+0x1d/0x2f0 fs/namei.c:232
>   kern_path+0x1d/0x50 fs/namei.c:2716
>   is_good_dev_path fs/btrfs/volumes.c:760 [inline]
>   btrfs_scan_one_device+0x19e/0xd90 fs/btrfs/volumes.c:1492
>   btrfs_get_tree_super fs/btrfs/super.c:1841 [inline]
>   btrfs_get_tree+0x30e/0x1920 fs/btrfs/super.c:2114
>   vfs_get_tree+0x90/0x2b0 fs/super.c:1800
>   fc_mount+0x1b/0xb0 fs/namespace.c:1231
>   btrfs_get_tree_subvol fs/btrfs/super.c:2077 [inline]
>   btrfs_get_tree+0x652/0x1920 fs/btrfs/super.c:2115
>   vfs_get_tree+0x90/0x2b0 fs/super.c:1800
>   vfs_cmd_create+0xa0/0x1f0 fs/fsopen.c:225
>   __do_sys_fsconfig fs/fsopen.c:472 [inline]
>   __se_sys_fsconfig+0xa1f/0xf70 fs/fsopen.c:344
>   do_syscall_x64 arch/x86/entry/common.c:52 [inline]
>   do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
>   entry_SYSCALL_64_after_hwframe+0x77/0x7f
> RIP: 0033:0x7f014877dff9
> Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
> RSP: 002b:00007f01495d7038 EFLAGS: 00000246 ORIG_RAX: 00000000000001af
> RAX: ffffffffffffffda RBX: 00007f0148935f80 RCX: 00007f014877dff9
> RDX: 0000000000000000 RSI: 0000000000000006 RDI: 0000000000000003
> RBP: 00007f01487f0296 R08: 0000000000000000 R09: 0000000000000000
> R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
> R13: 0000000000000000 R14: 00007f0148935f80 R15: 00007ffe7a9c13b8
>   </TASK>
> Modules linked in:
> ---[ end trace 0000000000000000 ]---
> RIP: 0010:strlen+0x2c/0x70 lib/string.c:402
> Code: 1e fa 41 57 41 56 41 54 53 49 89 fe 48 c7 c0 ff ff ff ff 49 bf 00 00 00 00 00 fc ff df 48 89 fb 49 89 c4 48 89 d8 48 c1 e8 03 <42> 0f b6 04 38 84 c0 75 12 48 ff c3 49 8d 44 24 01 43 80 7c 26 01
> RSP: 0018:ffffc900035af8a8 EFLAGS: 00010246
> RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff88802d46bc00
> RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
> RBP: 0000000000000000 R08: ffffffff942c58f7 R09: 1ffffffff2858b1e
> R10: dffffc0000000000 R11: fffffbfff2858b1f R12: ffffffffffffffff
> R13: ffff8880727f8000 R14: 0000000000000000 R15: dffffc0000000000
> FS:  00007f01495d76c0(0000) GS:ffff8880b8700000(0000) knlGS:0000000000000000
> CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> CR2: 0000001b2f75ffff CR3: 000000002cffe000 CR4: 00000000003526f0
> DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
> ----------------
> Code disassembly (best guess), 1 bytes skipped:
>     0:	fa                   	cli
>     1:	41 57                	push   %r15
>     3:	41 56                	push   %r14
>     5:	41 54                	push   %r12
>     7:	53                   	push   %rbx
>     8:	49 89 fe             	mov    %rdi,%r14
>     b:	48 c7 c0 ff ff ff ff 	mov    $0xffffffffffffffff,%rax
>    12:	49 bf 00 00 00 00 00 	movabs $0xdffffc0000000000,%r15
>    19:	fc ff df
>    1c:	48 89 fb             	mov    %rdi,%rbx
>    1f:	49 89 c4             	mov    %rax,%r12
>    22:	48 89 d8             	mov    %rbx,%rax
>    25:	48 c1 e8 03          	shr    $0x3,%rax
> * 29:	42 0f b6 04 38       	movzbl (%rax,%r15,1),%eax <-- trapping instruction
>    2e:	84 c0                	test   %al,%al
>    30:	75 12                	jne    0x44
>    32:	48 ff c3             	inc    %rbx
>    35:	49 8d 44 24 01       	lea    0x1(%r12),%rax
>    3a:	43                   	rex.XB
>    3b:	80                   	.byte 0x80
>    3c:	7c 26                	jl     0x64
>    3e:	01                   	.byte 0x1
>
>
> Tested on:
>
> commit:         964c2da7 btrfs: make buffered write to copy one page a..
> git tree:       https://github.com/adam900710/linux.git subpage_read
> console output: https://syzkaller.appspot.com/x/log.txt?x=1296b7d0580000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=3ec5955a0d4f6ede
> dashboard link: https://syzkaller.appspot.com/bug?extid=cee29f5a48caf10cd475
> compiler:       Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
>
> Note: no patches were applied.


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

* Re: [syzbot] [btrfs?] general protection fault in getname_kernel (2)
  2024-10-10  2:26     ` Qu Wenruo
@ 2024-10-10  3:02       ` syzbot
  0 siblings, 0 replies; 8+ messages in thread
From: syzbot @ 2024-10-10  3:02 UTC (permalink / raw)
  To: clm, dsterba, josef, linux-btrfs, linux-kernel, quwenruo.btrfs,
	syzkaller-bugs

Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
lost connection to test machine



Tested on:

commit:         330f0214 btrfs: handle NULL as device path for btrfs_s..
git tree:       https://github.com/adam900710/linux.git subpage_read
console output: https://syzkaller.appspot.com/x/log.txt?x=122384bb980000
kernel config:  https://syzkaller.appspot.com/x/.config?x=3ec5955a0d4f6ede
dashboard link: https://syzkaller.appspot.com/bug?extid=cee29f5a48caf10cd475
compiler:       Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40

Note: no patches were applied.

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

* Re: [syzbot] [btrfs?] general protection fault in getname_kernel (2)
  2024-10-09 13:48 [syzbot] [btrfs?] general protection fault in getname_kernel (2) syzbot
  2024-10-09 23:21 ` Qu Wenruo
@ 2024-10-10  4:30 ` syzbot
  2024-10-10  4:54   ` Qu Wenruo
  1 sibling, 1 reply; 8+ messages in thread
From: syzbot @ 2024-10-10  4:30 UTC (permalink / raw)
  To: clm, dsterba, eadavis, fdmanana, josef, linux-btrfs, linux-kernel,
	quwenruo.btrfs, syzkaller-bugs, wqu

syzbot has bisected this issue to:

commit b4b3fb6c00f37a9da91022adcd83555bc339e044
Author: Qu Wenruo <wqu@suse.com>
Date:   Tue Sep 24 04:57:07 2024 +0000

    btrfs: canonicalize the device path before adding it

bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=15744f07980000
start commit:   33ce24234fca Add linux-next specific files for 20241008
git tree:       linux-next
final oops:     https://syzkaller.appspot.com/x/report.txt?x=17744f07980000
console output: https://syzkaller.appspot.com/x/log.txt?x=13744f07980000
kernel config:  https://syzkaller.appspot.com/x/.config?x=4750ca93740b938d
dashboard link: https://syzkaller.appspot.com/bug?extid=cee29f5a48caf10cd475
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=160ce327980000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=15ea7707980000

Reported-by: syzbot+cee29f5a48caf10cd475@syzkaller.appspotmail.com
Fixes: b4b3fb6c00f3 ("btrfs: canonicalize the device path before adding it")

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

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

* Re: [syzbot] [btrfs?] general protection fault in getname_kernel (2)
  2024-10-10  4:30 ` syzbot
@ 2024-10-10  4:54   ` Qu Wenruo
  2024-10-10  5:37     ` syzbot
  0 siblings, 1 reply; 8+ messages in thread
From: Qu Wenruo @ 2024-10-10  4:54 UTC (permalink / raw)
  To: syzbot, clm, dsterba, eadavis, fdmanana, josef, linux-btrfs,
	linux-kernel, syzkaller-bugs, wqu

#syz test: https://github.com/adam900710/linux.git subpage_read


在 2024/10/10 15:00, syzbot 写道:
> syzbot has bisected this issue to:
>
> commit b4b3fb6c00f37a9da91022adcd83555bc339e044
> Author: Qu Wenruo <wqu@suse.com>
> Date:   Tue Sep 24 04:57:07 2024 +0000
>
>      btrfs: canonicalize the device path before adding it
>
> bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=15744f07980000
> start commit:   33ce24234fca Add linux-next specific files for 20241008
> git tree:       linux-next
> final oops:     https://syzkaller.appspot.com/x/report.txt?x=17744f07980000
> console output: https://syzkaller.appspot.com/x/log.txt?x=13744f07980000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=4750ca93740b938d
> dashboard link: https://syzkaller.appspot.com/bug?extid=cee29f5a48caf10cd475
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=160ce327980000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=15ea7707980000
>
> Reported-by: syzbot+cee29f5a48caf10cd475@syzkaller.appspotmail.com
> Fixes: b4b3fb6c00f3 ("btrfs: canonicalize the device path before adding it")
>
> For information about bisection process see: https://goo.gl/tpsmEJ#bisection
>


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

* Re: [syzbot] [btrfs?] general protection fault in getname_kernel (2)
  2024-10-10  4:54   ` Qu Wenruo
@ 2024-10-10  5:37     ` syzbot
  0 siblings, 0 replies; 8+ messages in thread
From: syzbot @ 2024-10-10  5:37 UTC (permalink / raw)
  To: clm, dsterba, eadavis, fdmanana, josef, linux-btrfs, linux-kernel,
	quwenruo.btrfs, syzkaller-bugs, wqu

Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-by: syzbot+cee29f5a48caf10cd475@syzkaller.appspotmail.com
Tested-by: syzbot+cee29f5a48caf10cd475@syzkaller.appspotmail.com

Tested on:

commit:         5e61ad52 btrfs: convert btrfs_buffered_write() to use ..
git tree:       https://github.com/adam900710/linux.git subpage_read
console output: https://syzkaller.appspot.com/x/log.txt?x=17f24b27980000
kernel config:  https://syzkaller.appspot.com/x/.config?x=3ec5955a0d4f6ede
dashboard link: https://syzkaller.appspot.com/bug?extid=cee29f5a48caf10cd475
compiler:       Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40

Note: no patches were applied.
Note: testing is done by a robot and is best-effort only.

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

end of thread, other threads:[~2024-10-10  5:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-09 13:48 [syzbot] [btrfs?] general protection fault in getname_kernel (2) syzbot
2024-10-09 23:21 ` Qu Wenruo
2024-10-10  0:29   ` syzbot
2024-10-10  2:26     ` Qu Wenruo
2024-10-10  3:02       ` syzbot
2024-10-10  4:30 ` syzbot
2024-10-10  4:54   ` Qu Wenruo
2024-10-10  5:37     ` syzbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox