virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] virtio-rng: Remove false BUG for spurious callbacks
@ 2009-04-23  7:12 Rusty Russell
  0 siblings, 0 replies; 3+ messages in thread
From: Rusty Russell @ 2009-04-23  7:12 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Christian Borntraeger, stable, linux-kernel, virtualization

From: Christian Borntraeger <borntraeger@de.ibm.com>

The virtio-rng drivers checks for spurious callbacks. Since
callbacks can be implemented via shared interrupts (e.g. PCI) this
could lead to guest kernel oopses with lots of virtio devices.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 drivers/char/hw_random/virtio-rng.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6/drivers/char/hw_random/virtio-rng.c
===================================================================
--- linux-2.6.orig/drivers/char/hw_random/virtio-rng.c
+++ linux-2.6/drivers/char/hw_random/virtio-rng.c
@@ -37,9 +37,9 @@ static void random_recv_done(struct virt
 {
 	int len;
 
-	/* We never get spurious callbacks. */
+	/* We can get spurious callbacks, e.g. shared IRQs + virtio_pci. */
 	if (!vq->vq_ops->get_buf(vq, &len))
-		BUG();
+		return;
 
 	data_left = len / sizeof(random_data[0]);
 	complete(&have_data);

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-04-26 13:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <200904231642.59939.rusty@rustcorp.com.au>
2009-04-24 15:23 ` [PATCH] virtio-rng: Remove false BUG for spurious callbacks Linus Torvalds
2009-04-26 13:00   ` Rusty Russell
2009-04-23  7:12 Rusty Russell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).