All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] spapr: nested: Fix OOB read and return codes in H_GUEST_{GET, SET}_STATE
@ 2026-11-30 10:48 Utkarsh Verma
  2026-11-30 10:48 ` [PATCH v2 1/3] spapr: nested: Check guest state buffer len " Utkarsh Verma
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Utkarsh Verma @ 2026-11-30 10:48 UTC (permalink / raw)
  To: qemu-devel, qemu-ppc
  Cc: Chinmay Rath, Harsh Prateek Bora, Amit Machhiwal, Nicholas Piggin,
	qemu-stable, Utkarsh Verma

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



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

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

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-30 10:48 [PATCH v2 0/3] spapr: nested: Fix OOB read and return codes in H_GUEST_{GET, SET}_STATE Utkarsh Verma
2026-11-30 10:48 ` [PATCH v2 1/3] spapr: nested: Check guest state buffer len " 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

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.