From: Utkarsh Verma <uverma@linux.ibm.com>
To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org
Cc: Chinmay Rath <rathc@linux.ibm.com>,
Harsh Prateek Bora <harshpb@linux.ibm.com>,
Amit Machhiwal <amachhiw@linux.ibm.com>,
Nicholas Piggin <npiggin@gmail.com>,
qemu-stable@nongnu.org, Utkarsh Verma <uverma@linux.ibm.com>
Subject: [PATCH v2 0/3] spapr: nested: Fix OOB read and return codes in H_GUEST_{GET, SET}_STATE
Date: Mon, 30 Nov 2026 16:18:47 +0530 [thread overview]
Message-ID: <20261130104850.190510-1-uverma@linux.ibm.com> (raw)
This series fixes an out-of-bounds read of the guest state buffer in
H_GUEST_{GET,SET}_STATE (and H_GUEST_RUN_VCPU, which shares the code),
and makes these hcalls return the error codes PAPR specifies instead of
asserting or returning H_P3 for everything.
Patch 1 adds length checks before the element header and payload are
read, and fixes the over-read in log_element().
Patch 2 makes guest_state_request_check() report why it failed, and
returns PAPR-compliant codes per hcall.
Patch 3 (from Amit) rejects buflen == 0, which crashed QEMU with a
SIGSEGV in address_space_unmap().
Changes since v1:
- Split the original patch into three.
- Return codes now depend on the hcall, as PAPR specifies.
- Added Amit's zero-length fix.
v1: https://lore.kernel.org/qemu-devel/20261120080829.195131-1-uverma@linux.ibm.com/
Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4741
Amit Machhiwal (1):
spapr: nested: Reject zero length buffer in H_GUEST_{GET,SET}_STATE
Utkarsh Verma (2):
spapr: nested: Check guest state buffer len in H_GUEST_{GET,SET}_STATE
spapr: nested: Fix the return codes for H_GUEST_{GET,SET}_STATE and
H_GUEST_RUN_VCPU
hw/ppc/spapr_nested.c | 78 +++++++++++++++++++++++++++--------
include/hw/ppc/spapr.h | 4 ++
include/hw/ppc/spapr_nested.h | 1 +
3 files changed, 65 insertions(+), 18 deletions(-)
--
2.55.0
next reply other threads:[~2026-11-30 10:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-30 10:48 Utkarsh Verma [this message]
2026-11-30 10:48 ` [PATCH v2 1/3] spapr: nested: Check guest state buffer len in H_GUEST_{GET, SET}_STATE Utkarsh Verma
2026-11-30 10:48 ` [PATCH v2 2/3] spapr: nested: Fix the return codes for H_GUEST_{GET, SET}_STATE and H_GUEST_RUN_VCPU Utkarsh Verma
2026-11-30 10:48 ` [PATCH v2 3/3] spapr: nested: Reject zero length buffer in H_GUEST_{GET, SET}_STATE Utkarsh Verma
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=20261130104850.190510-1-uverma@linux.ibm.com \
--to=uverma@linux.ibm.com \
--cc=amachhiw@linux.ibm.com \
--cc=harshpb@linux.ibm.com \
--cc=npiggin@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=qemu-stable@nongnu.org \
--cc=rathc@linux.ibm.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.