android_kernel_motorola_sm6375/drivers/of
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Sergey Shtylyov 46795440ef of: module: add buffer overflow check in of_modalias()
commit cf7385cb26ac4f0ee6c7385960525ad534323252 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-06-04 14:32:25 +02:00
..
unittest-data of: unittest: add overlay gpio test to catch gpio hog problem 2024-02-23 08:25:09 +01:00
address.c of: Fix refcount leakage for OF node returned by __of_get_dma_parent() 2025-01-09 13:23:30 +01:00
base.c of: Fix of_find_node_opts_by_path() handling of alias+path+options 2025-03-13 12:43:08 +01:00
device.c of: module: add buffer overflow check in of_modalias() 2025-06-04 14:32:25 +02:00
dynamic.c of: dynamic: Fix of_reconfig_get_state_change() return value documentation 2023-12-13 18:18:11 +01:00
fdt.c of: Add missing 'Return' section in kerneldoc comments 2023-12-13 18:18:11 +01:00
fdt_address.c
irq.c of/irq: Fix device node refcount leakages in of_irq_init() 2025-05-02 07:39:17 +02:00
Kconfig
kobj.c
Makefile
of_mdio.c
of_net.c
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:43:26 +01:00
overlay.c of: Add missing 'Return' section in kerneldoc comments 2023-12-13 18:18:11 +01:00
pdt.c
platform.c of: Add missing 'Return' section in kerneldoc comments 2023-12-13 18:18:11 +01:00
property.c of: Add missing 'Return' section in kerneldoc comments 2023-12-13 18:18:11 +01:00
resolver.c
unittest.c of: gpio unittest kfree() wrong object 2024-02-23 08:25:15 +01:00