]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit - kernel/ucount.c
ucounts: Handle wrapping in is_ucounts_overlimit
authorEric W. Biederman <ebiederm@xmission.com>
Thu, 10 Feb 2022 00:09:41 +0000 (18:09 -0600)
committerPaolo Pisati <paolo.pisati@canonical.com>
Mon, 7 Mar 2022 10:44:16 +0000 (11:44 +0100)
commit1d4332f4199104711abe1b566467b6335c29b150
tree10cd70dc742de7dc696beceac6f0bf3d0b415d4b
parent1bbc190501a723211bbde8d80c8959ed85880ea9
ucounts: Handle wrapping in is_ucounts_overlimit

BugLink: https://bugs.launchpad.net/bugs/1963890
commit 0cbae9e24fa7d6c6e9f828562f084da82217a0c5 upstream.

While examining is_ucounts_overlimit and reading the various messages
I realized that is_ucounts_overlimit fails to deal with counts that
may have wrapped.

Being wrapped should be a transitory state for counts and they should
never be wrapped for long, but it can happen so handle it.

Cc: stable@vger.kernel.org
Fixes: 21d1c5e386bc ("Reimplement RLIMIT_NPROC on top of ucounts")
Link: https://lkml.kernel.org/r/20220216155832.680775-5-ebiederm@xmission.com
Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
kernel/ucount.c