[Android 5.15] KASAN: null-ptr-deref Read in ida_free

7 views
Skip to first unread message

syzbot

unread,
Mar 25, 2023, 10:00:43 PM3/25/23
to syzkaller-a...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 5448b2fda85f Merge 5.15.94 into android13-5.15-lts
git tree: android13-5.15-lts
console+strace: https://syzkaller.appspot.com/x/log.txt?x=111ecf29c80000
kernel config: https://syzkaller.appspot.com/x/.config?x=cb55b12f877ddc70
dashboard link: https://syzkaller.appspot.com/bug?extid=fbecd71010a6826c2e5f
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=15312e1ec80000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=12a3c639c80000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/24924398a010/disk-5448b2fd.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/e244d5b44fff/vmlinux-5448b2fd.xz
kernel image: https://storage.googleapis.com/syzbot-assets/bc13eddc3000/bzImage-5448b2fd.xz

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

==================================================================
BUG: KASAN: null-ptr-deref in instrument_atomic_read include/linux/instrumented.h:71 [inline]
BUG: KASAN: null-ptr-deref in test_bit include/asm-generic/bitops/instrumented-non-atomic.h:134 [inline]
BUG: KASAN: null-ptr-deref in ida_free+0x1bc/0x3f0 lib/idr.c:511
Read of size 8 at addr 0000000000000000 by task syz-executor226/924

