linux-stable/drivers/of
Zijun Hu 0f7ca6f693 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: b739dffa5d ("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>
2024-12-10 10:52:45 -06:00
..
unittest-data of/unittest: Add empty dma-ranges address translation tests 2024-11-27 09:18:04 -06:00
.kunitconfig of: Allow overlay kunit tests to run CONFIG_OF_OVERLAY=n 2024-11-15 14:03:28 -06:00
address.c of: Fix refcount leakage for OF node returned by __of_get_dma_parent() 2024-12-10 10:52:45 -06:00
base.c of: Fix error path in of_parse_phandle_with_args_map() 2024-12-03 11:31:19 -06:00
cpu.c of: Constify struct device_node function arguments 2024-10-15 08:58:36 -05:00
device.c OF: Simplify of_iommu_configure() 2024-07-04 14:36:04 +01:00
dynamic.c of: Constify of_changeset_entry function arguments 2024-10-15 08:58:36 -05:00
empty_root.dts of: Add #address-cells/#size-cells in the device-tree root empty node 2024-12-02 09:26:33 -06:00
fdt_address.c of/fdt: Don't use default address cell sizes for address translation 2024-11-08 13:15:54 -06:00
fdt.c of: WARN on deprecated #address-cells/#size-cells handling 2024-11-08 13:15:54 -06:00
irq.c of/irq: Fix using uninitialized variable @addr_len in API of_irq_parse_one() 2024-12-10 10:52:45 -06:00
Kconfig of: Allow overlay kunit tests to run CONFIG_OF_OVERLAY=n 2024-11-15 14:03:28 -06:00
kexec.c of/fdt: add dt_phys arg to early_init_dt_scan and early_init_dt_verify 2024-10-29 15:32:45 -05:00
kobj.c of: Constify safe_name() kobject arg 2024-10-15 08:58:36 -05:00
kunit_overlay_test.dtso of: Add a KUnit test for overlays and test managed APIs 2024-07-29 15:33:12 -07:00
Makefile of: Add a KUnit test for overlays and test managed APIs 2024-07-29 15:33:12 -07:00
module.c of: module: remove strlen() call in of_modalias() 2024-10-16 12:00:10 -05:00
of_kunit_helpers.c of: Skip kunit tests when arm64+ACPI doesn't populate root node 2024-10-10 12:43:01 -05:00
of_numa.c of:of_numa: remove unused macro 2024-10-08 09:47:30 -05:00
of_private.h Merge branch 'dt/linus' into dt/next 2024-11-15 14:03:59 -06:00
of_reserved_mem.c of: reserved_mem: Add code to dynamically allocate reserved_mem array 2024-10-15 10:34:33 -05:00
of_test.c of: Skip kunit tests when arm64+ACPI doesn't populate root node 2024-10-10 12:43:01 -05:00
overlay_test.c of: Allow overlay kunit tests to run CONFIG_OF_OVERLAY=n 2024-11-15 14:03:28 -06:00
overlay.c of: Constify struct property pointers 2024-10-15 08:58:36 -05:00
pdt.c of: Remove struct device_node.type pointer 2019-01-10 16:24:44 -06:00
platform.c The core clk framework is left largely untouched this time around except for 2024-09-23 15:01:48 -07:00
property.c of: property: fw_devlink: Do not use interrupt-parent directly 2024-11-25 08:24:17 -06:00
resolver.c of: Constify struct property pointers 2024-10-15 08:58:36 -05:00
unittest.c of/unittest: Add empty dma-ranges address translation tests 2024-11-27 09:18:04 -06:00