diff options
author | Nicolas Bouchinet <nicolas.bouchinet@ssi.gouv.fr> | 2025-01-15 16:22:08 +0300 |
---|---|---|
committer | Joel Granados <joel.granados@kernel.org> | 2025-02-17 13:33:46 +0300 |
commit | 049439e22825507a90d4dedf3934e24fd0a8ff62 (patch) | |
tree | 6a0c94cd8fbdc31d357039dedc175e25dcd708ab /tools/perf/scripts/python/stackcollapse.py | |
parent | dccf3c99febf09890d7fa99b8529f021d46787f9 (diff) | |
download | linux-049439e22825507a90d4dedf3934e24fd0a8ff62.tar.xz |
coredump: Fixes core_pipe_limit sysctl proc_handler
proc_dointvec converts a string to a vector of signed int, which is
stored in the unsigned int .data core_pipe_limit.
It was thus authorized to write a negative value to core_pipe_limit
sysctl which once stored in core_pipe_limit, leads to the signed int
dump_count check against core_pipe_limit never be true. The same can be
achieved with core_pipe_limit set to INT_MAX.
Any negative write or >= to INT_MAX in core_pipe_limit sysctl would
hypothetically allow a user to create very high load on the system by
running processes that produces a coredump in case the core_pattern
sysctl is configured to pipe core files to user space helper.
Memory or PID exhaustion should happen before but it anyway breaks the
core_pipe_limit semantic.
This commit fixes this by changing core_pipe_limit sysctl's proc_handler
to proc_dointvec_minmax and bound checking between SYSCTL_ZERO and
SYSCTL_INT_MAX.
Fixes: a293980c2e26 ("exec: let do_coredump() limit the number of concurrent dumps to pipes")
Signed-off-by: Nicolas Bouchinet <nicolas.bouchinet@ssi.gouv.fr>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Kees Cook <kees@kernel.org>
Signed-off-by: Joel Granados <joel.granados@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions