Skip to content

[ciqlts9_6] Multiple patches tested (3 commits)#1305

Merged
PlaidCat merged 3 commits into
ciqlts9_6from
{jmaple}_ciqlts9_6
Jun 10, 2026
Merged

[ciqlts9_6] Multiple patches tested (3 commits)#1305
PlaidCat merged 3 commits into
ciqlts9_6from
{jmaple}_ciqlts9_6

Conversation

@ciq-kernel-automation

Copy link
Copy Markdown

Summary

This PR has been automatically created after successful completion of all CI stages.

Commit Message(s)

KVM: arm64: vgic-its: Drop the translation cache reference only for the erased entry

jira VULN-187400
cve CVE-2026-46316
commit-author Hyunwoo Kim <imv4bel@gmail.com>
commit 13031fb6b8357fbbcded2a7f4cba73e4781ee594
KVM: arm64: Fix nested S2 MMU structures reallocation

jira VULN-187401
cve-pre CVE-2026-46317
commit-author Marc Zyngier <maz@kernel.org>
commit 5417a2e9b130a78bf48cb4cf92630efcee5ccf38
KVM: arm64: Reassign nested_mmus array behind mmu_lock

jira VULN-187401
cve CVE-2026-46317
commit-author Hyunwoo Kim <imv4bel@gmail.com>
commit 70543358fa08e0f7cebc3447c3b70fe97ad7aaa8
upstream-diff | Due to missing the following change set the merge
    conflict arose due to a previous drop extra parameters to
    kvrealloc().  The change set was deemed unnecessary for this fix.
    https://lore.kernel.org/all/20240722163111.4766-1-dakr@kernel.org/

Test Results

✅ Build Stage

Architecture Build Time Total Time
x86_64 31m 4s 32m 1s
aarch64 18m 36s 19m 17s

✅ Boot Verification

✅ Kernel Selftests

Architecture Passed Failed Compared Against Status
x86_64 206 43 ciqlts9_6 ✅ No regressions
aarch64 154 45 ciqlts9_6 ✅ No regressions

✅ LTP Results

Architecture Passed Failed Compared Against Status
x86_64 1453 82 ciqlts9_6 ✅ No regressions
aarch64 1426 83 ciqlts9_6 ✅ No regressions

🤖 This PR was automatically generated by GitHub Actions
Run ID: 27221968499

PlaidCat added 3 commits June 9, 2026 12:51
…he erased entry

jira VULN-187400
cve CVE-2026-46316
commit-author Hyunwoo Kim <imv4bel@gmail.com>
commit 13031fb

vgic_its_invalidate_cache() walks the per-ITS translation cache with
xa_for_each() and drops the cache's reference on each entry with
vgic_put_irq(). It puts the iterated pointer, though, rather than the
value returned by xa_erase().

The function is called from contexts that do not exclude one another: the
ITS command handlers hold its_lock, the GITS_CTLR write path holds
cmd_lock, and the path that clears EnableLPIs in a redistributor's
GICR_CTLR holds neither. Two or more of them can drain the same cache
concurrently, and if each one observes the same entry, erases it and then
puts it, the single reference the cache holds on that entry is dropped
more than once. The entry can then be freed while an ITE still maps it.

xa_erase() is atomic and returns the previous entry, so put only the entry
that this context actually removed. The cache reference is then dropped
exactly once per entry even when the invalidations run concurrently, and
the behavior is unchanged when only one context runs.

Fixes: 8201d10 ("KVM: arm64: vgic-its: Maintain a translation cache per ITS")
	Signed-off-by: Hyunwoo Kim <imv4bel@gmail.com>
	Reviewed-by: Oliver Upton <oupton@kernel.org>
Link: https://patch.msgid.link/ah2c5lu4JbUg7dj-@v4bel
	Signed-off-by: Marc Zyngier <maz@kernel.org>
	Cc: stable@vger.kernel.org
