[Android 5.15] KASAN: null-ptr-deref Write in backing_data_changed

4 views
Skip to first unread message

syzbot

unread,
Sep 16, 2023, 7:27:48 AM9/16/23
to syzkaller-a...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: ea586874d2f9 Merge 5.15.131 into android13-5.15-lts
git tree: android13-5.15-lts
console+strace: https://syzkaller.appspot.com/x/log.txt?x=13712928680000
kernel config: https://syzkaller.appspot.com/x/.config?x=8c01766ad16ac177
dashboard link: https://syzkaller.appspot.com/bug?extid=c5dd3082fd6efa062072
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=16177e8c680000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17cd9fe8680000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/e84dfa4dc7ef/disk-ea586874.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/b16cac25a266/vmlinux-ea586874.xz
kernel image: https://storage.googleapis.com/syzbot-assets/8aee32c39a67/bzImage-ea586874.xz

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

==================================================================
BUG: KASAN: null-ptr-deref in instrument_atomic_read_write include/linux/instrumented.h:101 [inline]
BUG: KASAN: null-ptr-deref in atomic_inc_return include/linux/atomic/atomic-instrumented.h:188 [inline]
BUG: KASAN: null-ptr-deref in ihold+0x20/0x60 fs/inode.c:426
Write of size 4 at addr 0000000000000170 by task syz-executor267/296

CPU: 0 PID: 296 Comm: syz-executor267 Not tainted 5.15.131-syzkaller-00653-gea586874d2f9 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/04/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_write+0x14/0x20 mm/kasan/shadow.c:37
instrument_atomic_read_write include/linux/instrumented.h:101 [inline]
atomic_inc_return include/linux/atomic/atomic-instrumented.h:188 [inline]
ihold+0x20/0x60 fs/inode.c:426
backing_data_changed+0x1d9/0x4f0 fs/fuse/dir.c:196
fuse_dentry_revalidate+0x826/0xe70 fs/fuse/dir.c:306
d_revalidate fs/namei.c:854 [inline]
lookup_dcache fs/namei.c:1524 [inline]
__lookup_hash+0x1b3/0x290 fs/namei.c:1545
do_renameat2+0x671/0x1480 fs/namei.c:4843
__do_sys_rename fs/namei.c:4938 [inline]
__se_sys_rename fs/namei.c:4936 [inline]
__x64_sys_rename+0x86/0x90 fs/namei.c:4936
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:0x7f1878cdc739
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 c1 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f1878c7d218 EFLAGS: 00000246 ORIG_RAX: 0000000000000052
RAX: ffffffffffffffda RBX: 00007f1878d6b3f8 RCX: 00007f1878cdc739
RDX: 00007f1878cdc739 RSI: 0000000020000140 RDI: 0000000020000100
RBP: 00007f1878d6b3f0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f1878d3809c
R13: 000000000000006e R14: 0030656c69662f30 R15: 00007f1878d36098
</TASK>
==================================================================
BUG: kernel NULL pointer dereference, address: 0000000000000170
#PF: supervisor write access in kernel mode
#PF: error_code(0x0002) - not-present page
PGD 11d1fe067 P4D 11d1fe067 PUD 11d1ff067 PMD 0
Oops: 0002 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 296 Comm: syz-executor267 Tainted: G B 5.15.131-syzkaller-00653-gea586874d2f9 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/04/2023
RIP: 0010:arch_atomic_inc_return include/linux/atomic/atomic-arch-fallback.h:370 [inline]
RIP: 0010:atomic_inc_return include/linux/atomic/atomic-instrumented.h:189 [inline]
RIP: 0010:ihold+0x25/0x60 fs/inode.c:426
Code: 00 00 00 00 00 55 48 89 e5 41 56 53 49 89 fe e8 e1 0f af ff 49 8d be 70 01 00 00 be 04 00 00 00 e8 70 fd f0 ff bb 01 00 00 00 <f0> 41 0f c1 9e 70 01 00 00 ff c3 bf 02 00 00 00 89 de e8 64 13 af
RSP: 0018:ffffc90000987800 EFLAGS: 00010246
RAX: ffff88811e282700 RBX: 0000000000000001 RCX: ffff88811e282780
RDX: 0000000000000000 RSI: 0000000000000292 RDI: 00000000ffffffff
RBP: ffffc90000987810 R08: ffffffff81416a8b R09: 0000000000000003
R10: fffffbfff0e51e4c R11: dffffc0000000001 R12: ffffc900009878a0
R13: 1ffff92000130f0c R14: 0000000000000000 R15: ffff88811b97d100
FS: 00007f1878c7d6c0(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000170 CR3: 000000011d1f5000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
backing_data_changed+0x1d9/0x4f0 fs/fuse/dir.c:196
fuse_dentry_revalidate+0x826/0xe70 fs/fuse/dir.c:306
d_revalidate fs/namei.c:854 [inline]
lookup_dcache fs/namei.c:1524 [inline]
__lookup_hash+0x1b3/0x290 fs/namei.c:1545
do_renameat2+0x671/0x1480 fs/namei.c:4843
__do_sys_rename fs/namei.c:4938 [inline]
__se_sys_rename fs/namei.c:4936 [inline]
__x64_sys_rename+0x86/0x90 fs/namei.c:4936
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:0x7f1878cdc739
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 c1 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f1878c7d218 EFLAGS: 00000246 ORIG_RAX: 0000000000000052
RAX: ffffffffffffffda RBX: 00007f1878d6b3f8 RCX: 00007f1878cdc739
RDX: 00007f1878cdc739 RSI: 0000000020000140 RDI: 0000000020000100
RBP: 00007f1878d6b3f0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f1878d3809c
R13: 000000000000006e R14: 0030656c69662f30 R15: 00007f1878d36098
</TASK>
Modules linked in:
CR2: 0000000000000170
---[ end trace 17ede772bae89d41 ]---
RIP: 0010:arch_atomic_inc_return include/linux/atomic/atomic-arch-fallback.h:370 [inline]
RIP: 0010:atomic_inc_return include/linux/atomic/atomic-instrumented.h:189 [inline]
RIP: 0010:ihold+0x25/0x60 fs/inode.c:426
Code: 00 00 00 00 00 55 48 89 e5 41 56 53 49 89 fe e8 e1 0f af ff 49 8d be 70 01 00 00 be 04 00 00 00 e8 70 fd f0 ff bb 01 00 00 00 <f0> 41 0f c1 9e 70 01 00 00 ff c3 bf 02 00 00 00 89 de e8 64 13 af
RSP: 0018:ffffc90000987800 EFLAGS: 00010246
RAX: ffff88811e282700 RBX: 0000000000000001 RCX: ffff88811e282780
RDX: 0000000000000000 RSI: 0000000000000292 RDI: 00000000ffffffff
RBP: ffffc90000987810 R08: ffffffff81416a8b R09: 0000000000000003
R10: fffffbfff0e51e4c R11: dffffc0000000001 R12: ffffc900009878a0
R13: 1ffff92000130f0c R14: 0000000000000000 R15: ffff88811b97d100
FS: 00007f1878c7d6c0(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000170 CR3: 000000011d1f5000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
0: 00 00 add %al,(%rax)
2: 00 00 add %al,(%rax)
4: 00 55 48 add %dl,0x48(%rbp)
7: 89 e5 mov %esp,%ebp
9: 41 56 push %r14
b: 53 push %rbx
c: 49 89 fe mov %rdi,%r14
f: e8 e1 0f af ff call 0xffaf0ff5
14: 49 8d be 70 01 00 00 lea 0x170(%r14),%rdi
1b: be 04 00 00 00 mov $0x4,%esi
20: e8 70 fd f0 ff call 0xfff0fd95
25: bb 01 00 00 00 mov $0x1,%ebx
* 2a: f0 41 0f c1 9e 70 01 lock xadd %ebx,0x170(%r14) <-- trapping instruction
31: 00 00
33: ff c3 inc %ebx
35: bf 02 00 00 00 mov $0x2,%edi
3a: 89 de mov %ebx,%esi
3c: e8 .byte 0xe8
3d: 64 fs
3e: 13 .byte 0x13
3f: af scas %es:(%rdi),%eax


---
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 bug is already fixed, 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 bug's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

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

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

syzbot

unread,
Dec 19, 2023, 8:34:07 AM12/19/23
to syzkaller-a...@googlegroups.com
syzbot suspects this issue was fixed by commit:

commit e89b1266f784b2271af2e72a5d04e3e39d0afcdc
Author: liujinbao1 <liuji...@xiaomi.corp-partner.google.com>
Date: Thu Oct 12 04:28:06 2023 +0000

ANDROID: fuse-bpf: Add NULL pointer check in fuse_entry_revalidate

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=177ee659e80000
start commit: ea586874d2f9 Merge 5.15.131 into android13-5.15-lts
git tree: android13-5.15-lts
If the result looks correct, please mark the issue as fixed by replying with:

#syz fix: ANDROID: fuse-bpf: Add NULL pointer check in fuse_entry_revalidate

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

Aleksandr Nogikh

unread,
Dec 19, 2023, 2:06:53 PM12/19/23
to syzbot, syzkaller-a...@googlegroups.com
#syz fix: ANDROID: fuse-bpf: Add NULL pointer check in fuse_entry_revalidate

> --
> You received this message because you are subscribed to the Google Groups "syzkaller-android-bugs" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to syzkaller-android...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/syzkaller-android-bugs/000000000000aa6f1b060cdcebb3%40google.com.
Reply all
Reply to author
Forward
0 new messages