All Virtuozzo development lists (kernel + QEMU)
 help / color / mirror / Atom feed
From: "Denis V. Lunev" <den@openvz.org>
To: svt-core@virtuozzo.com
Cc: andrey.drobyshev@virtuozzo.com, den@openvz.org
Subject: [PATCH hci-dev 0/1] hw/ide/atapi: fix abort on CD-ROM reads past LBA 2^31 #VSTOR-154795
Date: Thu, 12 Nov 2026 14:47:57 +0100	[thread overview]
Message-ID: <20261112134758.646697-1-den@openvz.org> (raw)

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


             reply	other threads:[~2026-11-12 13:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-12 13:47 Denis V. Lunev [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261112134758.646697-1-den@openvz.org \
    --to=den@openvz.org \
    --cc=andrey.drobyshev@virtuozzo.com \
    --cc=svt-core@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.