(cherry picked from commit 13031fb)
	Signed-off-by: Jonathan Maple <jmaple@ciq.com>
jira VULN-187401
cve-pre CVE-2026-46317
commit-author Marc Zyngier <maz@kernel.org>
commit 5417a2e

For each vcpu that userspace creates, we allocate a number of
s2_mmu structures that will eventually contain our shadow S2
page tables.

Since this is a dynamically allocated array, we reallocate
the array and initialise the newly allocated elements. Once
everything is correctly initialised, we adjust pointer and size
in the kvm structure, and move on.

But should that initialisation fail *and* the reallocation triggered
a copy to another location, we end-up returning early, with the
kvm structure still containing the (now stale) old pointer. Weeee!

Cure it by assigning the pointer early, and use this to perform
the initialisation. If everything succeeds, we adjust the size.
Otherwise, we just leave the size as it was, no harm done, and the
new memory is as good as the ol' one (we hope...).

Fixes: 4f128f8 ("KVM: arm64: nv: Support multiple nested Stage-2 mmu structures")
	Reported-by: Alexander Potapenko <glider@google.com>
	Tested-by: Alexander Potapenko <glider@google.com>
Link: https://lore.kernel.org/r/20250204145554.774427-1-maz@kernel.org
	Signed-off-by: Marc Zyngier <maz@kernel.org>
(cherry picked from commit 5417a2e)
	Signed-off-by: Jonathan Maple <jmaple@ciq.com>
jira VULN-187401
cve CVE-2026-46317
commit-author Hyunwoo Kim <imv4bel@gmail.com>
commit 7054335
upstream-diff | Due to missing the following change set the merge
    conflict arose due to a previous drop extra parameters to
    kvrealloc().  The change set was deemed unnecessary for this fix.
    https://lore.kernel.org/all/20240722163111.4766-1-dakr@kernel.org/

kvm->arch.nested_mmus[] is walked under kvm->mmu_lock, including from the
MMU notifier path (kvm_unmap_gfn_range() -> kvm_nested_s2_unmap()), which
can run at any time. kvm_vcpu_init_nested() reallocates the array and frees
the old buffer while holding only kvm->arch.config_lock, so such a walker
can reference the freed array.

Allocate the new array outside of mmu_lock, as the allocation can sleep.
Under the lock, copy the existing entries, fix up the back pointers and
reassign the array. Free the old buffer after dropping the lock, as
kvfree() can sleep as well.

Fixes: 4f128f8 ("KVM: arm64: nv: Support multiple nested Stage-2 mmu structures")
	Signed-off-by: Hyunwoo Kim <imv4bel@gmail.com>
	Reviewed-by: Oliver Upton <oupton@kernel.org>
Link: https://patch.msgid.link/aiKIVVeIr1aAB1yp@v4bel
	Signed-off-by: Marc Zyngier <maz@kernel.org>
	Cc: stable@vger,kernel.org
(cherry picked from commit 7054335)
	Signed-off-by: Jonathan Maple <jmaple@ciq.com>
@ciq-kernel-automation ciq-kernel-automation Bot added the created-by-kernelci Tag PRs that were automatically created when a user branch was pushed to the repo (kernelCI) label Jun 9, 2026
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

🤖 Validation Checks In Progress Workflow run: https://github.com/ctrliq/kernel-src-tree/actions/runs/27235442743

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

🔍 Interdiff Analysis

  • ⚠️ PR commit c6885f8b8b2 (KVM: arm64: Reassign nested_mmus array behind mmu_lock) → upstream 70543358fa08
    Differences found:
================================================================================
*    DELTA DIFFERENCES - code changes that differ between the patches          *
================================================================================

--- b/arch/arm64/kvm/nested.c
+++ b/arch/arm64/kvm/nested.c
@@ -61,6 +61,13 @@
 	 * again, and there is no reason to affect the whole VM for this.
 	 */
 	num_mmus = atomic_read(&kvm->online_vcpus) * S2_MMU_PER_VCPU;
