linux-stable/drivers/of
Sergey Shtylyov e4a449368a of: module: prevent NULL pointer dereference in vsnprintf()
commit a1aa5390cc upstream.

In of_modalias(), we can get passed the str and len parameters which would
cause a kernel oops in vsnprintf() since it only allows passing a NULL ptr
when the length is also 0. Also, we need to filter out the negative values
of the len parameter as these will result in a really huge buffer since
snprintf() takes size_t parameter while ours is ssize_t...

Found by Linux Verification Center (linuxtesting.org) with the Svace static
analysis tool.

Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/1d211023-3923-685b-20f0-f3f90ea56e1f@omp.ru
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-04-10 16:36:06 +02:00
..
unittest-data of: Fix double free in of_parse_phandle_with_args_map 2024-01-25 15:35:40 -08:00
address.c
base.c of: Fix double free in of_parse_phandle_with_args_map 2024-01-25 15:35:40 -08:00
cpu.c
device.c
dynamic.c of: dynamic: Synchronize of_changeset_destroy() with the devlink removals 2024-04-10 16:36:03 +02:00
fdt.c
fdt_address.c
irq.c
Kconfig
kexec.c
kobj.c
Makefile
module.c of: module: prevent NULL pointer dereference in vsnprintf() 2024-04-10 16:36:06 +02:00
of_numa.c
of_private.h
of_reserved_mem.c
overlay.c
pdt.c
platform.c
property.c of: property: fw_devlink: Fix stupid bug in remote-endpoint parsing 2024-03-06 14:48:39 +00:00
resolver.c
unittest.c of: unittest: Fix compile in the non-dynamic case 2024-02-23 09:24:49 +01:00