================================================================== BUG: KASAN: null-ptr-deref in instrument_atomic_read include/linux/instrumented.h:71 [inline] BUG: KASAN: null-ptr-deref in atomic64_read include/linux/atomic/atomic-instrumented.h:605 [inline] BUG: KASAN: null-ptr-deref in flush_tlb_func+0x43/0x550 arch/x86/mm/tlb.c:736 Read of size 8 at addr 0000000000000329 by task syz-executor.0/11752 CPU: 1 PID: 11752 Comm: syz-executor.0 Tainted: G W 5.15.149-syzkaller-00490-g5d96939590c0 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Call Trace: __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] atomic64_read include/linux/atomic/atomic-instrumented.h:605 [inline] flush_tlb_func+0x43/0x550 arch/x86/mm/tlb.c:736 flush_smp_call_function_queue+0x222/0x6a0 kernel/smp.c:628 generic_smp_call_function_single_interrupt+0x13/0x20 kernel/smp.c:544 __sysvec_call_function_single+0x63/0x1b0 arch/x86/kernel/smp.c:248 sysvec_call_function_single+0x41/0xb0 arch/x86/kernel/smp.c:243 asm_sysvec_call_function_single+0x1b/0x20 arch/x86/include/asm/idtentry.h:646 RIP: 0010:find_stack lib/stackdepot.c:207 [inline] RIP: 0010:__stack_depot_save+0x167/0x470 lib/stackdepot.c:304 Code: de eb 03 44 89 ff 48 8b 05 8e b9 ab 04 44 89 f1 81 e1 ff 0f 00 00 48 89 45 b0 48 89 4d b8 4c 8b 24 c8 4c 89 cb 41 89 df eb 04 <4d> 8b 24 24 4d 85 e4 74 2d 45 39 74 24 08 75 f0 41 39 5c 24 0c 75 RSP: 0018:ffffc900001d0858 EFLAGS: 00000a87 RAX: ffff88823fe80000 RBX: 000000000000000c RCX: 000000000000052e RDX: ffffc900001d0914 RSI: 0000000000000001 RDI: 0000000000000800 RBP: ffffc900001d08b0 R08: 0000000000000003 R09: 000000000000000c R10: ffffc900001d0830 R11: dffffc0000000001 R12: ffff88812ae33180 R13: ffffc900001d08c0 R14: 00000000b813452e R15: 000000000000000c kasan_save_stack mm/kasan/common.c:39 [inline] kasan_set_track+0x5d/0x70 mm/kasan/common.c:45 kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0x126/0x160 mm/kasan/common.c:365 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:373 kasan_slab_free include/linux/kasan.h:193 [inline] slab_free_hook mm/slub.c:1723 [inline] slab_free_freelist_hook+0xbd/0x190 mm/slub.c:1749 slab_free mm/slub.c:3519 [inline] kmem_cache_free+0x116/0x2e0 mm/slub.c:3535 shmem_free_in_core_inode+0x8f/0xc0 mm/shmem.c:3803 i_callback+0x4b/0x70 fs/inode.c:225 rcu_do_batch+0x57a/0xc10 kernel/rcu/tree.c:2523 rcu_core+0x517/0x1020 kernel/rcu/tree.c:2763 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2776 __do_softirq+0x26d/0x5bf kernel/softirq.c:565 do_softirq+0xf6/0x150 kernel/softirq.c:452 __local_bh_enable_ip+0x75/0x80 kernel/softirq.c:379 __raw_spin_unlock_bh include/linux/spinlock_api_smp.h:176 [inline] _raw_spin_unlock_bh+0x51/0x60 kernel/locking/spinlock.c:210 __sock_map_delete net/core/sock_map.c:426 [inline] sock_map_delete_elem+0xcb/0x130 net/core/sock_map.c:448 bpf_prog_029d1888f6cd2729+0x3f/0x478 bpf_dispatcher_nop_func include/linux/bpf.h:785 [inline] __bpf_prog_run include/linux/filter.h:625 [inline] bpf_prog_run include/linux/filter.h:632 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:1883 [inline] bpf_trace_run2+0xec/0x210 kernel/trace/bpf_trace.c:1920 __bpf_trace_tlb_flush+0x23/0x30 include/trace/events/tlb.h:38 trace_tlb_flush include/trace/events/tlb.h:38 [inline] switch_mm_irqs_off+0x616/0x9b0 arch/x86/mm/tlb.c:629 context_switch kernel/sched/core.c:5137 [inline] __schedule+0xb2b/0x1590 kernel/sched/core.c:6512 preempt_schedule_irq+0xc7/0x140 kernel/sched/core.c:6916 irqentry_exit_cond_resched+0x2a/0x30 kernel/entry/common.c:392 irqentry_exit+0x30/0x40 kernel/entry/common.c:426 sysvec_apic_timer_interrupt+0x55/0xc0 arch/x86/kernel/apic/apic.c:1096 asm_sysvec_apic_timer_interrupt+0x1b/0x20 arch/x86/include/asm/idtentry.h:638 RIP: 0010:memcmp lib/string.c:944 [inline] RIP: 0010:bcmp+0x75/0x200 lib/string.c:976 Code: c1 e8 03 0f b6 04 10 84 c0 0f 85 83 00 00 00 49 8b 34 24 49 8d 7d 07 4c 89 e8 48 c1 e8 03 0f b6 04 10 84 c0 0f 85 8e 00 00 00 <48> 89 f8 48 c1 e8 03 0f b6 04 10 84 c0 0f 85 b5 00 00 00 49 3b 37 RSP: 0018:ffffc90000e470f8 EFLAGS: 00000246 RAX: 0000000000000000 RBX: ffff88812717b008 RCX: dffffc0000000000 RDX: dffffc0000000000 RSI: 0000000000000000 RDI: ffff88811033900f RBP: ffffc90000e47130 R08: ffffffff8183359b R09: ffffffff8183e737 R10: 0000000000000002 R11: ffff888115f40000 R12: ffff88812717b008 R13: ffff888110339008 R14: 0000000000000058 R15: ffff888110339008 states_maybe_looping kernel/bpf/verifier.c:10834 [inline] is_state_visited kernel/bpf/verifier.c:10894 [inline] do_check+0x1b14/0xf2c0 kernel/bpf/verifier.c:11133 do_check_common+0x909/0x1290 kernel/bpf/verifier.c:13408 do_check_main kernel/bpf/verifier.c:13471 [inline] bpf_check+0x3835/0x12bf0 kernel/bpf/verifier.c:14042 bpf_prog_load+0x12ac/0x1b50 kernel/bpf/syscall.c:2333 __sys_bpf+0x4bc/0x760 kernel/bpf/syscall.c:4633 __do_sys_bpf kernel/bpf/syscall.c:4737 [inline] __se_sys_bpf kernel/bpf/syscall.c:4735 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:4735 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:0x7f45d1113ca9 Code: Unable to access opcode bytes at RIP 0x7f45d1113c7f. RSP: 002b:00007f45cfe870c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 00007f45d1241f80 RCX: 00007f45d1113ca9 RDX: 0000000000000023 RSI: 0000000020000300 RDI: 0000000000000005 RBP: 00007f45d115f47e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f45d1241f80 R15: 00007ffdb7ba2668 ================================================================== general protection fault, probably for non-canonical address 0xdffffc0000000065: 0000 [#1] PREEMPT SMP KASAN KASAN: null-ptr-deref in range [0x0000000000000328-0x000000000000032f] CPU: 1 PID: 11752 Comm: syz-executor.0 Tainted: G B W 5.15.149-syzkaller-00490-g5d96939590c0 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 RIP: 0010:arch_atomic64_read arch/x86/include/asm/atomic64_64.h:22 [inline] RIP: 0010:atomic64_read include/linux/atomic/atomic-instrumented.h:606 [inline] RIP: 0010:flush_tlb_func+0x4a/0x550 arch/x86/mm/tlb.c:736 Code: 8b 35 fa 8a cd 7e 65 66 44 8b 25 01 8b cd 7e 49 8d 9e 28 03 00 00 48 89 df be 08 00 00 00 e8 ed 70 7c 00 48 89 d8 48 c1 e8 03 <42> 80 3c 38 00 74 08 48 89 df e8 f7 6e 7c 00 4c 8b 3b 66 44 89 65 RSP: 0018:ffffc900001d0680 EFLAGS: 00010006 RAX: 0000000000000065 RBX: 0000000000000329 RCX: ffff888115f40000 RDX: 0000000080010104 RSI: 0000000000000096 RDI: 00000000ffffffff RBP: ffffc900001d06f0 R08: ffffffff81416f3b R09: 0000000000000003 R10: fffffbfff0e5244c R11: dffffc0000000001 R12: 1ffff1103ee20000 R13: ffff8881f7036580 R14: 0000000000000001 R15: dffffc0000000000 FS: 00007f45cfe876c0(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000020cc7000 CR3: 0000000127318000 CR4: 00000000003506a0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: flush_smp_call_function_queue+0x222/0x6a0 kernel/smp.c:628 generic_smp_call_function_single_interrupt+0x13/0x20 kernel/smp.c:544 __sysvec_call_function_single+0x63/0x1b0 arch/x86/kernel/smp.c:248 sysvec_call_function_single+0x41/0xb0 arch/x86/kernel/smp.c:243 asm_sysvec_call_function_single+0x1b/0x20 arch/x86/include/asm/idtentry.h:646 RIP: 0010:find_stack lib/stackdepot.c:207 [inline] RIP: 0010:__stack_depot_save+0x167/0x470 lib/stackdepot.c:304 Code: de eb 03 44 89 ff 48 8b 05 8e b9 ab 04 44 89 f1 81 e1 ff 0f 00 00 48 89 45 b0 48 89 4d b8 4c 8b 24 c8 4c 89 cb 41 89 df eb 04 <4d> 8b 24 24 4d 85 e4 74 2d 45 39 74 24 08 75 f0 41 39 5c 24 0c 75 RSP: 0018:ffffc900001d0858 EFLAGS: 00000a87 RAX: ffff88823fe80000 RBX: 000000000000000c RCX: 000000000000052e RDX: ffffc900001d0914 RSI: 0000000000000001 RDI: 0000000000000800 RBP: ffffc900001d08b0 R08: 0000000000000003 R09: 000000000000000c R10: ffffc900001d0830 R11: dffffc0000000001 R12: ffff88812ae33180 R13: ffffc900001d08c0 R14: 00000000b813452e R15: 000000000000000c kasan_save_stack mm/kasan/common.c:39 [inline] kasan_set_track+0x5d/0x70 mm/kasan/common.c:45 kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0x126/0x160 mm/kasan/common.c:365 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:373 kasan_slab_free include/linux/kasan.h:193 [inline] slab_free_hook mm/slub.c:1723 [inline] slab_free_freelist_hook+0xbd/0x190 mm/slub.c:1749 slab_free mm/slub.c:3519 [inline] kmem_cache_free+0x116/0x2e0 mm/slub.c:3535 shmem_free_in_core_inode+0x8f/0xc0 mm/shmem.c:3803 i_callback+0x4b/0x70 fs/inode.c:225 rcu_do_batch+0x57a/0xc10 kernel/rcu/tree.c:2523 rcu_core+0x517/0x1020 kernel/rcu/tree.c:2763 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2776 __do_softirq+0x26d/0x5bf kernel/softirq.c:565 do_softirq+0xf6/0x150 kernel/softirq.c:452 __local_bh_enable_ip+0x75/0x80 kernel/softirq.c:379 __raw_spin_unlock_bh include/linux/spinlock_api_smp.h:176 [inline] _raw_spin_unlock_bh+0x51/0x60 kernel/locking/spinlock.c:210 __sock_map_delete net/core/sock_map.c:426 [inline] sock_map_delete_elem+0xcb/0x130 net/core/sock_map.c:448 bpf_prog_029d1888f6cd2729+0x3f/0x478 bpf_dispatcher_nop_func include/linux/bpf.h:785 [inline] __bpf_prog_run include/linux/filter.h:625 [inline] bpf_prog_run include/linux/filter.h:632 [inline] __bpf_trace_run kernel/trace/bpf_trace.c:1883 [inline] bpf_trace_run2+0xec/0x210 kernel/trace/bpf_trace.c:1920 __bpf_trace_tlb_flush+0x23/0x30 include/trace/events/tlb.h:38 trace_tlb_flush include/trace/events/tlb.h:38 [inline] switch_mm_irqs_off+0x616/0x9b0 arch/x86/mm/tlb.c:629 context_switch kernel/sched/core.c:5137 [inline] __schedule+0xb2b/0x1590 kernel/sched/core.c:6512 preempt_schedule_irq+0xc7/0x140 kernel/sched/core.c:6916 irqentry_exit_cond_resched+0x2a/0x30 kernel/entry/common.c:392 irqentry_exit+0x30/0x40 kernel/entry/common.c:426 sysvec_apic_timer_interrupt+0x55/0xc0 arch/x86/kernel/apic/apic.c:1096 asm_sysvec_apic_timer_interrupt+0x1b/0x20 arch/x86/include/asm/idtentry.h:638 RIP: 0010:memcmp lib/string.c:944 [inline] RIP: 0010:bcmp+0x75/0x200 lib/string.c:976 Code: c1 e8 03 0f b6 04 10 84 c0 0f 85 83 00 00 00 49 8b 34 24 49 8d 7d 07 4c 89 e8 48 c1 e8 03 0f b6 04 10 84 c0 0f 85 8e 00 00 00 <48> 89 f8 48 c1 e8 03 0f b6 04 10 84 c0 0f 85 b5 00 00 00 49 3b 37 RSP: 0018:ffffc90000e470f8 EFLAGS: 00000246 RAX: 0000000000000000 RBX: ffff88812717b008 RCX: dffffc0000000000 RDX: dffffc0000000000 RSI: 0000000000000000 RDI: ffff88811033900f RBP: ffffc90000e47130 R08: ffffffff8183359b R09: ffffffff8183e737 R10: 0000000000000002 R11: ffff888115f40000 R12: ffff88812717b008 R13: ffff888110339008 R14: 0000000000000058 R15: ffff888110339008 states_maybe_looping kernel/bpf/verifier.c:10834 [inline] is_state_visited kernel/bpf/verifier.c:10894 [inline] do_check+0x1b14/0xf2c0 kernel/bpf/verifier.c:11133 do_check_common+0x909/0x1290 kernel/bpf/verifier.c:13408 do_check_main kernel/bpf/verifier.c:13471 [inline] bpf_check+0x3835/0x12bf0 kernel/bpf/verifier.c:14042 bpf_prog_load+0x12ac/0x1b50 kernel/bpf/syscall.c:2333 __sys_bpf+0x4bc/0x760 kernel/bpf/syscall.c:4633 __do_sys_bpf kernel/bpf/syscall.c:4737 [inline] __se_sys_bpf kernel/bpf/syscall.c:4735 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:4735 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:0x7f45d1113ca9 Code: Unable to access opcode bytes at RIP 0x7f45d1113c7f. RSP: 002b:00007f45cfe870c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 00007f45d1241f80 RCX: 00007f45d1113ca9 RDX: 0000000000000023 RSI: 0000000020000300 RDI: 0000000000000005 RBP: 00007f45d115f47e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f45d1241f80 R15: 00007ffdb7ba2668 Modules linked in: ---[ end trace caf5823c244b07ec ]--- RIP: 0010:arch_atomic64_read arch/x86/include/asm/atomic64_64.h:22 [inline] RIP: 0010:atomic64_read include/linux/atomic/atomic-instrumented.h:606 [inline] RIP: 0010:flush_tlb_func+0x4a/0x550 arch/x86/mm/tlb.c:736 Code: 8b 35 fa 8a cd 7e 65 66 44 8b 25 01 8b cd 7e 49 8d 9e 28 03 00 00 48 89 df be 08 00 00 00 e8 ed 70 7c 00 48 89 d8 48 c1 e8 03 <42> 80 3c 38 00 74 08 48 89 df e8 f7 6e 7c 00 4c 8b 3b 66 44 89 65 RSP: 0018:ffffc900001d0680 EFLAGS: 00010006 RAX: 0000000000000065 RBX: 0000000000000329 RCX: ffff888115f40000 RDX: 0000000080010104 RSI: 0000000000000096 RDI: 00000000ffffffff RBP: ffffc900001d06f0 R08: ffffffff81416f3b R09: 0000000000000003 R10: fffffbfff0e5244c R11: dffffc0000000001 R12: 1ffff1103ee20000 R13: ffff8881f7036580 R14: 0000000000000001 R15: dffffc0000000000 FS: 00007f45cfe876c0(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000020cc7000 CR3: 0000000127318000 CR4: 00000000003506a0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 ---------------- Code disassembly (best guess): 0: de eb fsubrp %st,%st(3) 2: 03 44 89 ff add -0x1(%rcx,%rcx,4),%eax 6: 48 8b 05 8e b9 ab 04 mov 0x4abb98e(%rip),%rax # 0x4abb99b d: 44 89 f1 mov %r14d,%ecx 10: 81 e1 ff 0f 00 00 and $0xfff,%ecx 16: 48 89 45 b0 mov %rax,-0x50(%rbp) 1a: 48 89 4d b8 mov %rcx,-0x48(%rbp) 1e: 4c 8b 24 c8 mov (%rax,%rcx,8),%r12 22: 4c 89 cb mov %r9,%rbx 25: 41 89 df mov %ebx,%r15d 28: eb 04 jmp 0x2e * 2a: 4d 8b 24 24 mov (%r12),%r12 <-- trapping instruction 2e: 4d 85 e4 test %r12,%r12 31: 74 2d je 0x60 33: 45 39 74 24 08 cmp %r14d,0x8(%r12) 38: 75 f0 jne 0x2a 3a: 41 39 5c 24 0c cmp %ebx,0xc(%r12) 3f: 75 .byte 0x75