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
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
] 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
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
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
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 ++
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