mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-22 09:34:56 +02:00
selftests/mm: skip mlock tests if nobody user can't read it
If running from a directory that can't be read by unprivileged users, executing on-fault-test via the nobody user will fail. The kselftest build does give the file the correct permissions, but after being installed it might be in a directory without global execute permissions. Since the script can't safely fix that, just skip if it happens. Note that the stderr of the `ls` command is unfiltered meaning the user sees a "permission denied" error that can help inform them why the test was skipped. Link: https://lkml.kernel.org/r/20250311-mm-selftests-v4-11-dec210a658f5@google.com Signed-off-by: Brendan Jackman <jackmanb@google.com> Cc: Dev Jain <dev.jain@arm.com> Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Cc: Mateusz Guzik <mjguzik@gmail.com> Cc: Shuah Khan <shuah@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
committed by
Andrew Morton
parent
f896c6de83
commit
5d2146a335
@@ -353,7 +353,7 @@ echo "$nr_hugepgs" > /proc/sys/vm/nr_hugepages
|
||||
|
||||
CATEGORY="compaction" run_test ./compaction_test
|
||||
|
||||
if command -v sudo &> /dev/null;
|
||||
if command -v sudo &> /dev/null && sudo -u nobody ls ./on-fault-limit >/dev/null;
|
||||
then
|
||||
CATEGORY="mlock" run_test sudo -u nobody ./on-fault-limit
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user