linux/drivers/iommu/intel
Li RongQing 754f8efe45 iommu/intel: Fix out-of-bounds memset in dmar_latency_disable()
dmar_latency_disable() intends to zero out only the single
latency_statistic entry for the given type, but the memset size was
computed as sizeof(*lstat) * DMAR_LATENCY_NUM, which clears the entire
array starting from &lstat[type].

When type > 0, this writes beyond the end of the allocated array,
corrupting adjacent memory.

Fix by using sizeof(*lstat) to clear only the target entry.

Fixes: 55ee5e67a5 ("iommu/vt-d: Add common code for dmar latency performance monitors")
Signed-off-by: Li RongQing <lirongqing@baidu.com>
Signed-off-by: Will Deacon <will@kernel.org>
2026-07-21 11:34:51 +00:00
..
cache.c iommu/vt-d: Simplify calculate_psi_aligned_address() 2026-05-19 10:38:19 +02:00
debugfs.c iommu/vt-d: Remove dmar_readl() and dmar_readq() 2026-04-02 09:26:05 +02:00
dmar.c iommu/vt-d: Improve IOMMU fault information 2026-06-04 09:21:50 +02:00
iommu.c Merge branches 'apple/dart', 'arm/smmu/updates', 'arm/smmu/bindings', 'rockchip', 'verisilicon', 'riscv', 'intel/vt-d', 'amd/amd-vi' and 'core' into next 2026-06-12 14:57:23 +02:00
iommu.h iommu/vt-d: Avoid WARNING in sva unbind path 2026-06-04 09:21:49 +02:00
irq_remapping.c iommu/vt-d: Remove dmar_writel() and dmar_writeq() 2026-04-02 09:26:06 +02:00
Kconfig Merge branches 'arm/smmu/updates', 'arm/smmu/bindings', 'mediatek', 'nvidia/tegra', 'intel/vt-d', 'amd/amd-vi' and 'core' into next 2025-11-28 08:44:21 +01:00
Makefile iommu: make inclusion of intel directory conditional 2025-05-16 08:46:46 +02:00
nested.c iommu/vt-d: Support dirty tracking on PASID 2026-04-02 09:26:05 +02:00
pasid.c iommu/vt-d: Remove typo from pasid_pte_config_nested() 2026-06-04 09:21:50 +02:00
pasid.h Merge branches 'fixes', 'arm/smmu/updates', 'intel/vt-d', 'amd/amd-vi' and 'core' into next 2026-02-06 11:10:40 +01:00
perf.c iommu/intel: Fix out-of-bounds memset in dmar_latency_disable() 2026-07-21 11:34:51 +00:00
perf.h iommu/vt-d: Replace snprintf with scnprintf in dmar_latency_snapshot() 2025-09-19 09:43:19 +02:00
perfmon.c iommu/vt-d: Remove dmar_writel() and dmar_writeq() 2026-04-02 09:26:06 +02:00
perfmon.h
prq.c iommu/vt-d: Split piotlb invalidation into range and all 2026-04-02 09:26:07 +02:00
svm.c iommu/vt-d: Disallow SVA if page walk is not coherent 2026-07-21 11:27:32 +00:00
trace.c
trace.h iommu/vt-d: Remove the remaining pages along the invalidation path 2026-04-02 09:26:08 +02:00