+	tmp = kvrealloc(kvm->arch.nested_mmus,
+			size_mul(sizeof(*kvm->arch.nested_mmus), kvm->arch.nested_mmus_size),
+			size_mul(sizeof(*kvm->arch.nested_mmus), num_mmus),
+			GFP_KERNEL_ACCOUNT | __GFP_ZERO);
+	if (!tmp)
+		return -ENOMEM;
+
 	if (num_mmus > kvm->arch.nested_mmus_size) {
 		tmp = kvcalloc(num_mmus, sizeof(*tmp), GFP_KERNEL_ACCOUNT);
 		if (!tmp)

################################################################################
!    REJECTED PATCH2 HUNKS - could not be compared; manual review needed       !
################################################################################

--- b/arch/arm64/kvm/nested.c
+++ b/arch/arm64/kvm/nested.c
@@ -89,11 +89,6 @@
 	 * again, and there is no reason to affect the whole VM for this.
 	 */
 	num_mmus = atomic_read(&kvm->online_vcpus) * S2_MMU_PER_VCPU;
-	tmp = kvrealloc(kvm->arch.nested_mmus,
-			size_mul(sizeof(*kvm->arch.nested_mmus), num_mmus),
-			GFP_KERNEL_ACCOUNT | __GFP_ZERO);
-	if (!tmp)
-		return -ENOMEM;
 
 	swap(kvm->arch.nested_mmus, tmp);
 

================================================================================
*    CONTEXT DIFFERENCES - surrounding code differences between the patches    *
================================================================================

--- b/arch/arm64/kvm/nested.c
+++ b/arch/arm64/kvm/nested.c
@@ -59,7 +59,6 @@
 	 */
 	num_mmus = atomic_read(&kvm->online_vcpus) * S2_MMU_PER_VCPU;
 	tmp = kvrealloc(kvm->arch.nested_mmus,
-			size_mul(sizeof(*kvm->arch.nested_mmus), kvm->arch.nested_mmus_size),
 			size_mul(sizeof(*kvm->arch.nested_mmus), num_mmus),
 			GFP_KERNEL_ACCOUNT | __GFP_ZERO);
 	if (!tmp)

This is an automated interdiff check for backported commits.

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

JIRA PR Check Results

3 commit(s) with issues found:

Commit c6885f8b8b29

Summary: KVM: arm64: Reassign nested_mmus array behind mmu_lock

❌ Errors:

  • VULN-187401: Status is 'To Do', expected 'In Progress'

⚠️ Warnings:

  • VULN-187401: No time logged - please log time manually

Commit be6e5860e298

Summary: KVM: arm64: Fix nested S2 MMU structures reallocation

❌ Errors:

  • VULN-187401: Status is 'To Do', expected 'In Progress'

⚠️ Warnings:

  • VULN-187401: No time logged - please log time manually

Commit 59138f45da7c

Summary: KVM: arm64: vgic-its: Drop the translation cache reference only for the erased entry

❌ Errors:

  • VULN-187400: Status is 'To Do', expected 'In Progress'

⚠️ Warnings:

  • VULN-187400: No time logged - please log time manually

Summary: Checked 3 commit(s) total.

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

Validation checks completed with issues View full results: https://github.com/ctrliq/kernel-src-tree/actions/runs/27235442743

@bmastbergen bmastbergen self-requested a review June 9, 2026 23:20

@bmastbergen bmastbergen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥌

@PlaidCat PlaidCat merged commit 9484ae8 into ciqlts9_6 Jun 10, 2026
7 checks passed
@PlaidCat PlaidCat deleted the {jmaple}_ciqlts9_6 branch June 10, 2026 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

created-by-kernelci Tag PRs that were automatically created when a user branch was pushed to the repo (kernelCI)

Development

Successfully merging this pull request may close these issues.

3 participants