mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] KVM: x86: Fix UBSAN bool warnings in module parameters
@ 2026-02-10  6:46 Gal Pressman
  2026-02-10  6:46 ` [PATCH 1/2] KVM: SVM: Fix UBSAN warning when reading avic parameter Gal Pressman
  2026-02-10  6:46 ` [PATCH 2/2] KVM: x86/mmu: Fix UBSAN warning when reading nx_huge_pages parameter Gal Pressman
  0 siblings, 2 replies; 7+ messages in thread
From: Gal Pressman @ 2026-02-10  6:46 UTC (permalink / raw)
  To: Sean Christopherson, Paolo Bonzini, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, Dave Hansen, x86, H. Peter Anvin, Naveen N Rao,
	kvm, linux-kernel
  Cc: Gal Pressman

Several KVM module parameters use int to support a special -1 (auto)
value, but rely on param_get_bool() for the sysfs getter.
When userspace reads these parameters before the auto value is resolved,
param_get_bool() interprets the int as a bool, triggering UBSAN "load of
value 255 is not a valid value for type '_Bool'" warnings.

Fix both instances by implementing getter functions that handle the -1
case before falling through to param_get_bool().

Gal Pressman (2):
  KVM: SVM: Fix UBSAN warning when reading avic parameter
  KVM: x86/mmu: Fix UBSAN warning when reading nx_huge_pages parameter

 arch/x86/kvm/mmu/mmu.c  |  5 +++++
 arch/x86/kvm/svm/avic.c | 13 ++++++++++++-
 2 files changed, 17 insertions(+), 1 deletion(-)

-- 
2.52.0


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

end of thread, other threads:[~2026-02-25  6:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-10  6:46 [PATCH 0/2] KVM: x86: Fix UBSAN bool warnings in module parameters Gal Pressman
2026-02-10  6:46 ` [PATCH 1/2] KVM: SVM: Fix UBSAN warning when reading avic parameter Gal Pressman
2026-02-23 16:38   ` Naveen N Rao
2026-02-24  9:18     ` Gal Pressman
2026-02-25  6:27       ` Naveen N Rao
2026-02-25  6:48         ` Gal Pressman
2026-02-10  6:46 ` [PATCH 2/2] KVM: x86/mmu: Fix UBSAN warning when reading nx_huge_pages parameter Gal Pressman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®