From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from r3-18.sinamail.sina.com.cn (r3-18.sinamail.sina.com.cn [202.108.3.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BCF011A9F9F for ; Fri, 8 May 2026 00:28:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.108.3.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778200127; cv=none; b=opxQYbuniuNfpyOBGe6VB0C4p81wLKB4kkYYtr35ZKpQVDYhUBp/Gvh2e7L5L806kwNkyfceduuYuqGScImbq7O6uEVFW/r89Bc7OTcyz1GJSsCI1Zft5CGUMXQ6dDpeNPyXuwMV3bfHYERX7+8QWDuUESiDn+vOwTCst4yh0h0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778200127; c=relaxed/simple; bh=rDxIfzxA7F/kGcg5EqAgY4fO09nvYZ2fX1g3uHxExhM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dA7VYR9WSBruF7CynYW6rXmSesEZd1LlneK2AVpBkLF9862ehK8JcULTuQd8XICsy3OzgUvzNziKhJMc3gcKHI0qSoIvb7PJfd42Tq3a4ohZc7YIhzElXY7mbs5Q9aTUaQZRPqkrThsJB+NSkNQffZq6hrX85IJzFV6t8avIk7o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sina.com; spf=pass smtp.mailfrom=sina.com; dkim=pass (1024-bit key) header.d=sina.com header.i=@sina.com header.b=kB4fmncc; arc=none smtp.client-ip=202.108.3.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sina.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sina.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=sina.com header.i=@sina.com header.b="kB4fmncc" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sina.com; s=201208; t=1778200123; bh=ElfVoQqMp9sGNPwX9hdKFD+rcuM9cTaS8NfpT6C/seI=; h=From:Subject:Date:Message-ID; b=kB4fmnccvSAe8e/sFZZLQyljtgR8CyAYAbXxL4FZ4R1xhe+ioGYMRF259nmEPom1j ECsh9OgX2LUCv2ut2zWgfVm0YqZ8I4oSnMIjUrM8CW946Nhz3Mb1yVV/iYeEy3c83m T6BT2SrakWrhxvEBpTMHMqbPhALVBmozoKYlvgOE= X-SMAIL-HELO: localhost.localdomain Received: from unknown (HELO localhost.localdomain)([114.249.62.144]) by sina.com (10.54.253.32) with ESMTP id 69FD2DA4000051E0; Fri, 8 May 2026 08:26:14 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com Authentication-Results: sina.com; spf=none smtp.mailfrom=hdanton@sina.com; dkim=none header.i=none; dmarc=none action=none header.from=hdanton@sina.com X-SMAIL-MID: 6958464456881 X-SMAIL-UIID: C4BE51FFD10D47EBB1058D8E46320DBA-20260508-082614-1 From: Hillf Danton To: syzbot Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Subject: Re: [syzbot] [dri?] [media?] WARNING in dma_resv_add_fence Date: Fri, 8 May 2026 08:26:11 +0800 Message-ID: <20260508002612.427-1-hdanton@sina.com> In-Reply-To: <69fd21b9.050a0220.3cf765.0360.GAE@google.com> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit > 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) --