OpenVZ / Virtuozzo kernel development (devel@openvz.org)
 help / color / mirror / Atom feed
* [Devel] [PATCH hci-8.1 0/3] drivers/vhost/blk: fix virtio-blk request header and payload parsing
@ 2026-10-21  8:46 Alexander Ivanov
  2026-10-21  8:46 ` [Devel] [PATCH hci-8.1 1/3] drivers/vhost/blk: convert virtio_blk_outhdr fields to CPU byte order Alexander Ivanov
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Alexander Ivanov @ 2026-10-21  8:46 UTC (permalink / raw)
  To: andrey.zhadchenko; +Cc: devel

vhost-blk parsed guest requests from the whole descriptor chain without
telling the device-readable part from the device-writable one, and used
the header fields without byte order conversion.

Patch 1 converts hdr->type and hdr->sector to CPU byte order.

Patch 2 takes the request header only from the readable part and drops
requests whose readable part is shorter than the header.

Patch 3 takes the write payload from the readable part and the payload
of other requests from the writable part, reads the status byte from
the end of the writable part, and fails reads and writes with an empty,
oversized or misaligned payload with VIRTIO_BLK_S_IOERR instead of
leaving them hanging.

https://virtuozzo.atlassian.net/browse/VSTOR-142755

Alexander Ivanov (3):
  drivers/vhost/blk: convert virtio_blk_outhdr fields to CPU byte order
  drivers/vhost/blk: take virtio_blk_outhdr only from the readable part
  drivers/vhost/blk: take req->len from one side of the descriptor chain

 drivers/vhost/blk.c | 56 ++++++++++++++++++++++++++++++++-------------
 1 file changed, 40 insertions(+), 16 deletions(-)

-- 
2.53.0

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

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

end of thread, other threads:[~2026-10-29 11:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-21  8:46 [Devel] [PATCH hci-8.1 0/3] drivers/vhost/blk: fix virtio-blk request header and payload parsing Alexander Ivanov
2026-10-21  8:46 ` [Devel] [PATCH hci-8.1 1/3] drivers/vhost/blk: convert virtio_blk_outhdr fields to CPU byte order Alexander Ivanov
2026-10-21  8:49   ` no-reply
2026-10-21  8:46 ` [Devel] [PATCH hci-8.1 2/3] drivers/vhost/blk: take virtio_blk_outhdr only from the readable part Alexander Ivanov
2026-10-21  8:49   ` no-reply
2026-10-21  8:46 ` [Devel] [PATCH hci-8.1 3/3] drivers/vhost/blk: take req->len from one side of the descriptor chain Alexander Ivanov
2026-10-21  8:50   ` no-reply
2026-10-25 21:54 ` [Devel] [PATCH hci-8.1 0/3] drivers/vhost/blk: fix virtio-blk request header and payload parsing Andrey Zhadchenko
2026-10-29 11:26 ` Konstantin Khorenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox