Commit e3cd170b authored by Andrei Vagin's avatar Andrei Vagin Committed by Greg Kroah-Hartman
Browse files

ucounts: fix counter leak in inc_rlimit_get_ucounts()

commit 432dc065 upstream.

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>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent dcc8fe8c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment