Skip to content
Snippets Groups Projects
Commit 9e05e5c7 authored by Roman Gushchin's avatar Roman Gushchin Committed by Andrew Morton
Browse files

signal: restore the override_rlimit logic

Prior to commit d6469690 ("Reimplement RLIMIT_SIGPENDING on top of
ucounts") UCOUNT_RLIMIT_SIGPENDING rlimit was not enforced for a class of
signals.  However now it's enforced unconditionally, even if
override_rlimit is set.  This behavior change caused production issues.  

For example, if the limit is reached and a process receives a SIGSEGV
signal, sigqueue_alloc fails to allocate the necessary resources for the
signal delivery, preventing the signal from being delivered with siginfo. 
This prevents the process from correctly identifying the fault address and
handling the error.  From the user-space perspective, applications are
unaware that the limit has been reached and that the siginfo is
effectively 'corrupted'.  This can lead to unpredictable behavior and
crashes, as we observed with java applications.

Fix this by passing override_rlimit into inc_rlimit_get_ucounts() and skip
the comparison to max there if override_rlimit is set.  This effectively
restores the old behavior.

Link: https://lkml.kernel.org/r/20241104195419.3962584-1-roman.gushchin@linux.dev


Fixes: d6469690 ("Reimplement RLIMIT_SIGPENDING on top of ucounts")
Signed-off-by: default avatarRoman Gushchin <roman.gushchin@linux.dev>
Co-developed-by: default avatarAndrei Vagin <avagin@google.com>
Signed-off-by: default avatarAndrei Vagin <avagin@google.com>
Acked-by: default avatarOleg Nesterov <oleg@redhat.com>
Acked-by: default avatarAlexey Gladkov <legion@kernel.org>
Cc: Kees Cook <kees@kernel.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent b8ee2998
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment