Skip to content

[ciqlts8_6] vhost: reset the vring metadata cache on vring reconfiguration - #1707

Merged
PlaidCat merged 1 commit into
ciqlts8_6from
{maple}_ciqlts8_6
Oct 16, 2026
Merged

PlaidCat merged 1 commit into
ciqlts8_6from
{maple}_ciqlts8_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)

vhost: reset the vring metadata cache on vring reconfiguration

jira VULN-204214
cve CVE-2026-74580
commit-author Jun Yang <junvyyang@tencent.com>
commit de845981da67a6b049080c87e605130b0c30adc5

Test Results

✅ Build Stage

Architecture Build Time Total Time
x86_64 23m 41s 24m 42s
aarch64 9m 48s 10m 26s

✅ Boot Verification

✅ Kernel Selftests

Architecture Passed Failed Compared Against Status
x86_64 108 31 ciqlts8_6 ✅ No regressions
aarch64 66 21 ciqlts8_6 ✅ No regressions

✅ LTP Results

Architecture Passed Failed Compared Against Status
x86_64 1440 13 ciqlts8_6 ✅ No regressions
aarch64 1425 14 ciqlts8_6 ✅ No regressions

x86_64 newly passing:

  • futex_wake02 (FAIL -> PASS)

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

jira VULN-204214
cve CVE-2026-74580
commit-author Jun Yang <junvyyang@tencent.com>
commit de84598

vq->meta_iotlb[] caches the vhost_iotlb_map that backs each vring
metadata region, and iotlb_access_ok() returns early on a cache hit,
taking the hit as proof that the region has already been validated:

	if (vhost_vq_meta_fetch(vq, addr, len, type))
		return true;

The cache is reset on VHOST_IOTLB_UPDATE and VHOST_IOTLB_INVALIDATE, on
device IOTLB (re)initialisation and on vq reset, but not when
VHOST_SET_VRING_ADDR replaces vq->desc, vq->avail and vq->used, nor when
VHOST_SET_VRING_NUM changes the region sizes.

With a device IOTLB attached both ioctls are accepted while the vq is
live, and neither validates the addresses at ioctl time: vq_access_ok()
and vq_log_used_access_ok() return true early because the addresses are
GIOVAs, deferring validation to prefetch time.  Once the cache has been
populated that deferred validation no longer runs -- vq_meta_prefetch()
hits the stale entry and returns true -- and vhost_vq_meta_fetch() keeps
translating through the old mapping as

	map->addr + addr - map->start

for an address the mapping no longer covers.  vhost_copy_to_user() and
vhost_copy_from_user() consume the result with __copy_to_user() and
__copy_from_user(), which do not check it either, so a subsequent used
ring update or descriptor fetch accesses memory outside the region the
IOTLB actually maps.

Reset the metadata cache whenever the vring is reconfigured, so the new
addresses are pushed back through iotlb_access_ok()'s slow path.

Fixes: f889491 ("vhost: introduce O(1) vq metadata cache")
	Cc: stable@vger.kernel.org
Assisted-by: tencentos-corvus-ai:kimi-k3
	Signed-off-by: Jun Yang <junvyyang@tencent.com>
Message-ID: <20260803014823.68623-1-juny24602@gmail.com>
	Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit de84598)
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 Oct 16, 2026
@github-actions

Copy link
Copy Markdown

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

@github-actions

Copy link
Copy Markdown

✅ Diffofdiffs: No differences found

Compared 1 backport with upstream.

Checked PR revision c00ed7f82751 against base d4a6d7c98dc7.

@github-actions

Copy link
Copy Markdown

✅ Validation checks completed successfully View full results: https://github.com/ctrliq/kernel-src-tree/actions/runs/38832384324

@PlaidCat
PlaidCat requested a review from a team October 16, 2026 13:50
@PlaidCat PlaidCat self-assigned this Oct 16, 2026

@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 4996727 into ciqlts8_6 Oct 16, 2026
6 checks passed
@PlaidCat
PlaidCat deleted the {maple}_ciqlts8_6 branch October 16, 2026 18:15
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