[v5.15] general protection fault in ima_post_path_mknod

4 views
Skip to first unread message

syzbot

unread,
Oct 6, 2024, 7:41:22 PM10/6/24
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 3a5928702e71 Linux 5.15.167
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=11bc27d0580000
kernel config: https://syzkaller.appspot.com/x/.config?x=4d3fd5cca89ae935
dashboard link: https://syzkaller.appspot.com/bug?extid=1ffada264154dd758bb9
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/ef5025f3d708/disk-3a592870.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/776fbdad3aa8/vmlinux-3a592870.xz
kernel image: https://storage.googleapis.com/syzbot-assets/79541db5bd16/bzImage-3a592870.xz

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

general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
CPU: 1 PID: 5834 Comm: syz.1.409 Not tainted 5.15.167-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
RIP: 0010:ima_post_path_mknod+0x6e/0x160 security/integrity/ima/ima_main.c:676
Code: 0f b6 04 38 84 c0 0f 85 c5 00 00 00 8b 2d 3a 2d d0 12 31 ff 89 ee e8 61 d3 af fd 85 ed 0f 84 8d 00 00 00 48 89 d8 48 c1 e8 03 <42> 0f b6 04 38 84 c0 0f 85 c0 00 00 00 0f b7 2b 81 e5 00 f0 00 00
RSP: 0018:ffffc90003017dd8 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffffff96a0b703
RDX: ffff888029493b80 RSI: 0000000000000001 RDI: 0000000000000000
RBP: 0000000000000001 R08: ffffffff83d08a6f R09: ffffed100f3c94fb
R10: 0000000000000000 R11: dffffc0000000001 R12: ffffc90003017e80
R13: dffffc0000000000 R14: ffffffff8c7cd520 R15: dffffc0000000000
FS: 00007f6ef1f516c0(0000) GS:ffff8880b9100000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f6ef1f50f98 CR3: 0000000024265000 CR4: 00000000003526e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
do_mknodat+0x41d/0x690 fs/namei.c:3997
__do_sys_mknod fs/namei.c:4027 [inline]
__se_sys_mknod fs/namei.c:4025 [inline]
__x64_sys_mknod+0x8a/0xa0 fs/namei.c:4025
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f6ef3b1aff9
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:00007f6ef1f51038 EFLAGS: 00000246 ORIG_RAX: 0000000000000085
RAX: ffffffffffffffda RBX: 00007f6ef3cd3130 RCX: 00007f6ef3b1aff9
RDX: 0000000000000703 RSI: 0000000000000000 RDI: 0000000020000000
RBP: 00007f6ef3b8d296 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000001 R14: 00007f6ef3cd3130 R15: 00007ffee57b6088
</TASK>
Modules linked in:
---[ end trace f0d9d7dc320e7c4c ]---
RIP: 0010:ima_post_path_mknod+0x6e/0x160 security/integrity/ima/ima_main.c:676
Code: 0f b6 04 38 84 c0 0f 85 c5 00 00 00 8b 2d 3a 2d d0 12 31 ff 89 ee e8 61 d3 af fd 85 ed 0f 84 8d 00 00 00 48 89 d8 48 c1 e8 03 <42> 0f b6 04 38 84 c0 0f 85 c0 00 00 00 0f b7 2b 81 e5 00 f0 00 00
RSP: 0018:ffffc90003017dd8 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffffff96a0b703
RDX: ffff888029493b80 RSI: 0000000000000001 RDI: 0000000000000000
RBP: 0000000000000001 R08: ffffffff83d08a6f R09: ffffed100f3c94fb
R10: 0000000000000000 R11: dffffc0000000001 R12: ffffc90003017e80
R13: dffffc0000000000 R14: ffffffff8c7cd520 R15: dffffc0000000000
FS: 00007f6ef1f516c0(0000) GS:ffff8880b9100000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020019680 CR3: 0000000024265000 CR4: 00000000003526e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
0: 0f b6 04 38 movzbl (%rax,%rdi,1),%eax
4: 84 c0 test %al,%al
6: 0f 85 c5 00 00 00 jne 0xd1
c: 8b 2d 3a 2d d0 12 mov 0x12d02d3a(%rip),%ebp # 0x12d02d4c
12: 31 ff xor %edi,%edi
14: 89 ee mov %ebp,%esi
16: e8 61 d3 af fd call 0xfdafd37c
1b: 85 ed test %ebp,%ebp
1d: 0f 84 8d 00 00 00 je 0xb0
23: 48 89 d8 mov %rbx,%rax
26: 48 c1 e8 03 shr $0x3,%rax
* 2a: 42 0f b6 04 38 movzbl (%rax,%r15,1),%eax <-- trapping instruction
2f: 84 c0 test %al,%al
31: 0f 85 c0 00 00 00 jne 0xf7
37: 0f b7 2b movzwl (%rbx),%ebp
3a: 81 e5 00 f0 00 00 and $0xf000,%ebp


---
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 syzk...@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 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

syzbot

unread,
Oct 6, 2024, 8:32:26 PM10/6/24
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 3a5928702e71 Linux 5.15.167
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=155d8327980000
kernel config: https://syzkaller.appspot.com/x/.config?x=4d3fd5cca89ae935
dashboard link: https://syzkaller.appspot.com/bug?extid=1ffada264154dd758bb9
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=1122e79f980000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17da27d0580000
mounted in repro: https://storage.googleapis.com/syzbot-assets/83c51229871f/mount_0.gz

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

loop0: rw=2049, want=2052, limit=2048
Buffer I/O error on dev loop0, logical block 1025, lost async page write
attempt to access beyond end of device
loop0: rw=2049, want=2052, limit=2048
Buffer I/O error on dev loop0, logical block 1025, lost async page write
attempt to access beyond end of device
loop0: rw=2049, want=2054, limit=2048
Buffer I/O error on dev loop0, logical block 1026, lost async page write
general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
CPU: 0 PID: 3564 Comm: syz-executor245 Not tainted 5.15.167-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
RIP: 0010:ima_post_path_mknod+0x6e/0x160 security/integrity/ima/ima_main.c:676
Code: 0f b6 04 38 84 c0 0f 85 c5 00 00 00 8b 2d 3a 2d d0 12 31 ff 89 ee e8 61 d3 af fd 85 ed 0f 84 8d 00 00 00 48 89 d8 48 c1 e8 03 <42> 0f b6 04 38 84 c0 0f 85 c0 00 00 00 0f b7 2b 81 e5 00 f0 00 00
RSP: 0018:ffffc90002507dd8 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffffff96a0b703
RDX: ffff888026b40000 RSI: 0000000000000001 RDI: 0000000000000000
RBP: 0000000000000001 R08: ffffffff83d08a6f R09: ffffed1003e3a8fb
R10: 0000000000000000 R11: dffffc0000000001 R12: ffffc90002507e80
R13: dffffc0000000000 R14: ffffffff8c7cd520 R15: dffffc0000000000
FS: 000055557f04a380(0000) GS:ffff8880b9000000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000200d2000 CR3: 000000006f840000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
do_mknodat+0x41d/0x690 fs/namei.c:3997
__do_sys_mknod fs/namei.c:4027 [inline]
__se_sys_mknod fs/namei.c:4025 [inline]
__x64_sys_mknod+0x8a/0xa0 fs/namei.c:4025
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7fb5549e2a39
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 61 17 00 00 90 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:00007ffc4027ab98 EFLAGS: 00000246 ORIG_RAX: 0000000000000085
RAX: ffffffffffffffda RBX: 00007ffc4027ad78 RCX: 00007fb5549e2a39
RDX: 0000000000000701 RSI: 0000000000000000 RDI: 0000000020000000
RBP: 00007fb554a57610 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffc4027ad68 R14: 0000000000000001 R15: 0000000000000001
</TASK>
Modules linked in:
---[ end trace 84d3ce864dd13acd ]---
RIP: 0010:ima_post_path_mknod+0x6e/0x160 security/integrity/ima/ima_main.c:676
Code: 0f b6 04 38 84 c0 0f 85 c5 00 00 00 8b 2d 3a 2d d0 12 31 ff 89 ee e8 61 d3 af fd 85 ed 0f 84 8d 00 00 00 48 89 d8 48 c1 e8 03 <42> 0f b6 04 38 84 c0 0f 85 c0 00 00 00 0f b7 2b 81 e5 00 f0 00 00
RSP: 0018:ffffc90002507dd8 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffffffff96a0b703
RDX: ffff888026b40000 RSI: 0000000000000001 RDI: 0000000000000000
RBP: 0000000000000001 R08: ffffffff83d08a6f R09: ffffed1003e3a8fb
R10: 0000000000000000 R11: dffffc0000000001 R12: ffffc90002507e80
R13: dffffc0000000000 R14: ffffffff8c7cd520 R15: dffffc0000000000
FS: 000055557f04a380(0000) GS:ffff8880b9000000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000200d2000 CR3: 000000006f840000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
0: 0f b6 04 38 movzbl (%rax,%rdi,1),%eax
4: 84 c0 test %al,%al
6: 0f 85 c5 00 00 00 jne 0xd1
c: 8b 2d 3a 2d d0 12 mov 0x12d02d3a(%rip),%ebp # 0x12d02d4c
12: 31 ff xor %edi,%edi
14: 89 ee mov %ebp,%esi
16: e8 61 d3 af fd call 0xfdafd37c
1b: 85 ed test %ebp,%ebp
1d: 0f 84 8d 00 00 00 je 0xb0
23: 48 89 d8 mov %rbx,%rax
26: 48 c1 e8 03 shr $0x3,%rax
* 2a: 42 0f b6 04 38 movzbl (%rax,%r15,1),%eax <-- trapping instruction
2f: 84 c0 test %al,%al
31: 0f 85 c0 00 00 00 jne 0xf7
37: 0f b7 2b movzwl (%rbx),%ebp
3a: 81 e5 00 f0 00 00 and $0xf000,%ebp


---
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.

syzbot

unread,
Nov 9, 2024, 6:24:05 PM11/9/24
to syzkaller...@googlegroups.com
syzbot suspects this issue was fixed by commit:

commit 4a1d95fc9706b2b065e56d5281b380bcaa1bce9c
Author: Jan Kara <ja...@suse.cz>
Date: Thu Oct 17 20:20:01 2024 +0000

udf: Don't return bh from udf_expand_dir_adinicb()

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=14e414e8580000
start commit: 3a5928702e71 Linux 5.15.167
git tree: linux-5.15.y
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=11404327980000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1361e79f980000

If the result looks correct, please mark the issue as fixed by replying with:

#syz fix: udf: Don't return bh from udf_expand_dir_adinicb()

For information about bisection process see: https://goo.gl/tpsmEJ#bisection
Reply all
Reply to author
Forward
0 new messages