diff options
| author | Zijun Hu <[email protected]> | 2024-12-09 13:25:02 +0000 |
|---|---|---|
| committer | Rob Herring (Arm) <[email protected]> | 2024-12-10 16:52:45 +0000 |
| commit | 0f7ca6f69354e0c3923bbc28c92d0ecab4d50a3e (patch) | |
| tree | 94234f740dfe1b4bd455d31746ae5d0bfeb7fda0 /drivers/firmware/psci/psci.c | |
| parent | of/irq: Fix interrupt-map cell length check in of_irq_parse_imap_parent() (diff) | |
| download | kernel-0f7ca6f69354e0c3923bbc28c92d0ecab4d50a3e.tar.gz kernel-0f7ca6f69354e0c3923bbc28c92d0ecab4d50a3e.zip | |
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: [email protected]
Signed-off-by: Zijun Hu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Rob Herring (Arm) <[email protected]>
Diffstat (limited to 'drivers/firmware/psci/psci.c')
0 files changed, 0 insertions, 0 deletions
