Files
linux-stable-mirror/kernel
Marc BuergandGreg Kroah-Hartman 1682c442af sysctl: fix uninitialized variable in proc_do_large_bitmap
[ Upstream commit f63a9df7e3 ]

proc_do_large_bitmap() does not initialize variable c, which is expected
to be set to a trailing character by proc_get_long().

However, proc_get_long() only sets c when the input buffer contains a
trailing character after the parsed value.

If c is not initialized it may happen to contain a '-'. If this is the
case proc_do_large_bitmap() expects to be able to parse a second part of
the input buffer. If there is no second part an unjustified -EINVAL will
be returned.

Initialize c to 0 to prevent returning -EINVAL on valid input.

Fixes: 9f977fb7ae ("sysctl: add proc_do_large_bitmap")
Signed-off-by: Marc Buerg <buermarc@googlemail.com>
Reviewed-by: Joel Granados <joel.granados@kernel.org>
Signed-off-by: Joel Granados <joel.granados@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2026-04-18 10:31:06 +02:00
..
2025-12-07 06:08:19 +09:00
2025-03-13 12:47:35 +01:00
2023-12-20 15:44:30 +01:00
2025-06-27 11:04:24 +01:00
2026-04-18 10:30:52 +02:00
2023-01-14 10:15:20 +01:00
2024-10-17 15:08:12 +02:00