linux/arch/powerpc
Shivaprasad G Bhat 0b271f7d7f powerpc/iommu: Fix the overflow validation in iommu_tce_check_ioba
The commit b1af23d836 ("KVM: PPC: iommu: Unify TCE checking") unified
IOBA parameter checking across KVM and VFIO into iommu_tce_check_ioba().
While doing so, the passed in argument npages is ignored and constant
value '1' is used leaving out a possible overflow as the callers can
legitimately be using npages > 1 for H_STUFF_TCE or H_PUT_TCE_INDIRECT
cases.

Fix this by accounting for 'npages', checking for arithmetic overflow,
and verifying that the entire requested range (ioba - offset + npages)
does not exceed the table capacity 'size'.

Fixes: b1af23d836 ("KVM: PPC: iommu: Unify TCE checking")
Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Tested-by: R Nageswara Sastry <rnsastry@linux.ibm.com>
Signed-off-by: Shivaprasad G Bhat <sbhat@linux.ibm.com>
Signed-off-by: Gautam Menghani <gautam@linux.ibm.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
2026-09-16 13:43:58 +05:30
..
boot powerpc updates for 7.3 2026-08-18 12:08:13 -07:00
configs TTY / Serial driver updates for 7.3-rc1 2026-08-25 10:59:12 -07:00
crypto crypto: powerpc/aes - use bool for encryption/decryption flag 2026-07-17 18:09:22 +10:00
include powerpc/entry: Fix double accounting of user time on interrupt entry 2026-09-10 08:58:10 +05:30
kernel powerpc/iommu: Fix the overflow validation in iommu_tce_check_ioba 2026-09-16 13:43:58 +05:30
kexec powerpc/kexec_file: print configured kernel command line 2026-09-10 13:15:26 +05:30
kvm KVM: PPC: Book3S HV: fix secure device page leak on uv_page_in() failure 2026-09-16 13:43:54 +05:30
lib powerpc: Remove dead non-preemption code 2026-07-15 08:04:13 +05:30
math-emu
mm mm.git review status for mm-hotfixes-stable..mm-stable 2026-08-20 18:17:08 -07:00
net powerpc64/bpf: Fix build break for arch_bpf_timed_may_goto 2026-08-03 14:11:27 +05:30
perf bitmap updates for v7.3 2026-08-20 11:41:46 -07:00
platforms powerpc/pasemi: Add a null pointer check to the pas_setup_mce_regs 2026-09-10 13:19:25 +05:30
purgatory Makefile: remove redundant tool coverage variables 2024-05-14 23:35:48 +09:00
sysdev treewide: refresh kmalloc_obj() conversions 2026-09-04 21:37:00 -07:00
tools powerpc64/ftrace: fix OOL stub count with clang 2026-03-07 16:02:25 +05:30
xmon powerpc/xmon: replace sizeof calculations with ARRAY_SIZE macro 2025-09-01 13:40:46 +05:30
Kbuild powerpc64/ftrace: Move ftrace sequence out of line 2024-10-31 11:00:54 +11:00
Kconfig VDSO updates: 2026-08-18 16:56:25 -07:00
Kconfig.debug powerpc: fix dead default for GUEST_STATE_BUFFER_TEST 2026-05-12 11:50:52 +05:30
Makefile powerpc: Enable Rust for ppc64le 2026-07-31 16:57:48 +05:30
Makefile.postlink powerpc/ftrace: Add a postlink script to validate function tracer 2024-10-31 11:00:54 +11:00