ci starts bisection 2023-03-31 15:47:26.689556221 +0000 UTC m=+184987.135904202 bisecting cause commit starting from 4b0f4525dc4fe8af17b3daefe585f0c2eb0fe0a5 building syzkaller on f325deb023e4e2fb9197004be1b3da738680429c ensuring issue is reproducible on original commit 4b0f4525dc4fe8af17b3daefe585f0c2eb0fe0a5 testing commit 4b0f4525dc4fe8af17b3daefe585f0c2eb0fe0a5 gcc compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: bbf97b72c43552d94c207384d5fa6aa84b6c6e1c3d29a6dbbd12e7497ab8827e all runs: crashed: WARNING in iommufd_hw_pagetable_detach testing release v6.2 testing commit c9c3395d5e3dcc6daee66c6908354d47bf98cb0c gcc compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: c260e04ab8cabe07104c8f99ee31749c075017c32da063f96a6eb10c1427386e all runs: OK # git bisect start 4b0f4525dc4fe8af17b3daefe585f0c2eb0fe0a5 c9c3395d5e3dcc6daee66c6908354d47bf98cb0c Bisecting: 11543 revisions left to test after this (roughly 14 steps) [84cc6674b76ba2cdac0df8037b4d8a22a6fc1b77] Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost testing commit 84cc6674b76ba2cdac0df8037b4d8a22a6fc1b77 gcc compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: bd7696e51bf1e5195cafd9b1e473de58e3d6f5ba5675ef5d7fe4f3cbcdd5fc52 all runs: OK # git bisect good 84cc6674b76ba2cdac0df8037b4d8a22a6fc1b77 Bisecting: 5737 revisions left to test after this (roughly 13 steps) [3703dcdc5791ba3fab61f29fde775f9ae9af5d1d] Merge branch 'master' of git://linuxtv.org/mchehab/media-next.git testing commit 3703dcdc5791ba3fab61f29fde775f9ae9af5d1d gcc compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 59325ba76a0cf23498bd1129c6bbe10d6ea8b9d62b18eaf4005cbb3e6888b5b3 all runs: OK # git bisect good 3703dcdc5791ba3fab61f29fde775f9ae9af5d1d Bisecting: 3077 revisions left to test after this (roughly 12 steps) [0b0bf95063e2234bdcc7e45421617f46ec0d0a32] Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git testing commit 0b0bf95063e2234bdcc7e45421617f46ec0d0a32 gcc compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 09d407549917714cfb6e6e2dcb420dcd9f52feb1f7b637ab5642cbc8b9fc7fa9 all runs: OK # git bisect good 0b0bf95063e2234bdcc7e45421617f46ec0d0a32 Bisecting: 1507 revisions left to test after this (roughly 11 steps) [8f5cd9ea665acea4a60fc4932eb2c600f7d5c15b] Merge branch 'next' of https://github.com/kvm-x86/linux.git testing commit 8f5cd9ea665acea4a60fc4932eb2c600f7d5c15b gcc compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: ba09c2b5209dd5c1e83b28ebdb519dc2db1f045785ec887e7a9f44336fdb13e8 all runs: OK # git bisect good 8f5cd9ea665acea4a60fc4932eb2c600f7d5c15b Bisecting: 718 revisions left to test after this (roughly 10 steps) [976ade8d5d218ccabb6ebafb596d2f7d5d62c192] Merge branch 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git testing commit 976ade8d5d218ccabb6ebafb596d2f7d5d62c192 gcc compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: c5231bcc5c7f4cd42b001d1e7675366364c1e813f5e5c67142ed4b16150dbcb4 all runs: OK # git bisect good 976ade8d5d218ccabb6ebafb596d2f7d5d62c192 Bisecting: 377 revisions left to test after this (roughly 9 steps) [4c29e56cef0db117d794a0806db8b95ff7cf4085] Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-gpio-intel.git testing commit 4c29e56cef0db117d794a0806db8b95ff7cf4085 gcc compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 76f4fd8b831efe46afcaad27bb62be6bb90bb169744362e868e91b521ad35979 all runs: OK # git bisect good 4c29e56cef0db117d794a0806db8b95ff7cf4085 Bisecting: 203 revisions left to test after this (roughly 8 steps) [369b3783cba7766ca413534565fbce4c3ed58473] Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching testing commit 369b3783cba7766ca413534565fbce4c3ed58473 gcc compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 46f5f47f92d3216936f49d6b7684c55cdc8fb5c4a48e82345c6860439703b51c all runs: OK # git bisect good 369b3783cba7766ca413534565fbce4c3ed58473 Bisecting: 100 revisions left to test after this (roughly 7 steps) [52a7e38da26e739e062bcf9b7d6dbbe3e3ccab4c] Merge branch 'mhi-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mani/mhi.git testing commit 52a7e38da26e739e062bcf9b7d6dbbe3e3ccab4c gcc compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: d862e3b4d2c8fa4d26ecca2d1e3f785f8492be6838f9ad0e4ea1e40ff44f08b1 all runs: OK # git bisect good 52a7e38da26e739e062bcf9b7d6dbbe3e3ccab4c Bisecting: 49 revisions left to test after this (roughly 6 steps) [7ea34fa251baf1ce34c5d9c5cbb8dc4d1dcf07ae] Merge branch 'sysctl-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git testing commit 7ea34fa251baf1ce34c5d9c5cbb8dc4d1dcf07ae gcc compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 0214341f8d17b308d23709421181a9deb3312395d92cd9ffa5ad981b87c125df all runs: OK # git bisect good 7ea34fa251baf1ce34c5d9c5cbb8dc4d1dcf07ae Bisecting: 24 revisions left to test after this (roughly 5 steps) [e8b57a50334c1c0fc5a45028bbd687b438992ce4] iommufd: Add iommufd_device_replace() testing commit e8b57a50334c1c0fc5a45028bbd687b438992ce4 gcc compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 57386c8e9ca8818f965efca04c5381248e70d7e9dc1f38b3e3ca80eb1daa2cc4 all runs: crashed: WARNING in iommufd_hw_pagetable_detach # git bisect bad e8b57a50334c1c0fc5a45028bbd687b438992ce4 Bisecting: 12 revisions left to test after this (roughly 4 steps) [4ed4791afb34c61650b17407846174a72e4034f4] iommufd/selftest: Add a selftest for iommufd_device_attach() with a hwpt argument testing commit 4ed4791afb34c61650b17407846174a72e4034f4 gcc compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: d39736e44d0c4eac423db558b502d6397a2f1f86f5c2d030ed89e87482ace467 all runs: OK # git bisect good 4ed4791afb34c61650b17407846174a72e4034f4 Bisecting: 6 revisions left to test after this (roughly 3 steps) [b2a05887f933dcb92347264dddac70b7f5e675f5] iommufd: Keep track of each device's reserved regions instead of groups testing commit b2a05887f933dcb92347264dddac70b7f5e675f5 gcc compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 8982c7f5b6b5ae82cbd1dc4718c6c984b6d82582d712dd202805df6895e3906d all runs: crashed: WARNING in iommufd_hw_pagetable_detach # git bisect bad b2a05887f933dcb92347264dddac70b7f5e675f5 Bisecting: 2 revisions left to test after this (roughly 2 steps) [de21a761b2e66558ada5bbfb76bc7ed82a884c03] iommufd: Add iommufd_group testing commit de21a761b2e66558ada5bbfb76bc7ed82a884c03 gcc compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 5a5ebf6abeefb78e230d7c9c455b6b94432e1ddf78949f397e89a6a73bced514 all runs: OK # git bisect good de21a761b2e66558ada5bbfb76bc7ed82a884c03 Bisecting: 0 revisions left to test after this (roughly 1 step) [2cf7ebf03fc20676f53bfaba577bc61e7a9fa004] iommu: Export iommu_get_resv_regions() testing commit 2cf7ebf03fc20676f53bfaba577bc61e7a9fa004 gcc compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: dd5d2d244163fba61644325d02f21fc987ed88067d456213258f1d9ab161667d all runs: crashed: WARNING in iommufd_hw_pagetable_detach # git bisect bad 2cf7ebf03fc20676f53bfaba577bc61e7a9fa004 Bisecting: 0 revisions left to test after this (roughly 0 steps) [9d05029acd4e4c0a85e412bf955dfc5526b9a6c1] iommufd: Replace the hwpt->devices list with iommufd_group testing commit 9d05029acd4e4c0a85e412bf955dfc5526b9a6c1 gcc compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2 kernel signature: 52a73dd03dc370e15eb1e56d3236e2ceeb1e96cea25a31f50d2f28e02a2a3d98 all runs: crashed: WARNING in iommufd_hw_pagetable_detach # git bisect bad 9d05029acd4e4c0a85e412bf955dfc5526b9a6c1 9d05029acd4e4c0a85e412bf955dfc5526b9a6c1 is the first bad commit commit 9d05029acd4e4c0a85e412bf955dfc5526b9a6c1 Author: Jason Gunthorpe Date: Mon Mar 27 15:37:57 2023 -0300 iommufd: Replace the hwpt->devices list with iommufd_group The devices list was used as a simple way to avoid having per-group information. Now that this seems to be unavoidable, just commit to per-group information fully and remove the devices list from the HWPT. The iommufd_group stores the currently assigned HWPT for the entire group and we can manage the per-device attach/detach with a list in the iommufd_group. For destruction the flow is organized to make the following patches easier, the actual call to iommufd_object_destroy_user() is done at the top of the call chain without holding any locks. The HWPT to be destroyed is returned out from the locked region to make this possible. Later patches create locking that requires this. Link: https://lore.kernel.org/r/3-v4-9cd79ad52ee8+13f5-iommufd_alloc_jgg@nvidia.com Reviewed-by: Lu Baolu Reviewed-by: Kevin Tian Tested-by: Nicolin Chen Signed-off-by: Jason Gunthorpe drivers/iommu/iommufd/device.c | 102 +++++++++++++++----------------- drivers/iommu/iommufd/hw_pagetable.c | 25 ++------ drivers/iommu/iommufd/iommufd_private.h | 13 ++-- 3 files changed, 59 insertions(+), 81 deletions(-) culprit signature: 52a73dd03dc370e15eb1e56d3236e2ceeb1e96cea25a31f50d2f28e02a2a3d98 parent signature: 5a5ebf6abeefb78e230d7c9c455b6b94432e1ddf78949f397e89a6a73bced514 revisions tested: 17, total time: 5h1m51.80506936s (build: 2h55m35.97145936s, test: 2h2m43.058635196s) first bad commit: 9d05029acd4e4c0a85e412bf955dfc5526b9a6c1 iommufd: Replace the hwpt->devices list with iommufd_group recipients (to): ["baolu.lu@linux.intel.com" "jgg@nvidia.com" "kevin.tian@intel.com" "nicolinc@nvidia.com"] recipients (cc): [] crash: WARNING in iommufd_hw_pagetable_detach iommufd_mock iommufd_mock0: Adding to iommu group 0 ------------[ cut here ]------------ WARNING: CPU: 1 PID: 5630 at drivers/iommu/iommufd/device.c:355 iommufd_hw_pagetable_detach+0x281/0x430 drivers/iommu/iommufd/device.c:355 Modules linked in: CPU: 1 PID: 5630 Comm: syz-executor.0 Not tainted 6.3.0-rc1-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023 RIP: 0010:iommufd_hw_pagetable_detach+0x281/0x430 drivers/iommu/iommufd/device.c:355 Code: 00 00 4c 89 e0 48 83 c4 08 5b 5d 41 5c 41 5d 41 5e 41 5f c3 49 8d 7d 70 be ff ff ff ff e8 97 c7 fe 04 85 c0 0f 85 22 fe ff ff <0f> 0b e9 1b fe ff ff 49 8d bd a0 00 00 00 48 b8 00 00 00 00 00 fc RSP: 0018:ffffc90004b07ba0 EFLAGS: 00010246 RAX: 0000000000000000 RBX: ffff888027bca800 RCX: 0000000000000001 RDX: 0000000000000000 RSI: ffffffff896ba2e0 RDI: ffffffff89c2d020 RBP: ffff888027bca8b0 R08: 0000000000000001 R09: ffff8880779570af R10: ffffed100ef2ae15 R11: 0000000000000000 R12: ffff888027bcaa00 R13: ffff88801b92ee00 R14: ffffffffffffff9e R15: ffff888027bcaaa8 FS: 00007f10ce3d0700(0000) GS:ffff8880b9b00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f10cd6df2c0 CR3: 0000000071a36000 CR4: 00000000003506e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: iommufd_hw_pagetable_alloc+0x3b9/0x4f0 drivers/iommu/iommufd/hw_pagetable.c:86 iommufd_device_auto_get_domain drivers/iommu/iommufd/device.c:404 [inline] iommufd_device_attach+0x45b/0x660 drivers/iommu/iommufd/device.c:455 iommufd_test_mock_domain drivers/iommu/iommufd/selftest.c:439 [inline] iommufd_test+0x76a/0x26c0 drivers/iommu/iommufd/selftest.c:946 iommufd_fops_ioctl+0x26f/0x3b0 drivers/iommu/iommufd/main.c:339 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+0x123/0x190 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f10cd68c0f9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f10ce3d0168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f10cd7abf80 RCX: 00007f10cd68c0f9 RDX: 00000000200000c0 RSI: 0000000000003ba0 RDI: 0000000000000003 RBP: 00007f10cd6e7b39 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffc89b39bbf R14: 00007f10ce3d0300 R15: 0000000000022000