From 054498a6477a09c9b04c456c3e77525952d8312c Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 18 Dec 2025 15:08:55 +0000 Subject: [PATCH] prlimit: do_prlimit needs to have a speculation check --- kernel/sys.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/sys.c b/kernel/sys.c index a7f823224546..863a8c24a2d8 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -1368,6 +1368,8 @@ 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;