2024-04-30 01:22:33

by Ubisectech Sirius

[permalink] [raw]
Subject: BUG: unable to handle kernel paging request in do_split

Hello.
We are Ubisectech Sirius Team, the vulnerability lab of China ValiantSec. Recently, our team has discovered a issue in Linux kernel 6.7. Attached to the email were a PoC file of the issue.

Stack dump:
BUG: unable to handle page fault for address: ffffed110c2fd97f
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
PGD 7ffd0067 P4D 7ffd0067 PUD 0
Oops: 0000 [#1] PREEMPT SMP KASAN NOPTI
CPU: 0 PID: 24082 Comm: syz-executor.3 Not tainted 6.7.0 #2
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014
RIP: 0010:do_split+0xfef/0x1e10 fs/ext4/namei.c:2047
Code: d2 0f 85 38 0b 00 00 8b 45 00 89 84 24 84 00 00 00 41 8d 45 ff 48 8d 1c c3 48 b8 00 00 00 00 00 fc ff df 48 89 da 48 c1 ea 03 <0f> b6 14 02 48 89 d8 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 ef
RSP: 0018:ffffc90001e9f858 EFLAGS: 00010a02
RAX: dffffc0000000000 RBX: ffff8888617ecbf8 RCX: ffffc9001048f000
RDX: 1ffff1110c2fd97f RSI: ffffffff823364ab RDI: 0000000000000005
RBP: ffff8880617ecc00 R08: 0000000000000005 R09: 00000000ffffffff
R10: 00000000ffffffff R11: 0000000000000000 R12: dffffc0000000000
R13: 0000000000000000 R14: 00000000ffffffff R15: ffff88801ee8d2b0
FS: 00007f191402a640(0000) GS:ffff88802c600000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffed110c2fd97f CR3: 000000005500a000 CR4: 0000000000750ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
PKRU: 55555554
Call Trace:
<TASK>
make_indexed_dir+0x1158/0x1540 fs/ext4/namei.c:2342
ext4_add_entry+0xcd0/0xe80 fs/ext4/namei.c:2454
ext4_add_nondir+0x90/0x2b0 fs/ext4/namei.c:2795
ext4_symlink+0x539/0x9e0 fs/ext4/namei.c:3436
vfs_symlink fs/namei.c:4464 [inline]
vfs_symlink+0x3f6/0x640 fs/namei.c:4448
do_symlinkat+0x245/0x2f0 fs/namei.c:4490
__do_sys_symlink fs/namei.c:4511 [inline]
__se_sys_symlink fs/namei.c:4509 [inline]
__x64_sys_symlink+0x79/0xa0 fs/namei.c:4509
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0x43/0x120 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x6f/0x77
RIP: 0033:0x7f191329002d
Code: c3 e8 97 2b 00 00 0f 1f 80 00 00 00 00 f3 0f 1e fa 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f191402a028 EFLAGS: 00000246 ORIG_RAX: 0000000000000058
RAX: ffffffffffffffda RBX: 00007f19133cbf80 RCX: 00007f191329002d
RDX: 0000000000000000 RSI: 0000000020000e40 RDI: 0000000020001640
RBP: 00007f19132f14d0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f19133cbf80 R15: 00007f191400a000
</TASK>
Modules linked in:
CR2: ffffed110c2fd97f
---[ end trace 0000000000000000 ]---
RIP: 0010:do_split+0xfef/0x1e10 fs/ext4/namei.c:2047
Code: d2 0f 85 38 0b 00 00 8b 45 00 89 84 24 84 00 00 00 41 8d 45 ff 48 8d 1c c3 48 b8 00 00 00 00 00 fc ff df 48 89 da 48 c1 ea 03 <0f> b6 14 02 48 89 d8 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 ef
RSP: 0018:ffffc90001e9f858 EFLAGS: 00010a02
RAX: dffffc0000000000 RBX: ffff8888617ecbf8 RCX: ffffc9001048f000
RDX: 1ffff1110c2fd97f RSI: ffffffff823364ab RDI: 0000000000000005
RBP: ffff8880617ecc00 R08: 0000000000000005 R09: 00000000ffffffff
R10: 00000000ffffffff R11: 0000000000000000 R12: dffffc0000000000
R13: 0000000000000000 R14: 00000000ffffffff R15: ffff88801ee8d2b0
FS: 00007f191402a640(0000) GS:ffff88802c600000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffed110c2fd97f CR3: 000000005500a000 CR4: 0000000000750ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
PKRU: 55555554
----------------
Code disassembly (best guess):
0: d2 0f rorb %cl,(%rdi)
2: 85 38 test %edi,(%rax)
4: 0b 00 or (%rax),%eax
6: 00 8b 45 00 89 84 add %cl,-0x7b76ffbb(%rbx)
c: 24 84 and $0x84,%al
e: 00 00 add %al,(%rax)
10: 00 41 8d add %al,-0x73(%rcx)
13: 45 ff 48 8d rex.RB decl -0x73(%r8)
17: 1c c3 sbb $0xc3,%al
19: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax
20: fc ff df
23: 48 89 da mov %rbx,%rdx
26: 48 c1 ea 03 shr $0x3,%rdx
* 2a: 0f b6 14 02 movzbl (%rdx,%rax,1),%edx <-- trapping instruction
2e: 48 89 d8 mov %rbx,%rax
31: 83 e0 07 and $0x7,%eax
34: 83 c0 03 add $0x3,%eax
37: 38 d0 cmp %dl,%al
39: 7c 08 jl 0x43
3b: 84 d2 test %dl,%dl
3d: 0f .byte 0xf
3e: 85 ef test %ebp,%edi


Thank you for taking the time to read this email and we look forward to working with you further.











Attachments:
poc.c (22.82 kB)