summaryrefslogtreecommitdiff
path: root/kernel/sys.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-01-22 12:55:13 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-01-22 12:55:13 +0100
commit7a6aa989f2e844a22cfab5c8ff30e77d17dabb2f (patch)
treedd9c0dac74d0839fd0dd2fd24a59504d5180343a /kernel/sys.c
parent05e2600cb0a4d73b0779cf29512819616252aeeb (diff)
parent2241ab53cbb5cdb08a6b2d4688feb13971058f65 (diff)
Merge 6.2-rc5 into tty-next
We need the serial/tty changes into this branch as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel/sys.c')
-rw-r--r--kernel/sys.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/sys.c b/kernel/sys.c
index 5fd54bf0e886..88b31f096fb2 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -1442,6 +1442,8 @@ static int do_prlimit(struct task_struct *tsk, unsigned int resource,
if (resource >= RLIM_NLIMITS)
return -EINVAL;
+ resource = array_index_nospec(resource, RLIM_NLIMITS);
+
if (new_rlim) {
if (new_rlim->rlim_cur > new_rlim->rlim_max)
return -EINVAL;