iommufd_mock iommufd_mock0: Removing from iommu group 0 general protection fault, probably for non-canonical address 0xdffffc0000000006: 0000 [#1] PREEMPT SMP KASAN KASAN: null-ptr-deref in range [0x0000000000000030-0x0000000000000037] CPU: 1 PID: 8581 Comm: syz-executor.1 Not tainted 6.5.0-rc5-next-20230809-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023 RIP: 0010:sysfs_remove_link_from_group+0x2b/0x80 fs/sysfs/group.c:413 Code: 0f 1e fa 41 54 49 89 d4 55 48 89 f5 53 48 89 fb e8 7a e5 71 ff 48 8d 7b 30 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> 3c 02 00 75 39 48 8b 7b 30 31 d2 48 89 ee e8 81 f2 fe ff 48 85 RSP: 0018:ffffc900154e7c50 EFLAGS: 00010206 RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000000 RDX: 0000000000000006 RSI: ffffffff8215e206 RDI: 0000000000000030 RBP: ffffffff8adb50a0 R08: 0000000000000001 R09: ffffed10028cef1b R10: ffff8880146778df R11: ffffffff8a40008b R12: ffff88807dd211e0 R13: ffffffff8d520140 R14: ffff888020878450 R15: ffff888020878448 FS: 000055555632c480(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007efc820c56be CR3: 00000000282c1000 CR4: 00000000003506e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: iommu_deinit_device+0x111/0x5a0 drivers/iommu/iommu.c:411 __iommu_group_remove_device+0x2e3/0x430 drivers/iommu/iommu.c:582 iommu_group_remove_device+0x91/0xb0 drivers/iommu/iommu.c:1193 mock_dev_destroy drivers/iommu/iommufd/selftest.c:396 [inline] iommufd_selftest_destroy+0xe2/0x180 drivers/iommu/iommufd/selftest.c:988 iommufd_fops_release+0x1b9/0x320 drivers/iommu/iommufd/main.c:268 __fput+0x3f7/0xac0 fs/file_table.c:384 task_work_run+0x14d/0x240 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x210/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline] syscall_exit_to_user_mode+0x1d/0x50 kernel/entry/common.c:297 do_syscall_64+0x44/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f40b627b9da Code: 48 3d 00 f0 ff ff 77 48 c3 0f 1f 80 00 00 00 00 48 83 ec 18 89 7c 24 0c e8 03 7f 02 00 8b 7c 24 0c 89 c2 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 36 89 d7 89 44 24 0c e8 63 7f 02 00 8b 44 24 RSP: 002b:00007ffc4010dda0 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000006 RCX: 00007f40b627b9da RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000005 RBP: 0000000000000032 R08: 0000001b31220000 R09: 00000000000000c6 R10: 0000000081738ed4 R11: 0000000000000293 R12: 00007f40b5e005a8 R13: ffffffffffffffff R14: 00007f40b5e00000 R15: 0000000000063f29 Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:sysfs_remove_link_from_group+0x2b/0x80 fs/sysfs/group.c:413 Code: 0f 1e fa 41 54 49 89 d4 55 48 89 f5 53 48 89 fb e8 7a e5 71 ff 48 8d 7b 30 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> 3c 02 00 75 39 48 8b 7b 30 31 d2 48 89 ee e8 81 f2 fe ff 48 85 RSP: 0018:ffffc900154e7c50 EFLAGS: 00010206 RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000000 RDX: 0000000000000006 RSI: ffffffff8215e206 RDI: 0000000000000030 RBP: ffffffff8adb50a0 R08: 0000000000000001 R09: ffffed10028cef1b R10: ffff8880146778df R11: ffffffff8a40008b R12: ffff88807dd211e0 R13: ffffffff8d520140 R14: ffff888020878450 R15: ffff888020878448 FS: 000055555632c480(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f26b0557000 CR3: 00000000282c1000 CR4: 00000000003506e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 ---------------- Code disassembly (best guess): 0: 0f 1e fa nop %edx 3: 41 54 push %r12 5: 49 89 d4 mov %rdx,%r12 8: 55 push %rbp 9: 48 89 f5 mov %rsi,%rbp c: 53 push %rbx d: 48 89 fb mov %rdi,%rbx 10: e8 7a e5 71 ff call 0xff71e58f 15: 48 8d 7b 30 lea 0x30(%rbx),%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: 75 39 jne 0x69 30: 48 8b 7b 30 mov 0x30(%rbx),%rdi 34: 31 d2 xor %edx,%edx 36: 48 89 ee mov %rbp,%rsi 39: e8 81 f2 fe ff call 0xfffef2bf 3e: 48 rex.W 3f: 85 .byte 0x85