Commit 27d93dc9 authored by Jason Wang's avatar Jason Wang Committed by Carlos Llamas
Browse files

UPSTREAM: virtio-rng: make device ready before making request



Current virtio-rng does a entropy request before DRIVER_OK, this
violates the spec:

virtio spec requires that all drivers set DRIVER_OK
before using devices.

Further, kernel will ignore the interrupt after commit
8b4ec69d ("virtio: harden vring IRQ").

Fixing this by making device ready before the request.

Cc: stable@vger.kernel.org
Fixes: 8b4ec69d ("virtio: harden vring IRQ")
Fixes: f7f510ec ("virtio: An entropy device, as suggested by hpa.")
Reported-and-tested-by: default avatar <syzbot+5b59d6d459306a556f54@syzkaller.appspotmail.com>
Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
Message-Id: <20220608061422.38437-1-jasowang@redhat.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Reviewed-by: default avatarLaurent Vivier <lvivier@redhat.com>

Bug: 324967354
(cherry picked from commit 22843255)
Change-Id: I1886e8a1192c8f7ccf384f3705efa16a31bebcff
Reported-and-tested-by: Roman Kiryanov <rkir@google.com> (against android13-5.15)
Suggested-by: default avatarJohn Stultz <jstultz@google.com>
Signed-off-by: default avatarCarlos Llamas <cmllamas@google.com>
parent 0ac651d0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment