summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/bin
diff options
context:
space:
mode:
authorSamuel Moelius <sam.moelius@trailofbits.com>2026-07-15 00:18:00 +0000
committerMikulas Patocka <mpatocka@redhat.com>2026-07-15 15:48:11 +0200
commit00211ede62facec2915a7e6cfc17f8ce987a0078 (patch)
tree1add0ed81bf61ba5c4fa837e5695c3606997fd23 /tools/perf/scripts/python/bin
parent34dcadff8b70c409724506fbb42c366e3da2f5c8 (diff)
dm cache: parse invalidate_cblocks with kstrtouint()
invalidate_cblocks parses cache block numbers with sscanf() and then stores them in the narrower dm_cblock_t type. Values larger than the cblock representation are truncated before invalidation, so a request for one cache block can invalidate a different block. Checking the parsed value after sscanf() is not sufficient because sscanf() does not reliably reject values beyond U64_MAX before storing into the destination. Such inputs can still be converted to a wrapped u64 value and then pass a later range check. Split ranges in place and parse each single value or range endpoint directly with kstrtouint() instead. This rejects malformed values and values that do not fit in dm_cblock_t before they can be converted to cblock values. The existing range validation continues to reject empty or out-of-cache ranges, including the single-value U32_MAX case whose exclusive end wraps to zero. Assisted-by: Codex:gpt-5.5-cyber-preview Signed-off-by: Samuel Moelius <sam.moelius@trailofbits.com> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Reviewed-by: Ming-Hung Tsai <mtsai@redhat.com>
Diffstat (limited to 'tools/perf/scripts/python/bin')
0 files changed, 0 insertions, 0 deletions