[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20200918030627.GA26795@xsang-OptiPlex-9020>
Date: Fri, 18 Sep 2020 11:06:27 +0800
From: kernel test robot <oliver.sang@...el.com>
To: Kees Cook <keescook@...omium.org>
Cc: Shuah Khan <skhan@...uxfoundation.org>,
LKML <linux-kernel@...r.kernel.org>, lkp@...ts.01.org,
lkp@...el.com
Subject: [selftests/exec] 61016db15b: kernel-selftests.exec.make_fail
Greeting,
FYI, we noticed the following commit (built with gcc-9):
commit: 61016db15b8e20f371352db6a75b044ec3183fe7 ("selftests/exec: Verify execve of non-regular files fail")
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git master
in testcase: kernel-selftests
version: kernel-selftests-x86_64-e8e8f16e-1_20200807
with following parameters:
group: kselftests-01
test-description: The kernel contains a set of "self tests" under the tools/testing/selftests/ directory. These are intended to be small unit tests to exercise individual code paths in the kernel.
test-url: https://www.kernel.org/doc/Documentation/kselftest.txt
on test machine: qemu-system-x86_64 -enable-kvm -cpu SandyBridge -smp 2 -m 8G
caused below changes (please refer to attached dmesg/kmsg for entire log/backtrace):
If you fix the issue, kindly add following tag
Reported-by: kernel test robot <oliver.sang@...el.com>
besides below full log, here is a simple reproducer -
xsang@...ng-OptiPlex-9020:~/kernel-upstream/linux/tools/testing/selftests/exec$ make clean
...
xsang@...ng-OptiPlex-9020:~/kernel-upstream/linux/tools/testing/selftests/exec$ ls pipe
ls: cannot access 'pipe': No such file or directory
xsang@...ng-OptiPlex-9020:~/kernel-upstream/linux/tools/testing/selftests/exec$ make
...
cd /home/xsang/kernel-upstream/linux/tools/testing/selftests/exec && ln -s -f execveat execveat.symlink
cp /home/xsang/kernel-upstream/linux/tools/testing/selftests/exec/execveat /home/xsang/kernel-upstream/linux/tools/testing/selftests/exec/execveat.denatured
chmod -x /home/xsang/kernel-upstream/linux/tools/testing/selftests/exec/execveat.denatured
echo '#!/bin/sh' > /home/xsang/kernel-upstream/linux/tools/testing/selftests/exec/script
echo 'exit $*' >> /home/xsang/kernel-upstream/linux/tools/testing/selftests/exec/script
chmod +x /home/xsang/kernel-upstream/linux/tools/testing/selftests/exec/script
mkdir -p /home/xsang/kernel-upstream/linux/tools/testing/selftests/exec/subdir
make: *** No rule to make target '/home/xsang/kernel-upstream/linux/tools/testing/selftests/exec/pipe', needed by 'all'. Stop.
xsang@...ng-OptiPlex-9020:~/kernel-upstream/linux/tools/testing/selftests/exec$ echo $?
2
As above, 'pipe' is parsed as a file since no further rule in Makefile for it, but there is no this file, then 'make' complains an error and 'Stop'.
As an contrast,
xsang@...ng-OptiPlex-9020:~/kernel-upstream/linux/tools/testing/selftests/exec$ make clean
...
xsang@...ng-OptiPlex-9020:~/kernel-upstream/linux/tools/testing/selftests/exec$ touch pipe
xsang@...ng-OptiPlex-9020:~/kernel-upstream/linux/tools/testing/selftests/exec$ make
...
cd /home/xsang/kernel-upstream/linux/tools/testing/selftests/exec && ln -s -f execveat execveat.symlink
cp /home/xsang/kernel-upstream/linux/tools/testing/selftests/exec/execveat /home/xsang/kernel-upstream/linux/tools/testing/selftests/exec/execveat.denatured
chmod -x /home/xsang/kernel-upstream/linux/tools/testing/selftests/exec/execveat.denatured
echo '#!/bin/sh' > /home/xsang/kernel-upstream/linux/tools/testing/selftests/exec/script
echo 'exit $*' >> /home/xsang/kernel-upstream/linux/tools/testing/selftests/exec/script
chmod +x /home/xsang/kernel-upstream/linux/tools/testing/selftests/exec/script
mkdir -p /home/xsang/kernel-upstream/linux/tools/testing/selftests/exec/subdir
xsang@...ng-OptiPlex-9020:~/kernel-upstream/linux/tools/testing/selftests/exec$ echo $?
0
below are detail log in robot building
KERNEL SELFTESTS: linux_headers_dir is /usr/src/linux-headers-x86_64-rhel-7.6-kselftests-61016db15b8e20f371352db6a75b044ec3183fe7
2020-09-17 15:34:36 ln -sf /usr/bin/clang
2020-09-17 15:34:36 ln -sf /usr/bin/llc
....
2020-09-17 15:35:25 make run_tests -C exec
make: Entering directory '/usr/src/perf_selftests-x86_64-rhel-7.6-kselftests-61016db15b8e20f371352db6a75b044ec3183fe7/tools/testing/selftests/exec'
gcc -Wall -Wno-nonnull -D_GNU_SOURCE execveat.c /usr/src/perf_selftests-x86_64-rhel-7.6-kselftests-61016db15b8e20f371352db6a75b044ec3183fe7/tools/testing/selftests/kselftest_harness.h /usr/src/perf_selftests-x86_64-rhel-7.6-kselftests-61016db15b8e20f371352db6a75b044ec3183fe7/tools/testing/selftests/kselftest.h -o /usr/src/perf_selftests-x86_64-rhel-7.6-kselftests-61016db15b8e20f371352db6a75b044ec3183fe7/tools/testing/selftests/exec/execveat
/usr/src/perf_selftests-x86_64-rhel-7.6-kselftests-61016db15b8e20f371352db6a75b044ec3183fe7/tools/testing/selftests/kselftest_harness.h:53: warning: "_GNU_SOURCE" redefined
#define _GNU_SOURCE
<command-line>: note: this is the location of the previous definition
gcc -Wall -Wno-nonnull -D_GNU_SOURCE recursion-depth.c /usr/src/perf_selftests-x86_64-rhel-7.6-kselftests-61016db15b8e20f371352db6a75b044ec3183fe7/tools/testing/selftests/kselftest_harness.h /usr/src/perf_selftests-x86_64-rhel-7.6-kselftests-61016db15b8e20f371352db6a75b044ec3183fe7/tools/testing/selftests/kselftest.h -o /usr/src/perf_selftests-x86_64-rhel-7.6-kselftests-61016db15b8e20f371352db6a75b044ec3183fe7/tools/testing/selftests/exec/recursion-depth
/usr/src/perf_selftests-x86_64-rhel-7.6-kselftests-61016db15b8e20f371352db6a75b044ec3183fe7/tools/testing/selftests/kselftest_harness.h:53: warning: "_GNU_SOURCE" redefined
#define _GNU_SOURCE
<command-line>: note: this is the location of the previous definition
cd /usr/src/perf_selftests-x86_64-rhel-7.6-kselftests-61016db15b8e20f371352db6a75b044ec3183fe7/tools/testing/selftests/exec && ln -s -f execveat execveat.symlink
cp /usr/src/perf_selftests-x86_64-rhel-7.6-kselftests-61016db15b8e20f371352db6a75b044ec3183fe7/tools/testing/selftests/exec/execveat /usr/src/perf_selftests-x86_64-rhel-7.6-kselftests-61016db15b8e20f371352db6a75b044ec3183fe7/tools/testing/selftests/exec/execveat.denatured
chmod -x /usr/src/perf_selftests-x86_64-rhel-7.6-kselftests-61016db15b8e20f371352db6a75b044ec3183fe7/tools/testing/selftests/exec/execveat.denatured
echo '#!/bin/sh' > /usr/src/perf_selftests-x86_64-rhel-7.6-kselftests-61016db15b8e20f371352db6a75b044ec3183fe7/tools/testing/selftests/exec/script
echo 'exit $*' >> /usr/src/perf_selftests-x86_64-rhel-7.6-kselftests-61016db15b8e20f371352db6a75b044ec3183fe7/tools/testing/selftests/exec/script
chmod +x /usr/src/perf_selftests-x86_64-rhel-7.6-kselftests-61016db15b8e20f371352db6a75b044ec3183fe7/tools/testing/selftests/exec/script
mkdir -p /usr/src/perf_selftests-x86_64-rhel-7.6-kselftests-61016db15b8e20f371352db6a75b044ec3183fe7/tools/testing/selftests/exec/subdir
make: *** No rule to make target '/usr/src/perf_selftests-x86_64-rhel-7.6-kselftests-61016db15b8e20f371352db6a75b044ec3183fe7/tools/testing/selftests/exec/pipe', needed by 'all'. Stop.
make: Leaving directory '/usr/src/perf_selftests-x86_64-rhel-7.6-kselftests-61016db15b8e20f371352db6a75b044ec3183fe7/tools/testing/selftests/exec'
....
To reproduce:
# build kernel
cd linux
cp config-5.7.0-rc5-00002-g61016db15b8e2 .config
make HOSTCC=gcc-9 CC=gcc-9 ARCH=x86_64 olddefconfig prepare modules_prepare bzImage
git clone https://github.com/intel/lkp-tests.git
cd lkp-tests
bin/lkp qemu -k <bzImage> job-script # job-script is attached in this email
Thanks,
Oliver Sang
View attachment "config-5.7.0-rc5-00002-g61016db15b8e2" of type "text/plain" (205041 bytes)
View attachment "job-script" of type "text/plain" (6400 bytes)
Download attachment "dmesg.xz" of type "application/x-xz" (61700 bytes)
View attachment "kernel-selftests" of type "text/plain" (168644 bytes)
Powered by blists - more mailing lists