]> git.baikalelectronics.ru Git - kernel.git/commit
ucounts: Handle wrapping in is_ucounts_overlimit
authorEric W. Biederman <ebiederm@xmission.com>
Thu, 10 Feb 2022 00:09:41 +0000 (18:09 -0600)
committerEric W. Biederman <ebiederm@xmission.com>
Thu, 17 Feb 2022 15:11:57 +0000 (09:11 -0600)
commit5d8a81f50a59a4112507a1f1b72aa6194d2e5be0
treed00fdbcb46cfce60dfe064db7b6a8dc2568da262
parent74d4e191218a9046a6df03629292017f235ac67d
ucounts: Handle wrapping in is_ucounts_overlimit

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: 96a6f980d813 ("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>
kernel/ucount.c