[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220608061422.38437-1-jasowang@redhat.com>
Date: Wed, 8 Jun 2022 14:14:22 +0800
From: Jason Wang <jasowang@...hat.com>
To: mst@...hat.com, mpm@...enic.com, herbert@...dor.apana.org.au
Cc: linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org,
lvivier@...hat.com, Jason Wang <jasowang@...hat.com>,
syzbot+5b59d6d459306a556f54@...kaller.appspotmail.com
Subject: [PATCH] virtio-rng: make device ready before making request
Current virtio-rng does a entropy request before DRIVER_OK, this
violates the spec and kernel will ignore the interrupt after commit
8b4ec69d7e09 ("virtio: harden vring IRQ").
Fixing this by making device ready before the request.
Fixes: 8b4ec69d7e09 ("virtio: harden vring IRQ")
Reported-and-tested-by: syzbot+5b59d6d459306a556f54@...kaller.appspotmail.com
Signed-off-by: Jason Wang <jasowang@...hat.com>
---
drivers/char/hw_random/virtio-rng.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/char/hw_random/virtio-rng.c b/drivers/char/hw_random/virtio-rng.c
index e856df7e285c..a6f3a8a2aca6 100644
--- a/drivers/char/hw_random/virtio-rng.c
+++ b/drivers/char/hw_random/virtio-rng.c
@@ -159,6 +159,8 @@ static int probe_common(struct virtio_device *vdev)
goto err_find;
}
+ virtio_device_ready(vdev);
+
/* we always have a pending entropy request */
request_entropy(vi);
--
2.25.1
Powered by blists - more mailing lists