Commit ea066ce
committed
iommu/s390: Fix memory corruption when using identity domain
JIRA: https://issues.redhat.com/browse/RHEL-113452
commit b3506e9
Author: Matthew Rosato <[email protected]>
Date: Wed Aug 27 17:08:27 2025 -0400
iommu/s390: Fix memory corruption when using identity domain
zpci_get_iommu_ctrs() returns counter information to be reported as part
of device statistics; these counters are stored as part of the s390_domain.
The problem, however, is that the identity domain is not backed by an
s390_domain and so the conversion via to_s390_domain() yields a bad address
that is zero'd initially and read on-demand later via a sysfs read.
These counters aren't necessary for the identity domain; just return NULL
in this case.
This issue was discovered via KASAN with reports that look like:
BUG: KASAN: global-out-of-bounds in zpci_fmb_enable_device
when using the identity domain for a device on s390.
Cc: [email protected]
Fixes: 64af12c ("iommu/s390: implement iommu passthrough via identity domain")
Reported-by: Cam Miller <[email protected]>
Signed-off-by: Matthew Rosato <[email protected]>
Tested-by: Cam Miller <[email protected]>
Reviewed-by: Farhan Ali <[email protected]>
Reviewed-by: Niklas Schnelle <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Joerg Roedel <[email protected]>
Signed-off-by: Thomas Huth <[email protected]>1 parent a71b2dd commit ea066ce
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1031 | 1031 | | |
1032 | 1032 | | |
1033 | 1033 | | |
1034 | | - | |
| 1034 | + | |
| 1035 | + | |
1035 | 1036 | | |
1036 | 1037 | | |
1037 | 1038 | | |
| |||
0 commit comments