KASAN: null-ptr-deref Write in d_delete

6 views
Skip to first unread message

syzbot

unread,
Feb 25, 2022, 12:07:32 PM2/25/22
to syzkaller-a...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 961dd91cc692 Revert "ANDROID: incremental-fs: fix mount_fs..
git tree: android12-5.4
console output: https://syzkaller.appspot.com/x/log.txt?x=127cf366700000
kernel config: https://syzkaller.appspot.com/x/.config?x=bbe0ee1ab44a44aa
dashboard link: https://syzkaller.appspot.com/bug?extid=f59e967603eaa94970d4
compiler: Debian clang version 11.0.1-2, GNU ld (GNU Binutils for Debian) 2.35.2

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

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

RBP: 00007ff3791f508d R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fff56c4f85f R14: 00007ff378311300 R15: 0000000000022000
---[ end trace 561ad1c73c7d8056 ]---
==================================================================
BUG: KASAN: null-ptr-deref in atomic_try_cmpxchg include/asm-generic/atomic-instrumented.h:693 [inline]
BUG: KASAN: null-ptr-deref in queued_spin_lock include/asm-generic/qspinlock.h:78 [inline]
BUG: KASAN: null-ptr-deref in do_raw_spin_lock include/linux/spinlock.h:181 [inline]
BUG: KASAN: null-ptr-deref in __raw_spin_lock include/linux/spinlock_api_smp.h:143 [inline]
BUG: KASAN: null-ptr-deref in _raw_spin_lock+0x5f/0x170 kernel/locking/spinlock.c:151
Write of size 4 at addr 0000000000000088 by task syz-executor.2/9849

