summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2023-01-21 20:17:23 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2023-01-21 20:17:23 +0100
commitc88a3114706429c9edf89e0bf2cd6757270c00f8 (patch)
treeb3546b4cd4fee72a150c70d262f89ba476811ce9 /kernel
parentMerge tag 'staging-6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/... (diff)
parentprlimit: do_prlimit needs to have a speculation check (diff)
downloadlinux-c88a3114706429c9edf89e0bf2cd6757270c00f8.tar.xz
linux-c88a3114706429c9edf89e0bf2cd6757270c00f8.zip
Merge tag 'driver-core-6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
Pull driver core fixes from Greg KH: "Here are three small driver and kernel core fixes for 6.2-rc5. They include: - potential gadget fixup in do_prlimit - device property refcount leak fix - test_async_probe bugfix for reported problem" * tag 'driver-core-6.2-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: prlimit: do_prlimit needs to have a speculation check driver core: Fix test_async_probe_init saves device in wrong array device property: fix of node refcount leak in fwnode_graph_get_next_endpoint()
Diffstat (limited to 'kernel')
-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;