syzbot


WARNING in iommufd_access_destroy

Status: fixed on 2023/10/12 12:48
Subsystems: iommu
[Documentation on labels]
Reported-by: syzbot+7574ebfe589049630608@syzkaller.appspotmail.com
Fix commit: 99f98a7c0d69 iommufd: IOMMUFD_DESTROY should not increase the refcount
First crash: 323d, last: 317d
Cause bisection: introduced by (bisect log) :
commit 54b47585db6658a5eb898d4d45be18d1e581c1bf
Author: Nicolin Chen <nicolinc@nvidia.com>
Date: Mon Mar 27 09:33:47 2023 +0000

  iommufd: Create access in vfio_iommufd_emulated_bind()

Crash: WARNING in iommufd_access_destroy (log)
Repro: C syz .config
  
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [iommu?] WARNING in iommufd_access_destroy 0 (2) 2023/07/16 02:57

Sample crash report:
------------[ cut here ]------------
WARNING: CPU: 1 PID: 15379 at drivers/iommu/iommufd/device.c:462 iommufd_access_destroy+0x54/0x70 drivers/iommu/iommufd/device.c:462
Modules linked in:
CPU: 1 PID: 15379 Comm: syz-executor196 Not tainted 6.5.0-rc1-syzkaller-00248-gb6e6cc1f78c7 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/03/2023
RIP: 0010:iommufd_access_destroy+0x54/0x70 drivers/iommu/iommufd/device.c:462
Code: 31 48 8b bb a8 00 00 00 48 89 de e8 a6 f0 00 00 31 ff 89 c3 89 c6 e8 5b 27 e4 fc 84 db 74 06 5b e9 21 2c e4 fc e8 1c 2c e4 fc <0f> 0b 5b e9 14 2c e4 fc e8 cf 19 38 fd eb c8 66 66 2e 0f 1f 84 00
RSP: 0018:ffffc900040dfcc8 EFLAGS: 00010293
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: ffff888020010000 RSI: ffffffff84a242c4 RDI: 0000000000000001
RBP: ffff88802d225600 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000004
R13: ffff88802bbf8a00 R14: 00000000fffffffe R15: ffffc900040dfe10
FS:  00007f2bc10806c0(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fff037f89a8 CR3: 0000000022996000 CR4: 0000000000350ee0
Call Trace:
 <TASK>
 iommufd_test_create_access drivers/iommu/iommufd/selftest.c:743 [inline]
 iommufd_test+0x170f/0x2c70 drivers/iommu/iommufd/selftest.c:961
 iommufd_fops_ioctl+0x347/0x4d0 drivers/iommu/iommufd/main.c:337
 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:0x7f2bc10e03e9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 51 18 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:00007f2bc1080228 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f2bc10806c0 RCX: 00007f2bc10e03e9
RDX: 0000000020000080 RSI: 0000000000003ba0 RDI: 0000000000000003
RBP: 00007f2bc116a338 R08: 00007fff037f89c7 R09: 00007f2bc10806c0
R10: 0000000000000000 R11: 0000000000000246 R12: ffffffffffffffb0
R13: 00007f2bc116a330 R14: 6d6f692f7665642f R15: 00007fff037f89c8
 </TASK>

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/07/15 20:19 upstream b6e6cc1f78c7 35d9ecc5 .config strace log report syz C [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root WARNING in iommufd_access_destroy
2023/07/10 09:16 upstream 06c2afb862f9 668cb1fa .config console log report syz C [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING in iommufd_access_destroy
2023/07/10 08:00 upstream 06c2afb862f9 668cb1fa .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream WARNING in iommufd_access_destroy
* Struck through repros no longer work on HEAD.