CPU: 0 PID: 9849 Comm: syz-executor.2 Tainted: G W 5.4.161-syzkaller-00025-g961dd91cc692 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x18e/0x1de lib/dump_stack.c:118
__kasan_report+0x178/0x260 mm/kasan/report.c:520
kasan_report+0x30/0x60 mm/kasan/common.c:653
check_memory_region_inline mm/kasan/generic.c:141 [inline]
check_memory_region+0x2a5/0x2e0 mm/kasan/generic.c:191
atomic_try_cmpxchg include/asm-generic/atomic-instrumented.h:693 [inline]
queued_spin_lock include/asm-generic/qspinlock.h:78 [inline]
do_raw_spin_lock include/linux/spinlock.h:181 [inline]
__raw_spin_lock include/linux/spinlock_api_smp.h:143 [inline]
_raw_spin_lock+0x5f/0x170 kernel/locking/spinlock.c:151
spin_lock include/linux/spinlock.h:338 [inline]
d_delete+0x46/0x100 fs/dcache.c:2444
vfs_rmdir+0x1c9/0x3e0 fs/namei.c:3971
incfs_kill_sb+0x9b/0xe0 fs/incfs/vfs.c:1885
deactivate_locked_super+0xaf/0x100 fs/super.c:335
deactivate_super+0x168/0x210 fs/super.c:366
cleanup_mnt+0x432/0x4e0 fs/namespace.c:1102
task_work_run+0x186/0x1b0 kernel/task_work.c:113
tracehook_notify_resume include/linux/tracehook.h:188 [inline]
exit_to_usermode_loop arch/x86/entry/common.c:163 [inline]
prepare_exit_to_usermode+0x2b0/0x310 arch/x86/entry/common.c:194
entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x7ff37919b059
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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ff378311168 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6
RAX: 0000000000000000 RBX: 00007ff3792adf60 RCX: 00007ff37919b059
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000180
RBP: 00007ff3791f508d R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fff56c4f85f R14: 00007ff378311300 R15: 0000000000022000
==================================================================
BUG: kernel NULL pointer dereference, address: 0000000000000088
#PF: supervisor write access in kernel mode
#PF: error_code(0x0002) - not-present page
PGD 1dda42067 P4D 1dda42067 PUD 1e5cca067 PMD 0
Oops: 0002 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 9849 Comm: syz-executor.2 Tainted: G B W 5.4.161-syzkaller-00025-g961dd91cc692 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:arch_atomic_try_cmpxchg arch/x86/include/asm/atomic.h:200 [inline]
RIP: 0010:atomic_try_cmpxchg include/asm-generic/atomic-instrumented.h:695 [inline]
RIP: 0010:queued_spin_lock include/asm-generic/qspinlock.h:78 [inline]
RIP: 0010:do_raw_spin_lock include/linux/spinlock.h:181 [inline]
RIP: 0010:__raw_spin_lock include/linux/spinlock_api_smp.h:143 [inline]
RIP: 0010:_raw_spin_lock+0x82/0x170 kernel/locking/spinlock.c:151
Code: 00 00 e8 21 6e 69 fd 48 89 df be 04 00 00 00 e8 14 6e 69 fd 42 8a 44 35 00 84 c0 0f 85 a0 00 00 00 8b 44 24 04 b9 01 00 00 00 <f0> 41 0f b1 0c 24 75 21 65 48 8b 04 25 28 00 00 00 48 3b 44 24 08
RSP: 0018:ffff8881e114fd10 EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffff8881e114fd14 RCX: 0000000000000001
RDX: 0000000000000001 RSI: 0000000000000004 RDI: ffff8881e114fd14
RBP: 1ffff1103c229fa2 R08: dffffc0000000000 R09: ffffed103c229fa3
R10: ffffed103c229fa3 R11: 0000000000000000 R12: 0000000000000088
R13: dffffc0000000000 R14: dffffc0000000000 R15: 0000000000200108
FS: 00007ff378311700(0000) GS:ffff8881f6e00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000088 CR3: 00000001e5ab3000 CR4: 00000000003406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
spin_lock include/linux/spinlock.h:338 [inline]
d_delete+0x46/0x100 fs/dcache.c:2444
vfs_rmdir+0x1c9/0x3e0 fs/namei.c:3971
incfs_kill_sb+0x9b/0xe0 fs/incfs/vfs.c:1885
deactivate_locked_super+0xaf/0x100 fs/super.c:335
deactivate_super+0x168/0x210 fs/super.c:366
cleanup_mnt+0x432/0x4e0 fs/namespace.c:1102
task_work_run+0x186/0x1b0 kernel/task_work.c:113
tracehook_notify_resume include/linux/tracehook.h:188 [inline]
exit_to_usermode_loop arch/x86/entry/common.c:163 [inline]
prepare_exit_to_usermode+0x2b0/0x310 arch/x86/entry/common.c:194
entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x7ff37919b059
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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ff378311168 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6
RAX: 0000000000000000 RBX: 00007ff3792adf60 RCX: 00007ff37919b059
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000180
RBP: 00007ff3791f508d R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fff56c4f85f R14: 00007ff378311300 R15: 0000000000022000
Modules linked in:
CR2: 0000000000000088
---[ end trace 561ad1c73c7d8057 ]---
RIP: 0010:arch_atomic_try_cmpxchg arch/x86/include/asm/atomic.h:200 [inline]
RIP: 0010:atomic_try_cmpxchg include/asm-generic/atomic-instrumented.h:695 [inline]
RIP: 0010:queued_spin_lock include/asm-generic/qspinlock.h:78 [inline]
RIP: 0010:do_raw_spin_lock include/linux/spinlock.h:181 [inline]
RIP: 0010:__raw_spin_lock include/linux/spinlock_api_smp.h:143 [inline]
RIP: 0010:_raw_spin_lock+0x82/0x170 kernel/locking/spinlock.c:151
Code: 00 00 e8 21 6e 69 fd 48 89 df be 04 00 00 00 e8 14 6e 69 fd 42 8a 44 35 00 84 c0 0f 85 a0 00 00 00 8b 44 24 04 b9 01 00 00 00 <f0> 41 0f b1 0c 24 75 21 65 48 8b 04 25 28 00 00 00 48 3b 44 24 08
RSP: 0018:ffff8881e114fd10 EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffff8881e114fd14 RCX: 0000000000000001
RDX: 0000000000000001 RSI: 0000000000000004 RDI: ffff8881e114fd14
RBP: 1ffff1103c229fa2 R08: dffffc0000000000 R09: ffffed103c229fa3
R10: ffffed103c229fa3 R11: 0000000000000000 R12: 0000000000000088
R13: dffffc0000000000 R14: dffffc0000000000 R15: 0000000000200108
FS: 00007ff378311700(0000) GS:ffff8881f6e00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000088 CR3: 00000001e5ab3000 CR4: 00000000003406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
0: 00 00 add %al,(%rax)
2: e8 21 6e 69 fd callq 0xfd696e28
7: 48 89 df mov %rbx,%rdi
a: be 04 00 00 00 mov $0x4,%esi
f: e8 14 6e 69 fd callq 0xfd696e28
14: 42 8a 44 35 00 mov 0x0(%rbp,%r14,1),%al
19: 84 c0 test %al,%al
1b: 0f 85 a0 00 00 00 jne 0xc1
21: 8b 44 24 04 mov 0x4(%rsp),%eax
25: b9 01 00 00 00 mov $0x1,%ecx
* 2a: f0 41 0f b1 0c 24 lock cmpxchg %ecx,(%r12) <-- trapping instruction
30: 75 21 jne 0x53
32: 65 48 8b 04 25 28 00 mov %gs:0x28,%rax
39: 00 00
3b: 48 3b 44 24 08 cmp 0x8(%rsp),%rax


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

unread,
Jun 25, 2022, 2:25:14 PM6/25/22
to syzkaller-a...@googlegroups.com
Auto-closing this bug as obsolete.
Crashes did not happen for a while, no reproducer and no activity.
Reply all
Reply to author
Forward
0 new messages