general protection fault, probably for non-canonical address 0xdffffc0000000002: 0000 [#1] PREEMPT SMP KASAN KASAN: null-ptr-deref in range [0x0000000000000010-0x0000000000000017] CPU: 0 PID: 8867 Comm: syz-executor.2 Not tainted 5.17.0-rc7-syzkaller-00060-g92f90cc9fe0e #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 RIP: 0010:sg_alloc_append_table_from_pages+0x822/0xdb0 lib/scatterlist.c:525 Code: 0c 24 48 8b 4c 24 48 48 39 c8 48 0f 46 c8 89 f0 4c 8d 3c c7 48 89 4c 24 30 48 b9 00 00 00 00 00 fc ff df 4c 89 f8 48 c1 e8 03 <80> 3c 08 00 0f 85 24 05 00 00 4d 8b 3f 4c 89 e0 31 ff 83 e0 03 48 RSP: 0018:ffffc9002687fc00 EFLAGS: 00010202 RAX: 0000000000000002 RBX: 0000000000000001 RCX: dffffc0000000000 RDX: 0000000000040000 RSI: 0000000000000000 RDI: 0000000000000010 RBP: 00000000fffff000 R08: fffffffffffff000 R09: ffff88802013b280 R10: ffffffff83dcc001 R11: 0000000000000001 R12: 0000000000000002 R13: ffff88802013b280 R14: 0000000000000000 R15: 0000000000000010 FS: 0000000000000000(0000) GS:ffff88802ca00000(0063) knlGS:00000000f58edb40 CS: 0010 DS: 002b ES: 002b CR0: 0000000080050033 CR2: 0000000032421000 CR3: 00000000234e7000 CR4: 0000000000150ef0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: sg_alloc_table_from_pages_segment+0xc9/0x260 lib/scatterlist.c:573 sg_alloc_table_from_pages include/linux/scatterlist.h:348 [inline] get_sg_table.isra.0+0xbb/0x160 drivers/dma-buf/udmabuf.c:67 begin_cpu_udmabuf+0x130/0x1d0 drivers/dma-buf/udmabuf.c:126 dma_buf_begin_cpu_access+0xfd/0x1d0 drivers/dma-buf/dma-buf.c:1164 dma_buf_ioctl+0x259/0x2b0 drivers/dma-buf/dma-buf.c:363 compat_ptr_ioctl+0x67/0x90 fs/ioctl.c:910 __do_compat_sys_ioctl+0x1c7/0x290 fs/ioctl.c:972 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+0x4d/0x5c RIP: 0023:0xf6ef3549 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:00000000f58ed5cc EFLAGS: 00000296 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 0000000040086200 RDX: 00000000200000c0 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:sg_alloc_append_table_from_pages+0x822/0xdb0 lib/scatterlist.c:525 Code: 0c 24 48 8b 4c 24 48 48 39 c8 48 0f 46 c8 89 f0 4c 8d 3c c7 48 89 4c 24 30 48 b9 00 00 00 00 00 fc ff df 4c 89 f8 48 c1 e8 03 <80> 3c 08 00 0f 85 24 05 00 00 4d 8b 3f 4c 89 e0 31 ff 83 e0 03 48 RSP: 0018:ffffc9002687fc00 EFLAGS: 00010202 RAX: 0000000000000002 RBX: 0000000000000001 RCX: dffffc0000000000 RDX: 0000000000040000 RSI: 0000000000000000 RDI: 0000000000000010 RBP: 00000000fffff000 R08: fffffffffffff000 R09: ffff88802013b280 R10: ffffffff83dcc001 R11: 0000000000000001 R12: 0000000000000002 R13: ffff88802013b280 R14: 0000000000000000 R15: 0000000000000010 FS: 0000000000000000(0000) GS:ffff88802ca00000(0063) knlGS:00000000f58edb40 CS: 0010 DS: 002b ES: 002b CR0: 0000000080050033 CR2: 0000000032421000 CR3: 00000000234e7000 CR4: 0000000000150ef0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 ---------------- Code disassembly (best guess): 0: 0c 24 or $0x24,%al 2: 48 8b 4c 24 48 mov 0x48(%rsp),%rcx 7: 48 39 c8 cmp %rcx,%rax a: 48 0f 46 c8 cmovbe %rax,%rcx e: 89 f0 mov %esi,%eax 10: 4c 8d 3c c7 lea (%rdi,%rax,8),%r15 14: 48 89 4c 24 30 mov %rcx,0x30(%rsp) 19: 48 b9 00 00 00 00 00 movabs $0xdffffc0000000000,%rcx 20: fc ff df 23: 4c 89 f8 mov %r15,%rax 26: 48 c1 e8 03 shr $0x3,%rax * 2a: 80 3c 08 00 cmpb $0x0,(%rax,%rcx,1) <-- trapping instruction 2e: 0f 85 24 05 00 00 jne 0x558 34: 4d 8b 3f mov (%r15),%r15 37: 4c 89 e0 mov %r12,%rax 3a: 31 ff xor %edi,%edi 3c: 83 e0 03 and $0x3,%eax 3f: 48 rex.W