All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Sasha Levin <sashal@kernel.org>
Cc: stable@vger.kernel.org, David Woodhouse <dwmw@amazon.co.uk>,
	sashiko-bot@kernel.org,  Paul Durrant <paul@xen.org>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH 6.6.y 5/5] KVM: x86/xen: Enforce 4-byte alignment of vcpu_info registration
Date: Wed, 11 Nov 2026 07:46:31 -0800	[thread overview]
Message-ID: <avSN16QFmmfYhFpZ@seanjc-mac.roam.internal> (raw)
In-Reply-To: <20261111024039.676658-5-sashal@kernel.org>

On Tue, Nov 10, 2026, Sasha Levin wrote:
> From: David Woodhouse <dwmw@amazon.co.uk>
> 
> [ Upstream commit eacdb76c5f04956035c5d7f7e1973028f30684a2 ]
> 
> Xen's map_guest_area() enforces that vcpu_info is aligned to
> sizeof(xen_ulong_t). KVM has no such check, allowing a guest to
> register vcpu_info at an arbitrary byte alignment.
> 
> Enforce unconditional 4-byte alignment regardless of the current
> shinfo mode. This is sufficient because subsequent commits ensure
> that all locked atomic operations on vcpu_info fields use at most
> 32-bit accesses. Return -ENXIO on failure, matching Xen's
> map_guest_area() behaviour for unaligned requests.
> 
> Originally observed in review of an unrelated patch:
> https://lore.kernel.org/all/20260604193554.1BA311F00893@smtp.kernel.org/
> 
> Cc: stable@vger.kernel.org

Huh.  Do we actually need this backported to older kernels?  I'm not opposed to
the backports, but this seems like a rather benign issue.

Oh, /facepalm.  We didn't tag these two for stable:

  https://lore.kernel.org/all/20260831213632.81023-8-dwmw2@infradead.org
  https://lore.kernel.org/all/20260831213632.81023-9-dwmw2@infradead.org

a.k.a.

  301a5ced32e08e96212b413e896ef4c32d1ce961 KVM: x86/xen: Use 32-bit atomics if vCPU's evtchn_pending_sel isn't aligned
  1835551d4304abb1edcbf5d1ba71945279051236 KVM: x86/xen: Use 32-bit locked bts for vcpu_info evtchn_pending_sel

If those cherry-pick cleanly on top of this patch, then:

  Acked-by: Sean Christopherson <seanjc@google.com>

for *this* patch.  Otherwise, I vote to scrap this unless someone cares deeply
about guarding against an oscure userspace attack.

  reply	other threads:[~2026-11-11 15:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-07 10:28 FAILED: patch "[PATCH] KVM: x86/xen: Enforce 4-byte alignment of vcpu_info registration" failed to apply to 6.6-stable tree Sasha Levin
2026-11-11  2:43 ` [PATCH 6.6.y 1/5] KVM: remove more traces of device assignment UAPI Sasha Levin
2026-11-11  2:43   ` [PATCH 6.6.y 2/5] KVM: pfncache: stop open-coding offset_in_page() Sasha Levin
2026-11-11 15:49     ` Sean Christopherson
2026-11-11  2:43   ` [PATCH 6.6.y 3/5] KVM: pfncache: include page offset in uhva and use it consistently Sasha Levin
2026-11-11 15:49     ` Sean Christopherson
2026-11-11  2:43   ` [PATCH 6.6.y 4/5] KVM: s390: Refactor kvm_is_error_gpa() into kvm_is_gpa_in_memslot() Sasha Levin
2026-11-11 15:48     ` Sean Christopherson
2026-11-11  2:43   ` [PATCH 6.6.y 5/5] KVM: x86/xen: Enforce 4-byte alignment of vcpu_info registration Sasha Levin
2026-11-11 15:46     ` Sean Christopherson [this message]
2026-11-11 15:50   ` [PATCH 6.6.y 1/5] KVM: remove more traces of device assignment UAPI Sean Christopherson

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=avSN16QFmmfYhFpZ@seanjc-mac.roam.internal \
    --to=seanjc@google.com \
    --cc=dwmw@amazon.co.uk \
    --cc=paul@xen.org \
    --cc=pbonzini@redhat.com \
    --cc=sashal@kernel.org \
    --cc=sashiko-bot@kernel.org \
    --cc=stable@vger.kernel.org \
    /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.