summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorTycho Andersen (AMD) <tycho@kernel.org>2026-04-08 08:32:57 -0600
committerHerbert Xu <herbert@gondor.apana.org.au>2026-05-07 16:09:58 +0800
commit1b864b6cb213bbd7b406e9b2e98c962077f300df (patch)
tree63f7488aeb8c3fb7823c3df84ae154e6b361dd8f /tools/perf/scripts/python
parent4a76a164ba1617f60d1c8a2fd754466c9d9e48e9 (diff)
crypto: ccp - Fix snp_filter_reserved_mem_regions() off-by-one
Sashiko notes: > regarding the bounds check in snp_filter_reserved_mem_regions() > called via walk_iomem_res_desc(): does the check > if ((range_list->num_elements * 16 + 8) > PAGE_SIZE) > allow an off-by-one heap buffer overflow? > > If range_list->num_elements is 255, 255 * 16 + 8 = 4088, which is <= 4096. > Writing range->base (8 bytes) fills 4088-4095, but writing range->page_count > (4 bytes) would write to 4096-4099, overflowing the kzalloc-allocated > PAGE_SIZE buffer. Fix this by accounting for the entry about to be written to, in addition to the entries that are already allocated. Fixes: 1ca5614b84ee ("crypto: ccp: Add support to initialize the AMD-SP for SEV-SNP") Reported-by: Sashiko Assisted-by: Gemini:gemini-3.1-pro-preview Link: https://sashiko.dev/#/patchset/20260324161301.1353976-1-tycho%40kernel.org Signed-off-by: Tycho Andersen (AMD) <tycho@kernel.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions