]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iio: backend: make sure to NULL terminate stack buffer
authorNuno Sá <nuno.sa@analog.com>
Tue, 18 Feb 2025 10:31:25 +0000 (10:31 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:39:23 +0000 (14:39 +0200)
commitdf3892e5e861c43d5612728ed259634675b8a71f
treef07af4ba50e7e8d0a4fb5e5fcbf8e39b5729f6a2
parent91cc7dca2a69366632ce19357155d3db29ceaed8
iio: backend: make sure to NULL terminate stack buffer

[ Upstream commit 035b4989211dc1c8626e186d655ae8ca5141bb73 ]

Make sure to NULL terminate the buffer in
iio_backend_debugfs_write_reg() before passing it to sscanf(). It is a
stack variable so we should not assume it will 0 initialized.

Fixes: cdf01e0809a4 ("iio: backend: add debugFs interface")
Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20250218-dev-iio-misc-v1-1-bf72b20a1eb8@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iio/industrialio-backend.c