[PATCH v4 1/6] iio: backend: fix out-of-bound write

2025-05-08 Thread Markus Burri
ND. Add a check that the given buffer is smaller then the buffer to prevent. Fixes: 035b4989211d ("iio: backend: make sure to NULL terminate stack buffer") Signed-off-by: Markus Burri --- drivers/iio/industrialio-backend.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff

[PATCH v4 5/6] powerpc/eeh: fix potential OoB

2025-05-08 Thread Markus Burri
ned-off-by: Markus Burri --- arch/powerpc/kernel/eeh.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c index 83fe99861eb1..92ef05d3678d 100644 --- a/arch/powerpc/kernel/eeh.c +++ b/arch/powerpc/kernel/eeh.c @@ -1734,1

[PATCH v4 0/6] Fix potential out-of-bounds error in some drivers

2025-05-08 Thread Markus Burri
] https://lore.kernel.org/lkml/20250501063240.25295-1-markus.bu...@mt.com/ Markus Burri (6): iio: backend: fix out-of-bound write accel/ivpu: Use effective buffer size for zero terminator iio: fix potential out-of-bound write gpio: fix potential out-of-bound write powerpc/eeh: fix

[PATCH v4 2/6] accel/ivpu: Use effective buffer size for zero terminator

2025-05-08 Thread Markus Burri
Use the effective written size instead of original size as index for zero termination. If the input from user-space is to larger and the input is truncated, the original size is out-of-bound. Since there is an upfront size check here, the change is for consistency. Signed-off-by: Markus Burri

[PATCH v4 6/6] powerpc/eeh-powernv: fix potential OoB

2025-05-08 Thread Markus Burri
ned-off-by: Markus Burri --- arch/powerpc/platforms/powernv/eeh-powernv.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/powernv/eeh-powernv.c b/arch/powerpc/platforms/powernv/eeh-powernv.c index db3370d1673c..3abee21fdd05 100644 --- a/ar

[PATCH v4 4/6] gpio: fix potential out-of-bound write

2025-05-08 Thread Markus Burri
Check that the input size does not exceed the buffer size. If a caller write more characters, count is truncated to the max available space in "simple_write_to_buffer". Write a zero termination afterwards. Signed-off-by: Markus Burri --- drivers/gpio/gpio-virtuser.c | 12 ++

[PATCH v4 3/6] iio: fix potential out-of-bound write

2025-05-08 Thread Markus Burri
ned-off-by: Markus Burri --- drivers/iio/industrialio-core.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c index b9f4113ae5fc..ebf17ea5a5f9 100644 --- a/drivers/iio/industrialio-core.c +++ b/drivers/iio/in