]> www.infradead.org Git - users/jedix/linux-maple.git/commit
arm64: cacheinfo: Avoid out-of-bounds write to cacheinfo array
authorRadu Rendec <rrendec@redhat.com>
Thu, 6 Feb 2025 17:44:20 +0000 (12:44 -0500)
committerWill Deacon <will@kernel.org>
Fri, 7 Feb 2025 09:57:56 +0000 (09:57 +0000)
commit875d742cf5327c93cba1f11e12b08d3cce7a88d2
tree2e32e154192573e7e7bfd7eee3c6e20b3ce123c5
parentca0f4fe7cf7183bfbdc67ca2de56ae1fc3a8db2b
arm64: cacheinfo: Avoid out-of-bounds write to cacheinfo array

The loop that detects/populates cache information already has a bounds
check on the array size but does not account for cache levels with
separate data/instructions cache. Fix this by incrementing the index
for any populated leaf (instead of any populated level).

Fixes: 5d425c186537 ("arm64: kernel: add support for cpu cache information")
Signed-off-by: Radu Rendec <rrendec@redhat.com>
Link: https://lore.kernel.org/r/20250206174420.2178724-1-rrendec@redhat.com
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/kernel/cacheinfo.c