linux-yocto/drivers/of
Sergey Shtylyov 5d59fd637a of: module: add buffer overflow check in of_modalias()
commit cf7385cb26 upstream.

In of_modalias(), if the buffer happens to be too small even for the 1st
snprintf() call, the len parameter will become negative and str parameter
(if not NULL initially) will point beyond the buffer's end. Add the buffer
overflow check after the 1st snprintf() call and fix such check after the
strlen() call (accounting for the terminating NUL char).

Fixes: bc575064d6 ("of/device: use of_property_for_each_string to parse compatible strings")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Link: https://lore.kernel.org/r/bbfc6be0-c687-62b6-d015-5141b93f313e@omp.ru
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Uwe Kleine-König <ukleinek@debian.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-05-02 07:47:08 +02:00
..
unittest-data of/address: Add support for 3 address cell bus 2025-01-17 13:34:47 +01:00
address.c of: address: Preserve the flags portion on 1:1 dma-ranges mapping 2025-01-17 13:34:48 +01:00
base.c of: Fix of_find_node_opts_by_path() handling of alias+path+options 2025-02-21 13:49:42 +01:00
device.c of: module: add buffer overflow check in of_modalias() 2025-05-02 07:47:08 +02:00
dynamic.c
fdt_address.c
fdt.c
irq.c of/irq: Fix device node refcount leakages in of_irq_init() 2025-04-25 10:43:46 +02:00
Kconfig
kexec.c
kobj.c
Makefile
of_numa.c
of_private.h
of_reserved_mem.c Revert "of: reserved-memory: Fix using wrong number of cells to get property 'alignment'" 2025-03-13 12:53:11 +01:00
overlay.c
pdt.c
platform.c
property.c
resolver.c of: resolver: Fix device node refcount leakage in of_resolve_phandles() 2025-05-02 07:46:52 +02:00
unittest.c of/address: Add support for 3 address cell bus 2025-01-17 13:34:47 +01:00