All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
* [PATCH hci-dev 0/1] hw/ide/atapi: fix abort on CD-ROM reads past LBA 2^31 #VSTOR-154795
@ 2026-11-12 13:47 Denis V. Lunev
  2026-11-12 13:47 ` [PATCH hci-dev 1/1] " Denis V. Lunev
  0 siblings, 1 reply; 4+ messages in thread
From: Denis V. Lunev @ 2026-11-12 13:47 UTC (permalink / raw)
  To: svt-core; +Cc: andrey.drobyshev, den

A VM with a CD-ROM larger than 4 TiB aborts on the first guest read at
LBA 2^31 or above:

  ide_atapi_cmd_read_pio: Assertion `0 <= lba && lba < (s->nb_sectors >> 2)' failed.

VSTOR-154795 hit it on a production node: the cinder volume behind the
CD-ROM was 8 GiB at one start of the VM and 8000 GiB at the next, and the
VM aborted 10 s after that second start. The 32-bit LBA from the CDB passes
the range check, then turns negative when passed on as an int. The patch
carries it as uint32_t and widens IDEState.lba to int64_t.

Upstream has the same code. The same patch goes to qemu-devel and is not
merged yet. The only difference here is hw/ide/trace-events: this tree
no longer has the cd_read_sector_sync event.

The new qtests /ahci/cdrom/{pio,dma}/high_lba abort on unpatched hci-dev
and pass with the patch, and ahci-test and ide-test pass. The x86_64
qtest and unit suites give the same result with and without the patch:
ivshmem-test, test-hmp and qom-test abort on this tree either way. The
upstream version also passed a full make check on all targets and the
raw and qcow2 iotests.

Denis V. Lunev (1):
  hw/ide/atapi: fix abort on CD-ROM reads past LBA 2^31 #VSTOR-154795

 hw/ide/atapi.c           | 18 +++++++++---------
 hw/ide/macio.c           |  2 +-
 hw/ide/trace-events      |  8 ++++----
 include/hw/ide/ide-dev.h |  2 +-
 tests/qtest/ahci-test.c  | 36 ++++++++++++++++++++++++++++++++++++
 5 files changed, 51 insertions(+), 15 deletions(-)


base-commit: b39d755d7ac95c46e771833f558e99196340ac66
-- 
2.53.0


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

end of thread, other threads:[~2026-11-12 17:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-12 13:47 [PATCH hci-dev 0/1] hw/ide/atapi: fix abort on CD-ROM reads past LBA 2^31 #VSTOR-154795 Denis V. Lunev
2026-11-12 13:47 ` [PATCH hci-dev 1/1] " Denis V. Lunev
2026-11-12 13:51   ` no-reply
2026-11-12 17:12   ` Andrey Drobyshev

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.