summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorNandakumar Edamana <nandakumar@nandakumar.co.in>2025-02-22 02:31:11 +0530
committerAndrii Nakryiko <andrii@kernel.org>2025-02-24 13:58:41 -0800
commit236d3910117e9f97ebf75e511d8bcc950f1a4e5f (patch)
tree1b64ac9dc93e2b6c954f165ddf7bd83199d0eb27 /tools/perf/scripts/python
parent11ba7ce076e5903e7bdc1fd1498979c331b3c286 (diff)
libbpf: Fix out-of-bound read
In `set_kcfg_value_str`, an untrusted string is accessed with the assumption that it will be at least two characters long due to the presence of checks for opening and closing quotes. But the check for the closing quote (value[len - 1] != '"') misses the fact that it could be checking the opening quote itself in case of an invalid input that consists of just the opening quote. This commit adds an explicit check to make sure the string is at least two characters long. Signed-off-by: Nandakumar Edamana <nandakumar@nandakumar.co.in> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20250221210110.3182084-1-nandakumar@nandakumar.co.in
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions