aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
diff options
context:
space:
mode:
authorEric W. Biederman <[email protected]>2022-02-10 02:03:19 +0000
committerEric W. Biederman <[email protected]>2022-02-17 15:10:33 +0000
commit8f2f9c4d82f24f172ae439e5035fc1e0e4c229dd (patch)
tree89f629832dec4edfe14a82a78ac5b377871bbca7 /drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
parentrlimit: Fix RLIMIT_NPROC enforcement failure caused by capability calls in se... (diff)
downloadkernel-8f2f9c4d82f24f172ae439e5035fc1e0e4c229dd.tar.gz
kernel-8f2f9c4d82f24f172ae439e5035fc1e0e4c229dd.zip
ucounts: Enforce RLIMIT_NPROC not RLIMIT_NPROC+1
Michal Koutný <[email protected]> wrote: > It was reported that v5.14 behaves differently when enforcing > RLIMIT_NPROC limit, namely, it allows one more task than previously. > This is consequence of the commit 21d1c5e386bc ("Reimplement > RLIMIT_NPROC on top of ucounts") that missed the sharpness of > equality in the forking path. This can be fixed either by fixing the test or by moving the increment to be before the test. Fix it my moving copy_creds which contains the increment before is_ucounts_overlimit. In the case of CLONE_NEWUSER the ucounts in the task_cred changes. The function is_ucounts_overlimit needs to use the final version of the ucounts for the new process. Which means moving the is_ucounts_overlimit test after copy_creds is necessary. Both the test in fork and the test in set_user were semantically changed when the code moved to ucounts. The change of the test in fork was bad because it was before the increment. The test in set_user was wrong and the change to ucounts fixed it. So this fix only restores the old behavior in one lcation not two. Link: https://lkml.kernel.org/r/[email protected] Link: https://lkml.kernel.org/r/[email protected] Cc: [email protected] Reported-by: Michal Koutný <[email protected]> Reviewed-by: Michal Koutný <[email protected]> Fixes: 21d1c5e386bc ("Reimplement RLIMIT_NPROC on top of ucounts") Signed-off-by: "Eric W. Biederman" <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c')
0 files changed, 0 insertions, 0 deletions