diff options
| author | Rosen Penev <rosenp@gmail.com> | 2026-07-29 10:46:46 +0100 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-07-31 14:15:54 +0200 |
| commit | a67e2c323a47a2254ed3472b5e4c53abac20f116 (patch) | |
| tree | eb2815b5859dc68928483eb45bb01acaef334490 /tools/perf/scripts/python | |
| parent | fde46579cf8872138b296349c2bd8a3cd3f132e2 (diff) | |
nvmem: brcm_nvram: fix out-of-bounds access on malformed flash data
The length check in brcm_nvram_parse() validated header->len against
priv->nvmem_size (the full partition size) instead of priv->data_len
(the actual allocated data buffer). A malformed flash partition with
header->len between the two would pass the check, causing
brcm_nvram_add_cells() to read and write priv->data[len - 1] beyond
the heap allocation.
Also add a minimum bound: len < sizeof(*header) could underflow the
data[len - 1] access.
Fix both bounds by rejecting len outside [sizeof(*header), priv->data_len].
Assisted-by: opencode:big-pickle
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Srinivas Kandagatla <srini@kernel.org>
Link: https://patch.msgid.link/20260729094647.111468-14-srini@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
