Skip to content
Commit 432dc065 authored by Andrei Vagin's avatar Andrei Vagin Committed by Andrew Morton
Browse files

ucounts: fix counter leak in inc_rlimit_get_ucounts()

The inc_rlimit_get_ucounts() increments the specified rlimit counter and
then checks its limit.  If the value exceeds the limit, the function
returns an error without decrementing the counter.

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


Fixes: 15bc01ef ("ucounts: Fix signal ucount refcounting")
Signed-off-by: default avatarAndrei Vagin <avagin@google.com>
Co-developed-by: default avatarRoman Gushchin <roman.gushchin@linux.dev>
Signed-off-by: default avatarRoman Gushchin <roman.gushchin@linux.dev>
Tested-by: default avatarRoman Gushchin <roman.gushchin@linux.dev>
Acked-by: default avatarAlexey Gladkov <legion@kernel.org>
Cc: Kees Cook <kees@kernel.org>
Cc: Andrei Vagin <avagin@google.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Alexey Gladkov <legion@kernel.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 0268d457
Loading
Loading
Loading
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