summaryrefslogtreecommitdiff
path: root/tools/perf/scripts
diff options
context:
space:
mode:
authorBryam Vargas <hexlabsecurity@proton.me>2026-07-17 06:27:04 -0500
committerMikulas Patocka <mpatocka@redhat.com>2026-07-17 21:41:30 +0200
commit2df0fc042e299bae3c0f60ea5cd2af9285658e9f (patch)
treefcaee14db83ced1af928185f34d8f77ee3c02c6d /tools/perf/scripts
parent58d620ee9e01d4bdbceaf2ae1450d307a2a9d58b (diff)
dm-pcache: only hand out initialized cache segments
get_cache_segment() scans the segment map up to cache->n_segs, the physical device segment count, but cache_segs_init() only initializes the first cache_info->n_segs segments. A crafted image with cache_info->n_segs smaller than the device count leaves the remaining pcache_cache_segment structs zeroed (segment.data == NULL), and the allocator can hand one to cache_kset_close(), which writes through the returned segment's data pointer with no NULL check. Bound the allocator's search to cache_info->n_segs so only initialized segments are ever returned. A conforming cache sets n_segs equal to the device segment count, so this rejects nothing legitimate. Fixes: 1d57628ff95b ("dm-pcache: add persistent cache target in device-mapper") Cc: stable@vger.kernel.org Signed-off-by: Bryam Vargas <hexlabsecurity@proton.me> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Diffstat (limited to 'tools/perf/scripts')
0 files changed, 0 insertions, 0 deletions