]> git.baikalelectronics.ru Git - kernel.git/commit
ucounts: Split rlimit and ucount values and max values
authorAlexey Gladkov <legion@kernel.org>
Wed, 18 May 2022 17:17:30 +0000 (19:17 +0200)
committerEric W. Biederman <ebiederm@xmission.com>
Wed, 18 May 2022 23:24:57 +0000 (18:24 -0500)
commit3003a4c08c9cc9e1ab701c98b4fc9009433a926b
treed30c255670e8a29f49c2e26b6c543527ff03fbac
parent6d94017b7b59bab528be97be158d0d602982e3a6
ucounts: Split rlimit and ucount values and max values

Since the semantics of maximum rlimit values are different, it would be
better not to mix ucount and rlimit values. This will prevent the error
of using inc_count/dec_ucount for rlimit parameters.

This patch also renames the functions to emphasize the lack of
connection between rlimit and ucount.

v3:
- Fix BUG:KASAN:use-after-free_in_dec_ucount.

v2:
- Fix the array-index-out-of-bounds that was found by the lkp project.

Reported-by: kernel test robot <oliver.sang@intel.com>
Signed-off-by: Alexey Gladkov <legion@kernel.org>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Link: https://lkml.kernel.org/r/20220518171730.l65lmnnjtnxnftpq@example.org
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
fs/exec.c
fs/proc/array.c
include/linux/user_namespace.h
kernel/fork.c
kernel/sys.c
kernel/ucount.c
kernel/user_namespace.c