lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250901141551.57981-1-wlsrbwjd7232@gmail.com>
Date: Mon,  1 Sep 2025 23:15:51 +0900
From: Gyujeong Jin <wlsrbwjd7232@...il.com>
To: maz@...nel.org,
	oliver.upton@...ux.dev
Cc: joey.gouly@....com,
	suzuki.poulose@....com,
	yuzenghui@...wei.com,
	catalin.marinas@....com,
	will@...nel.org,
	kvmarm@...ts.linux.dev,
	linux-arm-kernel@...ts.infradead.org,
	kvm@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	wlsrbwjd7232@...il.com,
	gyutrange <wlsrbwjd643@...er.com>,
	stable@...r.kernel.org,
	DongHa Lee <gap-dev@...mple.com>,
	Daehyeon Ko <4ncient@...mple.com>,
	Geonha Lee <leegn4a@...mple.com>,
	Hyungyu Oh <dqpc_lover@...mple.com>,
	Jaewon Yang <r4mbb1@...mple.com>
Subject: [PATCH] KVM: arm64: nested: Fix VA sign extension in VNCR/TLBI paths

From: gyutrange <wlsrbwjd643@...er.com>

VNCR/TLBI VA reconstruction currently uses bit 48 as the sign bit,
but for 48-bit virtual addresses the correct sign bit is bit 47.
Using 48 can mis-canonicalize addresses in the negative half and may
cause missed invalidations.

Although VNCR_EL2 encodes other architectural fields (RESS, BADDR;
see Arm ARM D24.2.206), sign_extend64() interprets its second argument
as the index of the sign bit. Passing 48 prevents propagation of the
canonical sign bit for 48-bit VAs.

Impact:
- Incorrect canonicalization of VAs with bit47=1
- Potential stale VNCR pseudo-TLB entries after TLBI or MMU notifier
- Possible incorrect translation/permissions or DoS when combined
  with other issues

Fixes: 667304740537 ("KVM: arm64: Mask out non-VA bits from TLBI VA* on VNCR invalidation")
Cc: stable@...r.kernel.org
Reported-by: DongHa Lee <gap-dev@...mple.com>
Reported-by: Gyujeong Jin <wlsrbwjd7232@...il.com>
Reported-by: Daehyeon Ko <4ncient@...mple.com>
Reported-by: Geonha Lee <leegn4a@...mple.com>
Reported-by: Hyungyu Oh <dqpc_lover@...mple.com>
Reported-by: Jaewon Yang <r4mbb1@...mple.com>
Signed-off-by: Gyujeong Jin <wlsrbwjd7232@...il.com>
---
 arch/arm64/kvm/nested.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/kvm/nested.c b/arch/arm64/kvm/nested.c
index 77db81bae86f..eaa6dd9da086 100644
--- a/arch/arm64/kvm/nested.c
+++ b/arch/arm64/kvm/nested.c
@@ -1169,7 +1169,7 @@ int kvm_vcpu_allocate_vncr_tlb(struct kvm_vcpu *vcpu)
 
 static u64 read_vncr_el2(struct kvm_vcpu *vcpu)
 {
-	return (u64)sign_extend64(__vcpu_sys_reg(vcpu, VNCR_EL2), 48);
+	return (u64)sign_extend64(__vcpu_sys_reg(vcpu, VNCR_EL2), 47);
 }
 
 static int kvm_translate_vncr(struct kvm_vcpu *vcpu)
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