CPU: 1 PID: 924 Comm: syz-executor226 Not tainted 5.15.94-syzkaller-03204-g5448b2fda85f #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x151/0x1b7 lib/dump_stack.c:106
__kasan_report mm/kasan/report.c:431 [inline]
kasan_report+0x16f/0x1c0 mm/kasan/report.c:444
kasan_check_range+0x293/0x2a0 mm/kasan/generic.c:189
__kasan_check_read+0x11/0x20 mm/kasan/shadow.c:31
instrument_atomic_read include/linux/instrumented.h:71 [inline]
test_bit include/asm-generic/bitops/instrumented-non-atomic.h:134 [inline]
ida_free+0x1bc/0x3f0 lib/idr.c:511
mnt_release_group_id fs/namespace.c:159 [inline]
cleanup_group_ids fs/namespace.c:2048 [inline]
do_mount_setattr fs/namespace.c:4115 [inline]
__do_sys_mount_setattr fs/namespace.c:4299 [inline]
__se_sys_mount_setattr+0xbcf/0x1cc0 fs/namespace.c:4258
__x64_sys_mount_setattr+0xbf/0xd0 fs/namespace.c:4258
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7f226c33d919
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 11 15 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:00007f226c2ef318 EFLAGS: 00000246 ORIG_RAX: 00000000000001ba
RAX: ffffffffffffffda RBX: 00007f226c3c53e8 RCX: 00007f226c33d919
RDX: 0000000000000000 RSI: 00000000200000c0 RDI: 0000000000000003
RBP: 00007f226c3c53e0 R08: 0000000000000020 R09: 0000000000000000
R10: 0000000020000140 R11: 0000000000000246 R12: 0030656c69662f2e
R13: 00007ffd165c335f R14: 00007f226c2ef400 R15: 0000000000022000
</TASK>
==================================================================
BUG: kernel NULL pointer dereference, address: 0000000000000000
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
PGD 11fd41067 P4D 11fd41067 PUD 11fd40067 PMD 0
Oops: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 924 Comm: syz-executor226 Tainted: G B 5.15.94-syzkaller-03204-g5448b2fda85f #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
RIP: 0010:variable_test_bit arch/x86/include/asm/bitops.h:214 [inline]
RIP: 0010:test_bit include/asm-generic/bitops/instrumented-non-atomic.h:135 [inline]
RIP: 0010:ida_free+0x1bf/0x3f0 lib/idr.c:511
Code: f1 fe 4c 89 e8 48 83 e0 01 0f 85 b9 00 00 00 41 89 de c1 eb 06 4d 8d 64 dd 00 4c 89 e7 be 08 00 00 00 e8 24 a7 32 ff 45 31 ff <4d> 0f a3 75 00 0f 92 c3 41 0f 92 c7 bf 02 00 00 00 44 89 fe e8 e8
RSP: 0018:ffffc90001037c80 EFLAGS: 00010046
RAX: ffff88810f448000 RBX: 0000000000000000 RCX: ffff88810f448000
RDX: 0000000000000000 RSI: 0000000000000096 RDI: 00000000ffffffff
RBP: ffffc90001037d70 R08: ffffffff8141cf1b R09: 0000000000000003
R10: fffffbfff0dcfe4c R11: dffffc0000000001 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000001 R15: 0000000000000000
FS: 00007f226c2ef700(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 000000011ad32000 CR4: 00000000003506a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
mnt_release_group_id fs/namespace.c:159 [inline]
cleanup_group_ids fs/namespace.c:2048 [inline]
do_mount_setattr fs/namespace.c:4115 [inline]
__do_sys_mount_setattr fs/namespace.c:4299 [inline]
__se_sys_mount_setattr+0xbcf/0x1cc0 fs/namespace.c:4258
__x64_sys_mount_setattr+0xbf/0xd0 fs/namespace.c:4258
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7f226c33d919
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 11 15 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:00007f226c2ef318 EFLAGS: 00000246 ORIG_RAX: 00000000000001ba
RAX: ffffffffffffffda RBX: 00007f226c3c53e8 RCX: 00007f226c33d919
RDX: 0000000000000000 RSI: 00000000200000c0 RDI: 0000000000000003
RBP: 00007f226c3c53e0 R08: 0000000000000020 R09: 0000000000000000
R10: 0000000020000140 R11: 0000000000000246 R12: 0030656c69662f2e
R13: 00007ffd165c335f R14: 00007f226c2ef400 R15: 0000000000022000
</TASK>
Modules linked in:
CR2: 0000000000000000
---[ end trace 4ef4c7bf8225d212 ]---
RIP: 0010:variable_test_bit arch/x86/include/asm/bitops.h:214 [inline]
RIP: 0010:test_bit include/asm-generic/bitops/instrumented-non-atomic.h:135 [inline]
RIP: 0010:ida_free+0x1bf/0x3f0 lib/idr.c:511
Code: f1 fe 4c 89 e8 48 83 e0 01 0f 85 b9 00 00 00 41 89 de c1 eb 06 4d 8d 64 dd 00 4c 89 e7 be 08 00 00 00 e8 24 a7 32 ff 45 31 ff <4d> 0f a3 75 00 0f 92 c3 41 0f 92 c7 bf 02 00 00 00 44 89 fe e8 e8
RSP: 0018:ffffc90001037c80 EFLAGS: 00010046
RAX: ffff88810f448000 RBX: 0000000000000000 RCX: ffff88810f448000
RDX: 0000000000000000 RSI: 0000000000000096 RDI: 00000000ffffffff
RBP: ffffc90001037d70 R08: ffffffff8141cf1b R09: 0000000000000003
R10: fffffbfff0dcfe4c R11: dffffc0000000001 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000001 R15: 0000000000000000
FS: 00007f226c2ef700(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 000000011ad32000 CR4: 00000000003506a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
0: f1 icebp
1: fe 4c 89 e8 decb -0x18(%rcx,%rcx,4)
5: 48 83 e0 01 and $0x1,%rax
9: 0f 85 b9 00 00 00 jne 0xc8
f: 41 89 de mov %ebx,%r14d
12: c1 eb 06 shr $0x6,%ebx
15: 4d 8d 64 dd 00 lea 0x0(%r13,%rbx,8),%r12
1a: 4c 89 e7 mov %r12,%rdi
1d: be 08 00 00 00 mov $0x8,%esi
22: e8 24 a7 32 ff callq 0xff32a74b
27: 45 31 ff xor %r15d,%r15d
* 2a: 4d 0f a3 75 00 bt %r14,0x0(%r13) <-- trapping instruction
2f: 0f 92 c3 setb %bl
32: 41 0f 92 c7 setb %r15b
36: bf 02 00 00 00 mov $0x2,%edi
3b: 44 89 fe mov %r15d,%esi
3e: e8 .byte 0xe8
3f: e8 .byte 0xe8


---
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.
syzbot can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches

Tudor Ambarus

unread,
Mar 27, 2023, 10:56:16 PM3/27/23
to syzbot+fbecd7...@syzkaller.appspotmail.com, Lee Jones, syzkaller-a...@googlegroups.com

syzbot

unread,
Mar 28, 2023, 12:19:22 AM3/28/23
to jone...@google.com, syzkaller-a...@googlegroups.com, tudor....@linaro.org
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
KASAN: null-ptr-deref Read in ida_free

==================================================================
BUG: KASAN: null-ptr-deref in instrument_atomic_read include/linux/instrumented.h:71 [inline]
BUG: KASAN: null-ptr-deref in test_bit include/asm-generic/bitops/instrumented-non-atomic.h:134 [inline]
BUG: KASAN: null-ptr-deref in ida_free+0x1bc/0x3f0 lib/idr.c:511
Read of size 8 at addr 0000000000000000 by task syz-executor.0/504

CPU: 1 PID: 504 Comm: syz-executor.0 Not tainted 5.15.104-syzkaller-15317-g115472395b0a #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x151/0x1b7 lib/dump_stack.c:106
__kasan_report mm/kasan/report.c:438 [inline]
kasan_report+0x165/0x1c0 mm/kasan/report.c:451
kasan_check_range+0x293/0x2a0 mm/kasan/generic.c:189
__kasan_check_read+0x11/0x20 mm/kasan/shadow.c:31
instrument_atomic_read include/linux/instrumented.h:71 [inline]
test_bit include/asm-generic/bitops/instrumented-non-atomic.h:134 [inline]
ida_free+0x1bc/0x3f0 lib/idr.c:511
mnt_release_group_id fs/namespace.c:159 [inline]
cleanup_group_ids fs/namespace.c:2048 [inline]
do_mount_setattr fs/namespace.c:4126 [inline]
__do_sys_mount_setattr fs/namespace.c:4310 [inline]
__se_sys_mount_setattr+0xbcf/0x1c90 fs/namespace.c:4269
__x64_sys_mount_setattr+0xbf/0xd0 fs/namespace.c:4269
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7ff6ae2a80f9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 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:00007ff6ade1b168 EFLAGS: 00000246 ORIG_RAX: 00000000000001ba
RAX: ffffffffffffffda RBX: 00007ff6ae3c7f80 RCX: 00007ff6ae2a80f9
RDX: 0000000000000000 RSI: 00000000200000c0 RDI: 0000000000000003
RBP: 00007ff6ae303b39 R08: 0000000000000020 R09: 0000000000000000
R10: 0000000020000140 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffed07e873f R14: 00007ff6ade1b300 R15: 0000000000022000
</TASK>
==================================================================
BUG: kernel NULL pointer dereference, address: 0000000000000000
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
PGD 10d807067 P4D 10d807067 PUD 11fddc067 PMD 0
Oops: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 504 Comm: syz-executor.0 Tainted: G B 5.15.104-syzkaller-15317-g115472395b0a #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
RIP: 0010:variable_test_bit arch/x86/include/asm/bitops.h:214 [inline]
RIP: 0010:test_bit include/asm-generic/bitops/instrumented-non-atomic.h:135 [inline]
RIP: 0010:ida_free+0x1bf/0x3f0 lib/idr.c:511
Code: f8 fe 4c 89 e8 48 83 e0 01 0f 85 b9 00 00 00 41 89 de c1 eb 06 4d 8d 64 dd 00 4c 89 e7 be 08 00 00 00 e8 b4 53 37 ff 45 31 ff <4d> 0f a3 75 00 0f 92 c3 41 0f 92 c7 bf 02 00 00 00 44 89 fe e8 e8
RSP: 0018:ffffc90000b97c80 EFLAGS: 00010046
RAX: ffff8881067bf000 RBX: 0000000000000000 RCX: ffff8881067bf000
RDX: 0000000000000000 RSI: 0000000000000082 RDI: 00000000ffffffff
RBP: ffffc90000b97d70 R08: ffffffff8141801b R09: 0000000000000003
R10: fffffbfff0d07844 R11: dffffc0000000001 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000001 R15: 0000000000000000
FS: 00007ff6ade1b700(0000) GS:ffff8881f7300000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 000000010dbd3000 CR4: 00000000003506a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
mnt_release_group_id fs/namespace.c:159 [inline]
cleanup_group_ids fs/namespace.c:2048 [inline]
do_mount_setattr fs/namespace.c:4126 [inline]
__do_sys_mount_setattr fs/namespace.c:4310 [inline]
__se_sys_mount_setattr+0xbcf/0x1c90 fs/namespace.c:4269
__x64_sys_mount_setattr+0xbf/0xd0 fs/namespace.c:4269
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7ff6ae2a80f9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 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:00007ff6ade1b168 EFLAGS: 00000246 ORIG_RAX: 00000000000001ba
RAX: ffffffffffffffda RBX: 00007ff6ae3c7f80 RCX: 00007ff6ae2a80f9
RDX: 0000000000000000 RSI: 00000000200000c0 RDI: 0000000000000003
RBP: 00007ff6ae303b39 R08: 0000000000000020 R09: 0000000000000000
R10: 0000000020000140 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffed07e873f R14: 00007ff6ade1b300 R15: 0000000000022000
</TASK>
Modules linked in:
CR2: 0000000000000000
---[ end trace 3d7c2b12b55bfd2e ]---
RIP: 0010:variable_test_bit arch/x86/include/asm/bitops.h:214 [inline]
RIP: 0010:test_bit include/asm-generic/bitops/instrumented-non-atomic.h:135 [inline]
RIP: 0010:ida_free+0x1bf/0x3f0 lib/idr.c:511
Code: f8 fe 4c 89 e8 48 83 e0 01 0f 85 b9 00 00 00 41 89 de c1 eb 06 4d 8d 64 dd 00 4c 89 e7 be 08 00 00 00 e8 b4 53 37 ff 45 31 ff <4d> 0f a3 75 00 0f 92 c3 41 0f 92 c7 bf 02 00 00 00 44 89 fe e8 e8
RSP: 0018:ffffc90000b97c80 EFLAGS: 00010046
RAX: ffff8881067bf000 RBX: 0000000000000000 RCX: ffff8881067bf000
RDX: 0000000000000000 RSI: 0000000000000082 RDI: 00000000ffffffff
RBP: ffffc90000b97d70 R08: ffffffff8141801b R09: 0000000000000003
R10: fffffbfff0d07844 R11: dffffc0000000001 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000001 R15: 0000000000000000
FS: 00007ff6ade1b700(0000) GS:ffff8881f7300000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 000000010dbd3000 CR4: 00000000003506a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
0: f8 clc
1: fe 4c 89 e8 decb -0x18(%rcx,%rcx,4)
5: 48 83 e0 01 and $0x1,%rax
9: 0f 85 b9 00 00 00 jne 0xc8
f: 41 89 de mov %ebx,%r14d
12: c1 eb 06 shr $0x6,%ebx
15: 4d 8d 64 dd 00 lea 0x0(%r13,%rbx,8),%r12
1a: 4c 89 e7 mov %r12,%rdi
1d: be 08 00 00 00 mov $0x8,%esi
22: e8 b4 53 37 ff callq 0xff3753db
27: 45 31 ff xor %r15d,%r15d
* 2a: 4d 0f a3 75 00 bt %r14,0x0(%r13) <-- trapping instruction
2f: 0f 92 c3 setb %bl
32: 41 0f 92 c7 setb %r15b
36: bf 02 00 00 00 mov $0x2,%edi
3b: 44 89 fe mov %r15d,%esi
3e: e8 .byte 0xe8
3f: e8 .byte 0xe8


Tested on:

commit: 11547239 Linux 5.15.104
git tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git v5.15.104
console output: https://syzkaller.appspot.com/x/log.txt?x=1733f5d5c80000
kernel config: https://syzkaller.appspot.com/x/.config?x=64e20f826821631b
dashboard link: https://syzkaller.appspot.com/bug?extid=fbecd71010a6826c2e5f
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2

Note: no patches were applied.

Tudor Ambarus

unread,
Mar 28, 2023, 12:21:57 AM3/28/23
to syzbot, jone...@google.com, syzkaller-a...@googlegroups.com

syzbot

unread,
Mar 28, 2023, 12:32:22 AM3/28/23
to jone...@google.com, syzkaller-a...@googlegroups.com, tudor....@linaro.org
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
KASAN: null-ptr-deref Read in ida_free

==================================================================
BUG: KASAN: null-ptr-deref in instrument_atomic_read include/linux/instrumented.h:72 [inline]
BUG: KASAN: null-ptr-deref in _test_bit include/asm-generic/bitops/instrumented-non-atomic.h:141 [inline]
BUG: KASAN: null-ptr-deref in ida_free+0x1b9/0x400 lib/idr.c:511
Read of size 8 at addr 0000000000000000 by task syz-executor.0/399

CPU: 1 PID: 399 Comm: syz-executor.0 Not tainted 6.3.0-rc4-syzkaller-g197b6b60ae7b #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x155/0x1c0 lib/dump_stack.c:106
print_report+0xe6/0x540 mm/kasan/report.c:433
kasan_report+0x16d/0x1a0 mm/kasan/report.c:536
kasan_check_range+0x298/0x2a0 mm/kasan/generic.c:187
__kasan_check_read+0x15/0x20 mm/kasan/shadow.c:31
instrument_atomic_read include/linux/instrumented.h:72 [inline]
_test_bit include/asm-generic/bitops/instrumented-non-atomic.h:141 [inline]
ida_free+0x1b9/0x400 lib/idr.c:511
mnt_release_group_id fs/namespace.c:160 [inline]
cleanup_group_ids fs/namespace.c:2093 [inline]
do_mount_setattr fs/namespace.c:4188 [inline]
__do_sys_mount_setattr fs/namespace.c:4375 [inline]
__se_sys_mount_setattr+0xc00/0x1aa0 fs/namespace.c:4334
__x64_sys_mount_setattr+0xc3/0xe0 fs/namespace.c:4334
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x41/0x90 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f220428c0f9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 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:00007f22050a0168 EFLAGS: 00000246 ORIG_RAX: 00000000000001ba
RAX: ffffffffffffffda RBX: 00007f22043abf80 RCX: 00007f220428c0f9
RDX: 0000000000000000 RSI: 00000000200000c0 RDI: 0000000000000003
RBP: 00007f22042e7b39 R08: 0000000000000020 R09: 0000000000000000
R10: 0000000020000140 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffd860e457f R14: 00007f22050a0300 R15: 0000000000022000
</TASK>
==================================================================
BUG: kernel NULL pointer dereference, address: 0000000000000000
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
PGD 1114b3067 P4D 1114b3067 PUD 10f7b2067 PMD 0
Oops: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 399 Comm: syz-executor.0 Tainted: G B 6.3.0-rc4-syzkaller-g197b6b60ae7b #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023
RIP: 0010:variable_test_bit arch/x86/include/asm/bitops.h:228 [inline]
RIP: 0010:arch_test_bit arch/x86/include/asm/bitops.h:240 [inline]
RIP: 0010:_test_bit include/asm-generic/bitops/instrumented-non-atomic.h:142 [inline]
RIP: 0010:ida_free+0x1bb/0x400 lib/idr.c:511
Code: 98 fc 4c 89 e8 48 83 e0 01 0f 85 c1 00 00 00 41 89 df 4c 89 f8 48 c1 e8 06 49 8d 7c c5 00 be 08 00 00 00 e8 d7 ec e0 fc 31 db <4d> 0f a3 7d 00 41 0f 92 c6 0f 92 c3 bf 02 00 00 00 89 de e8 4d 9d
RSP: 0018:ffffc90002f5fc80 EFLAGS: 00010046
RAX: ffff8881136ad000 RBX: 0000000000000000 RCX: ffff8881136ad000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc90002f5fd70 R08: ffffffff81463617 R09: fffffbfff0d988f9
R10: 0000000000000000 R11: dffffc0000000001 R12: ffffffff8647ac20
R13: 0000000000000000 R14: ffffc90002f5fce0 R15: 0000000000000001
FS: 00007f22050a0700(0000) GS:ffff8881f7300000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 0000000110734000 CR4: 00000000003506a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
mnt_release_group_id fs/namespace.c:160 [inline]
cleanup_group_ids fs/namespace.c:2093 [inline]
do_mount_setattr fs/namespace.c:4188 [inline]
__do_sys_mount_setattr fs/namespace.c:4375 [inline]
__se_sys_mount_setattr+0xc00/0x1aa0 fs/namespace.c:4334
__x64_sys_mount_setattr+0xc3/0xe0 fs/namespace.c:4334
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x41/0x90 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f220428c0f9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 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:00007f22050a0168 EFLAGS: 00000246 ORIG_RAX: 00000000000001ba
RAX: ffffffffffffffda RBX: 00007f22043abf80 RCX: 00007f220428c0f9
RDX: 0000000000000000 RSI: 00000000200000c0 RDI: 0000000000000003
RBP: 00007f22042e7b39 R08: 0000000000000020 R09: 0000000000000000
R10: 0000000020000140 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffd860e457f R14: 00007f22050a0300 R15: 0000000000022000
</TASK>
Modules linked in:
CR2: 0000000000000000
---[ end trace 0000000000000000 ]---
RIP: 0010:variable_test_bit arch/x86/include/asm/bitops.h:228 [inline]
RIP: 0010:arch_test_bit arch/x86/include/asm/bitops.h:240 [inline]
RIP: 0010:_test_bit include/asm-generic/bitops/instrumented-non-atomic.h:142 [inline]
RIP: 0010:ida_free+0x1bb/0x400 lib/idr.c:511
Code: 98 fc 4c 89 e8 48 83 e0 01 0f 85 c1 00 00 00 41 89 df 4c 89 f8 48 c1 e8 06 49 8d 7c c5 00 be 08 00 00 00 e8 d7 ec e0 fc 31 db <4d> 0f a3 7d 00 41 0f 92 c6 0f 92 c3 bf 02 00 00 00 89 de e8 4d 9d
RSP: 0018:ffffc90002f5fc80 EFLAGS: 00010046
RAX: ffff8881136ad000 RBX: 0000000000000000 RCX: ffff8881136ad000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc90002f5fd70 R08: ffffffff81463617 R09: fffffbfff0d988f9
R10: 0000000000000000 R11: dffffc0000000001 R12: ffffffff8647ac20
R13: 0000000000000000 R14: ffffc90002f5fce0 R15: 0000000000000001
FS: 00007f22050a0700(0000) GS:ffff8881f7300000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 0000000110734000 CR4: 00000000003506a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
0: 98 cwtl
1: fc cld
2: 4c 89 e8 mov %r13,%rax
5: 48 83 e0 01 and $0x1,%rax
9: 0f 85 c1 00 00 00 jne 0xd0
f: 41 89 df mov %ebx,%r15d
12: 4c 89 f8 mov %r15,%rax
15: 48 c1 e8 06 shr $0x6,%rax
19: 49 8d 7c c5 00 lea 0x0(%r13,%rax,8),%rdi
1e: be 08 00 00 00 mov $0x8,%esi
23: e8 d7 ec e0 fc callq 0xfce0ecff
28: 31 db xor %ebx,%ebx
* 2a: 4d 0f a3 7d 00 bt %r15,0x0(%r13) <-- trapping instruction
2f: 41 0f 92 c6 setb %r14b
33: 0f 92 c3 setb %bl
36: bf 02 00 00 00 mov $0x2,%edi
3b: 89 de mov %ebx,%esi
3d: e8 .byte 0xe8
3e: 4d 9d rex.WRB popfq


Tested on:

commit: 197b6b60 Linux 6.3-rc4
git tree: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git v6.3-rc4
console output: https://syzkaller.appspot.com/x/log.txt?x=11e13b89c80000
kernel config: https://syzkaller.appspot.com/x/.config?x=68da6fd3235c8ec2

Tudor Ambarus

unread,
Apr 5, 2023, 10:13:31 AM4/5/23
to syzbot, Lee Jones, syzkaller-a...@googlegroups.com

syzbot

unread,
Apr 5, 2023, 10:37:27 AM4/5/23
to jone...@google.com, syzkaller-a...@googlegroups.com, tudo...@google.com
Hello,

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

Reported-and-tested-by: syzbot+fbecd7...@syzkaller.appspotmail.com

Tested on:

commit: 8ce9b890 fs: drop peer group ids under namespace lock
git tree: https://github.com/ambarus/linux.git
console output: https://syzkaller.appspot.com/x/log.txt?x=11b18cb5c80000
kernel config: https://syzkaller.appspot.com/x/.config?x=2bc7633dee4d7ae2
dashboard link: https://syzkaller.appspot.com/bug?extid=fbecd71010a6826c2e5f
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2

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

Tudor Ambarus

unread,
Apr 5, 2023, 12:02:00 PM4/5/23
to syzbot, Lee Jones, syzkaller-a...@googlegroups.com
#syz fix: fs: drop peer group ids under namespace lock
Reply all
Reply to author
Forward
0 new messages