Skip to content
Commit 7f515a96 authored by Greg Kurz's avatar Greg Kurz Committed by Michael Roth
Browse files

9pfs: fix off-by-one error in PDU free list



The server can handle MAX_REQ - 1 PDUs at a time and the virtio-9p
device has a MAX_REQ sized virtqueue. If the client manages to fill
up the virtqueue, pdu_alloc() will fail and the request won't be
processed without any notice to the client (it actually causes the
linux 9p client to hang).

This has been there since the beginning (commit 9f107513 "virtio-9p:
Add a virtio 9p device to qemu"), but it needs an agressive workload to
run in the guest to show up.

We actually allocate MAX_REQ PDUs and I see no reason not to link them
all into the free list, so let's fix the init loop.

Reported-by: default avatarTuomas Tynkkynen <tuomas@tuxera.com>
Suggested-by: default avatarAl Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: default avatarGreg Kurz <groug@kaod.org>
(cherry picked from commit 0d78289c)

Conflicts:
	hw/9pfs/9p.c

* drop context dep on 583f21f8

Signed-off-by: default avatarGreg Kurz <groug@kaod.org>
Signed-off-by: default avatarMichael Roth <mdroth@linux.vnet.ibm.com>
parent d437262f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment