Re: [syzbot] [virtualization?] KMSAN: uninit-value in virtqueue_add (4)

From: Edward Adam Davis
Date: Thu Jan 25 2024 - 20:35:54 EST


please test uninit-value in virtqueue_add (4)

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git fbafc3e621c3

diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c
index 9d1bdcdc1331..4ca6627a7459 100644
--- a/drivers/scsi/virtio_scsi.c
+++ b/drivers/scsi/virtio_scsi.c
@@ -427,7 +427,7 @@ static int __virtscsi_add_cmd(struct virtqueue *vq,
size_t req_size, size_t resp_size)
{
struct scsi_cmnd *sc = cmd->sc;
- struct scatterlist *sgs[6], req, resp;
+ struct scatterlist *sgs[6], req = {}, resp = {};
struct sg_table *out, *in;
unsigned out_num = 0, in_num = 0;