Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

prlimit: do_prlimit needs to have a speculation check

do_prlimit() adds the user-controlled resource value to a pointer that
will subsequently be dereferenced. In order to help prevent this
codepath from being used as a spectre "gadget" a barrier needs to be
added after checking the range.

Reported-by: Jordy Zomer <jordyzomer@google.com>
Tested-by: Jordy Zomer <jordyzomer@google.com>
Suggested-by: Linus Torvalds <torvalds@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+2
+2
kernel/sys.c
··· 1442 1442 1443 1443 if (resource >= RLIM_NLIMITS) 1444 1444 return -EINVAL; 1445 + resource = array_index_nospec(resource, RLIM_NLIMITS); 1446 + 1445 1447 if (new_rlim) { 1446 1448 if (new_rlim->rlim_cur > new_rlim->rlim_max) 1447 1449 return -EINVAL;