==================================================================
BUG: KASAN: null-ptr-deref in atomic64_try_cmpxchg include/asm-generic/atomic-instrumented.h:1503 [inline]
BUG: KASAN: null-ptr-deref in atomic_long_try_cmpxchg_acquire include/asm-generic/atomic-long.h:442 [inline]
BUG: KASAN: null-ptr-deref in __down_write kernel/locking/rwsem.c:1424 [inline]
BUG: KASAN: null-ptr-deref in down_write+0x91/0x150 kernel/locking/rwsem.c:1583
Write of size 8 at addr 0000000000000030 by task syz-executor.0/26849
CPU: 0 PID: 26849 Comm: syz-executor.0 Not tainted 5.4.242-syzkaller-00013-gb0a9bcb910ac #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x1d8/0x241 lib/dump_stack.c:118
__kasan_report+0xe9/0x120 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+0x272/0x280 mm/kasan/generic.c:191
atomic64_try_cmpxchg include/asm-generic/atomic-instrumented.h:1503 [inline]
atomic_long_try_cmpxchg_acquire include/asm-generic/atomic-long.h:442 [inline]
__down_write kernel/locking/rwsem.c:1424 [inline]
down_write+0x91/0x150 kernel/locking/rwsem.c:1583
i_mmap_lock_write include/linux/fs.h:549 [inline]
unlink_file_vma+0x7c/0x1b0 mm/mmap.c:162
free_pgtables+0x135/0x280 mm/memory.c:427
exit_mmap+0x2cb/0x520 mm/mmap.c:3187
__mmput+0x8e/0x2c0 kernel/fork.c:1093
exit_mm kernel/exit.c:536 [inline]
do_exit+0xc08/0x2bc0 kernel/exit.c:846
do_group_exit+0x138/0x300 kernel/exit.c:982
get_signal+0xdb1/0x1440 kernel/signal.c:2735
do_signal+0xb0/0x11f0 arch/x86/kernel/signal.c:809
exit_to_usermode_loop+0xc0/0x1a0 arch/x86/entry/common.c:159
prepare_exit_to_usermode+0x199/0x200 arch/x86/entry/common.c:194
retint_user+0x8/0x8
==================================================================
BUG: kernel NULL pointer dereference, address: 0000000000000030
#PF: supervisor write access in kernel mode
#PF: error_code(0x0002) - not-present page
PGD 1ebb7e067 P4D 1ebb7e067 PUD 1dda2c067 PMD 0
Oops: 0002 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 26849 Comm: syz-executor.0 Tainted: G B 5.4.242-syzkaller-00013-gb0a9bcb910ac #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023
RIP: 0010:arch_atomic64_try_cmpxchg arch/x86/include/asm/atomic64_64.h:186 [inline]
RIP: 0010:atomic64_try_cmpxchg include/asm-generic/atomic-instrumented.h:1505 [inline]
RIP: 0010:atomic_long_try_cmpxchg_acquire include/asm-generic/atomic-long.h:442 [inline]
RIP: 0010:__down_write kernel/locking/rwsem.c:1424 [inline]
RIP: 0010:down_write+0xb7/0x150 kernel/locking/rwsem.c:1583
Code: bf 2d 44 fd 4c 89 ff be 08 00 00 00 e8 b2 2d 44 fd 43 80 3c 26 00 74 08 4c 89 ff e8 33 5a 44 fd 48 8b 44 24 20 b9 01 00 00 00 <f0> 48 0f b1 0b 75 61 48 83 c3 08 65 4c 8b 35 86 03 b3 7b 48 89 df
RSP: 0018:ffff8881c42c7780 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 0000000000000030 RCX: 0000000000000001
RDX: 0000000000000001 RSI: 0000000000000008 RDI: ffff8881c42c77a0
RBP: ffff8881c42c7808 R08: dffffc0000000000 R09: ffffed1038858ef5
R10: 0000000000000000 R11: dffffc0000000001 R12: dffffc0000000000
R13: 1ffff11038858ef0 R14: 1ffff11038858ef4 R15: ffff8881c42c77a0
FS: 0000000000000000(0000) GS:ffff8881f6f00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000030 CR3: 00000001f28ce000 CR4: 00000000003406a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
i_mmap_lock_write include/linux/fs.h:549 [inline]
unlink_file_vma+0x7c/0x1b0 mm/mmap.c:162
free_pgtables+0x135/0x280 mm/memory.c:427
exit_mmap+0x2cb/0x520 mm/mmap.c:3187
__mmput+0x8e/0x2c0 kernel/fork.c:1093
exit_mm kernel/exit.c:536 [inline]
do_exit+0xc08/0x2bc0 kernel/exit.c:846
do_group_exit+0x138/0x300 kernel/exit.c:982
get_signal+0xdb1/0x1440 kernel/signal.c:2735
do_signal+0xb0/0x11f0 arch/x86/kernel/signal.c:809
exit_to_usermode_loop+0xc0/0x1a0 arch/x86/entry/common.c:159
prepare_exit_to_usermode+0x199/0x200 arch/x86/entry/common.c:194
retint_user+0x8/0x8
Modules linked in:
CR2: 0000000000000030
---[ end trace 571cf42a69dd9623 ]---
RIP: 0010:arch_atomic64_try_cmpxchg arch/x86/include/asm/atomic64_64.h:186 [inline]
RIP: 0010:atomic64_try_cmpxchg include/asm-generic/atomic-instrumented.h:1505 [inline]
RIP: 0010:atomic_long_try_cmpxchg_acquire include/asm-generic/atomic-long.h:442 [inline]
RIP: 0010:__down_write kernel/locking/rwsem.c:1424 [inline]
RIP: 0010:down_write+0xb7/0x150 kernel/locking/rwsem.c:1583
Code: bf 2d 44 fd 4c 89 ff be 08 00 00 00 e8 b2 2d 44 fd 43 80 3c 26 00 74 08 4c 89 ff e8 33 5a 44 fd 48 8b 44 24 20 b9 01 00 00 00 <f0> 48 0f b1 0b 75 61 48 83 c3 08 65 4c 8b 35 86 03 b3 7b 48 89 df
RSP: 0018:ffff8881c42c7780 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 0000000000000030 RCX: 0000000000000001
RDX: 0000000000000001 RSI: 0000000000000008 RDI: ffff8881c42c77a0
RBP: ffff8881c42c7808 R08: dffffc0000000000 R09: ffffed1038858ef5
R10: 0000000000000000 R11: dffffc0000000001 R12: dffffc0000000000
R13: 1ffff11038858ef0 R14: 1ffff11038858ef4 R15: ffff8881c42c77a0
FS: 0000000000000000(0000) GS:ffff8881f6f00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000030 CR3: 00000001f28ce000 CR4: 00000000003406a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
0: bf 2d 44 fd 4c mov $0x4cfd442d,%edi
5: 89 ff mov %edi,%edi
7: be 08 00 00 00 mov $0x8,%esi
c: e8 b2 2d 44 fd callq 0xfd442dc3
11: 43 80 3c 26 00 cmpb $0x0,(%r14,%r12,1)
16: 74 08 je 0x20
18: 4c 89 ff mov %r15,%rdi
1b: e8 33 5a 44 fd callq 0xfd445a53
20: 48 8b 44 24 20 mov 0x20(%rsp),%rax
25: b9 01 00 00 00 mov $0x1,%ecx
* 2a: f0 48 0f b1 0b lock cmpxchg %rcx,(%rbx) <-- trapping instruction
2f: 75 61 jne 0x92
31: 48 83 c3 08 add $0x8,%rbx
35: 65 4c 8b 35 86 03 b3 mov %gs:0x7bb30386(%rip),%r14 # 0x7bb303c3
3c: 7b
3d: 48 89 df mov %rbx,%rdi