iommufd_mock iommufd_mock0: Adding to iommu group 0 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: 24791 Comm: syz-executor.3 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:ffffc90003577c10 EFLAGS: 00010206 RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffc90004c69000 RDX: 0000000000000006 RSI: ffffffff8215e206 RDI: 0000000000000030 RBP: ffffffff8adb50a0 R08: 0000000000000001 R09: ffffed10028cef1b R10: ffff8880146778df R11: ffffffff8a3a0118 R12: ffff88801fbe4b20 R13: ffffffff8d520140 R14: ffff88807a6d3450 R15: ffff88807a6d3448 FS: 00007fab1a28e6c0(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ff7808ffac2 CR3: 0000000053c20000 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_test_mock_domain drivers/iommu/iommufd/selftest.c:453 [inline] iommufd_test+0x1f6f/0x30b0 drivers/iommu/iommufd/selftest.c:1003 iommufd_fops_ioctl+0x347/0x4d0 drivers/iommu/iommufd/main.c:395 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __x64_sys_ioctl+0x18f/0x210 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fab1947cae9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fab1a28e0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007fab1959bf80 RCX: 00007fab1947cae9 RDX: 00000000200000c0 RSI: 0000000000003ba0 RDI: 0000000000000003 RBP: 00007fab194c847a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fab1959bf80 R15: 00007ffee7906e28 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:ffffc90003577c10 EFLAGS: 00010206 RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffc90004c69000 RDX: 0000000000000006 RSI: ffffffff8215e206 RDI: 0000000000000030 RBP: ffffffff8adb50a0 R08: 0000000000000001 R09: ffffed10028cef1b R10: ffff8880146778df R11: ffffffff8a3a0118 R12: ffff88801fbe4b20 R13: ffffffff8d520140 R14: ffff88807a6d3450 R15: ffff88807a6d3448 FS: 00007fab1a28e6c0(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ff780975198 CR3: 0000000053c20000 CR4: 00000000003506f0 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