diff options
author | Zijun Hu <quic_zijuhu@quicinc.com> | 2024-12-09 16:25:02 +0300 |
---|---|---|
committer | Rob Herring (Arm) <robh@kernel.org> | 2024-12-10 19:52:45 +0300 |
commit | 0f7ca6f69354e0c3923bbc28c92d0ecab4d50a3e (patch) | |
tree | 94234f740dfe1b4bd455d31746ae5d0bfeb7fda0 /tools/perf/scripts/python/stackcollapse.py | |
parent | fec3edc47d5cfc2dd296a5141df887bf567944db (diff) | |
download | linux-0f7ca6f69354e0c3923bbc28c92d0ecab4d50a3e.tar.xz |
of/irq: Fix using uninitialized variable @addr_len in API of_irq_parse_one()
of_irq_parse_one() may use uninitialized variable @addr_len as shown below:
// @addr_len is uninitialized
int addr_len;
// This operation does not touch @addr_len if it fails.
addr = of_get_property(device, "reg", &addr_len);
// Use uninitialized @addr_len if the operation fails.
if (addr_len > sizeof(addr_buf))
addr_len = sizeof(addr_buf);
// Check the operation result here.
if (addr)
memcpy(addr_buf, addr, addr_len);
Fix by initializing @addr_len before the operation.
Fixes: b739dffa5d57 ("of/irq: Prevent device address out-of-bounds read in interrupt map walk")
Cc: stable@vger.kernel.org
Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
Link: https://lore.kernel.org/r/20241209-of_irq_fix-v1-4-782f1419c8a1@quicinc.com
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions