Commit 66668d1
committed
KVM: arm64: Block cacheable PFNMAP mapping
JIRA: https://issues.redhat.com/browse/RHEL-73607
Upstream: https://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git
commit 2a8dfab
Author: Ankit Agrawal <ankita@nvidia.com>
Date: Sat Jul 5 07:17:14 2025 +0000
KVM: arm64: Block cacheable PFNMAP mapping
Fixes a security bug due to mismatched attributes between S1 and
S2 mapping.
Currently, it is possible for a region to be cacheable in the userspace
VMA, but mapped non cached in S2. This creates a potential issue where
the VMM may sanitize cacheable memory across VMs using cacheable stores,
ensuring it is zeroed. However, if KVM subsequently assigns this memory
to a VM as uncached, the VM could end up accessing stale, non-zeroed data
from a previous VM, leading to unintended data exposure. This is a security
risk.
Block such mismatch attributes case by returning EINVAL when userspace
try to map PFNMAP cacheable. Only allow NORMAL_NC and DEVICE_*.
CC: Oliver Upton <oliver.upton@linux.dev>
CC: Catalin Marinas <catalin.marinas@arm.com>
CC: Sean Christopherson <seanjc@google.com>
Suggested-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Tested-by: Donald Dutile <ddutile@redhat.com>
Signed-off-by: Ankit Agrawal <ankita@nvidia.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Link: https://lore.kernel.org/r/20250705071717.5062-4-ankita@nvidia.com
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Signed-off-by: Donald Dutile <ddutile@redhat.com>1 parent d54b5cb commit 66668d1
1 file changed
+30
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1461 | 1461 | | |
1462 | 1462 | | |
1463 | 1463 | | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
1464 | 1476 | | |
1465 | 1477 | | |
1466 | 1478 | | |
1467 | 1479 | | |
1468 | 1480 | | |
1469 | 1481 | | |
1470 | 1482 | | |
1471 | | - | |
| 1483 | + | |
1472 | 1484 | | |
1473 | 1485 | | |
1474 | 1486 | | |
| |||
1613 | 1625 | | |
1614 | 1626 | | |
1615 | 1627 | | |
| 1628 | + | |
| 1629 | + | |
1616 | 1630 | | |
1617 | 1631 | | |
1618 | 1632 | | |
| |||
1656 | 1670 | | |
1657 | 1671 | | |
1658 | 1672 | | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
| 1680 | + | |
| 1681 | + | |
1659 | 1682 | | |
1660 | 1683 | | |
1661 | 1684 | | |
| |||
2215 | 2238 | | |
2216 | 2239 | | |
2217 | 2240 | | |
| 2241 | + | |
| 2242 | + | |
| 2243 | + | |
| 2244 | + | |
| 2245 | + | |
| 2246 | + | |
2218 | 2247 | | |
2219 | 2248 | | |
2220 | 2249 | | |
| |||
0 commit comments