CVE-2026-74716: accel/amdxdna: Fix locally exploitable BUG_ON in amdxdna_insert_pages()

Greg Kroah-Hartman <[email protected]>
Newsgroups org.kernel.vger.linux-cve-announce
Message-ID <2026082239-CVE-2026-74716-b277@gregkh>
From: Greg Kroah-Hartman <[email protected]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

accel/amdxdna: Fix locally exploitable BUG_ON in amdxdna_insert_pages()

In amdxdna_insert_pages(), vm_flags_mod() sets VM_MIXEDMAP and clears
VM_PFNMAP. If an unprivileged userspace process mmaps a non-imported GEM
object and then calls madvise(MADV_DONTNEED), the PTEs will be
successfully cleared because VM_MIXEDMAP allows this (unlike VM_PFNMAP).

When userspace subsequently accesses the memory, drm_gem_shmem_fault()
handles the page fault and attempts to map the backing shmem page via
vmf_insert_pfn() which calls vmf_insert_pfn_prot(). Because the backing
shmem page is normal system memory (pfn_valid(pfn) is true) and the VMA
now has VM_MIXEDMAP set, won't this predictably trigger the explicit
assertion BUG_ON((vma->vm_flags & VM_MIXEDMAP) && pfn_valid(pfn))

Fix by removing the vm_flags_mod() call and replacing the vm_insert_pages()
pre-population with the handle_mm_fault() loop that was already used for
the import (dma-buf) path.

The Linux kernel CVE team has assigned CVE-2026-74716 to this issue.


Affected and fixed versions
===========================

	Issue introduced in 6.16 with commit e486147c912f653ef4b60a6c7dbd4168a4c56a9f and fixed in 7.1.9 with commit 13339132d89d00b513dff0730bff3a313b9b13b5
	Issue introduced in 6.16 with commit e486147c912f653ef4b60a6c7dbd4168a4c56a9f and fixed in 7.2 with commit 4a19f7ab5972ef608b31ae921419bc3e04b3f8ad

Please see https://www.kernel.org for a full list of currently supported
kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to
older supported kernel versions.  The official CVE entry at
	https://cve.org/CVERecord/?id=CVE-2026-74716
will be updated if fixes are backported, please check that for the most
up to date information about this issue.


Affected files
==============

The file(s) affected by this issue are:
	drivers/accel/amdxdna/amdxdna_gem.c


Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest
stable kernel version for this, and many other bugfixes.  Individual
changes are never tested alone, but rather are part of a larger kernel
release.  Cherry-picking individual commits is not recommended or
supported by the Linux kernel community at all.  If however, updating to
the latest release is impossible, the individual changes to resolve this
issue can be found at these commits:
	https://git.kernel.org/stable/c/13339132d89d00b513dff0730bff3a313b9b13b5
	https://git.kernel.org/stable/c/4a19f7ab5972ef608b31ae921419bc3e04b3f8ad
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.