Re: [syzbot] [dri?] [media?] WARNING in dma_resv_add_fence
From: Hillf Danton
Date: Thu May 07 2026 - 20:28:49 EST
> Date: Thu, 07 May 2026 16:35:21 -0700 [thread overview]
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: fcee7d82f27d Merge tag 'net-7.1-rc3' of git://git.kernel.o..
> git tree: upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=1107ddba580000
> kernel config: https://syzkaller.appspot.com/x/.config?x=59da38148f3a3d24
> dashboard link: https://syzkaller.appspot.com/bug?extid=72bd3dd3a5d5f39a0271
> compiler: gcc (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=13dfca73980000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1599bb26580000
#syz test
--- x/drivers/gpu/drm/virtio/virtgpu_gem.c
+++ y/drivers/gpu/drm/virtio/virtgpu_gem.c
@@ -252,10 +252,21 @@ void virtio_gpu_array_add_fence(struct v
struct dma_fence *fence)
{
int i;
+ int ret;
+
+ if (objs->nents == 1) {
+ ret = dma_resv_lock_interruptible(objs->objs[0]->resv, NULL);
+ } else {
+ ret = drm_gem_lock_reservations(objs->objs, objs->nents, &objs->ticket);
+ }
+ if (ret)
+ return;
for (i = 0; i < objs->nents; i++)
dma_resv_add_fence(objs->objs[i]->resv, fence,
DMA_RESV_USAGE_WRITE);
+
+ virtio_gpu_array_unlock_resv(objs);
}
void virtio_gpu_array_put_free(struct virtio_gpu_object_array *objs)
--