general protection fault, probably for non-canonical address 0xdffffc0000000008: 0000 [#1] PREEMPT SMP KASAN KASAN: null-ptr-deref in range [0x0000000000000040-0x0000000000000047] CPU: 2 PID: 3844 Comm: syz-executor.1 Not tainted 5.18.0-syzkaller-13918-g44688ffd111a #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 RIP: 0010:aa_file_perm+0x183/0x1230 security/apparmor/file.c:612 Code: e8 b2 e0 b0 fd 45 84 e4 41 59 0f 84 7e 04 00 00 e8 a2 e4 b0 fd 49 8d 7e 40 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 3e 0f 00 00 4d 8b 66 40 e8 da e7 9a fd 31 ff 41 RSP: 0018:ffffc900029c7c38 EFLAGS: 00010202 RAX: dffffc0000000000 RBX: ffff888021a88780 RCX: 0000000000000000 RDX: 0000000000000008 RSI: ffffffff83c991ee RDI: 0000000000000040 RBP: 0000000000000000 R08: 0000000000000001 R09: ffffffff83c99199 R10: 0000000000000001 R11: 0000000000000001 R12: 0000000000000001 R13: ffff8880119bdab0 R14: 0000000000000000 R15: 000000000000001a FS: 0000000000000000(0000) GS:ffff88802ca00000(0063) knlGS:000000005695f380 CS: 0010 DS: 002b ES: 002b CR0: 0000000080050033 CR2: 00000000f7e97ae4 CR3: 0000000045756000 CR4: 0000000000150ee0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: common_file_perm security/apparmor/lsm.c:495 [inline] apparmor_file_permission+0x15e/0x4e0 security/apparmor/lsm.c:509 security_file_permission+0x4d/0xd0 security/security.c:1517 rw_verify_area+0xae/0x1b0 fs/read_write.c:385 vfs_write+0x163/0xac0 fs/read_write.c:582 ksys_write+0x1e8/0x250 fs/read_write.c:644 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x53/0x62 RIP: 0023:0xf7fce549 Code: 03 74 c0 01 10 05 03 74 b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 RSP: 002b:00000000ffd520b0 EFLAGS: 00000246 ORIG_RAX: 0000000000000004 RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00000000ffd5225c RDX: 000000000000001a RSI: 00000000f6f36000 RDI: 00000000ffd5225c RBP: 00000000f6f3bde0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:aa_file_perm+0x183/0x1230 security/apparmor/file.c:612 Code: e8 b2 e0 b0 fd 45 84 e4 41 59 0f 84 7e 04 00 00 e8 a2 e4 b0 fd 49 8d 7e 40 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 3e 0f 00 00 4d 8b 66 40 e8 da e7 9a fd 31 ff 41 RSP: 0018:ffffc900029c7c38 EFLAGS: 00010202 RAX: dffffc0000000000 RBX: ffff888021a88780 RCX: 0000000000000000 RDX: 0000000000000008 RSI: ffffffff83c991ee RDI: 0000000000000040 RBP: 0000000000000000 R08: 0000000000000001 R09: ffffffff83c99199 R10: 0000000000000001 R11: 0000000000000001 R12: 0000000000000001 R13: ffff8880119bdab0 R14: 0000000000000000 R15: 000000000000001a FS: 0000000000000000(0000) GS:ffff88802ca00000(0063) knlGS:000000005695f380 CS: 0010 DS: 002b ES: 002b CR0: 0000000080050033 CR2: 00000000f7e97ae4 CR3: 0000000045756000 CR4: 0000000000150ee0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 ---------------- Code disassembly (best guess): 0: e8 b2 e0 b0 fd callq 0xfdb0e0b7 5: 45 84 e4 test %r12b,%r12b 8: 41 59 pop %r9 a: 0f 84 7e 04 00 00 je 0x48e 10: e8 a2 e4 b0 fd callq 0xfdb0e4b7 15: 49 8d 7e 40 lea 0x40(%r14),%rdi 19: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax 20: fc ff df 23: 48 89 fa mov %rdi,%rdx 26: 48 c1 ea 03 shr $0x3,%rdx * 2a: 80 3c 02 00 cmpb $0x0,(%rdx,%rax,1) <-- trapping instruction 2e: 0f 85 3e 0f 00 00 jne 0xf72 34: 4d 8b 66 40 mov 0x40(%r14),%r12 38: e8 da e7 9a fd callq 0xfd9ae817 3d: 31 ff xor %edi,%edi 3f: 41 rex.B