linux-stable/tools
Tiezhu Yang 4c004ed952 selftests/clone3: Fix broken test under !CONFIG_TIME_NS
commit fc7f04dc23 upstream.

When execute the following command to test clone3 under !CONFIG_TIME_NS:

  # make headers && cd tools/testing/selftests/clone3 && make && ./clone3

we can see the following error info:

  # [7538] Trying clone3() with flags 0x80 (size 0)
  # Invalid argument - Failed to create new process
  # [7538] clone3() with flags says: -22 expected 0
  not ok 18 [7538] Result (-22) is different than expected (0)
  ...
  # Totals: pass:18 fail:1 xfail:0 xpass:0 skip:0 error:0

This is because if CONFIG_TIME_NS is not set, but the flag
CLONE_NEWTIME (0x80) is used to clone a time namespace, it
will return -EINVAL in copy_time_ns().

If kernel does not support CONFIG_TIME_NS, /proc/self/ns/time
will be not exist, and then we should skip clone3() test with
CLONE_NEWTIME.

With this patch under !CONFIG_TIME_NS:

  # make headers && cd tools/testing/selftests/clone3 && make && ./clone3
  ...
  # Time namespaces are not supported
  ok 18 # SKIP Skipping clone3() with CLONE_NEWTIME
  ...
  # Totals: pass:18 fail:0 xfail:0 xpass:0 skip:1 error:0

Link: https://lkml.kernel.org/r/1689066814-13295-1-git-send-email-yangtiezhu@loongson.cn
Fixes: 515bddf0ec ("selftests/clone3: test clone3 with CLONE_NEWTIME")
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Shuah Khan <shuah@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-11-28 17:20:05 +00:00
..
accounting
arch seccomp fix for v6.6-rc7 2023-10-19 10:10:14 -07:00
bootconfig
bpf bpftool: Fix build warnings with -Wtype-limits 2023-08-30 08:39:00 +02:00
build tools build: Fix llvm feature detection, still used by bpftool 2023-10-19 22:33:58 -03:00
certs
cgroup
counter
crypto/ccp crypto: ccp - Fix some unfused tests 2023-11-20 11:59:18 +01:00
debugging
edid
firewire
firmware
gpio
hv hv/hv_kvp_daemon:Support for keyfile based connection profile 2023-10-10 03:42:29 +00:00
iio tools: iio: iio_generic_buffer ensure alignment 2023-11-20 11:59:26 +01:00
include 20 hotfixes. 12 are cc:stable and the remainder address post-6.5 issues 2023-10-24 09:52:16 -10:00
kvm/kvm_stat
laptop
leds
lib libperf rc_check: Make implicit enabling work for GCC 2023-11-20 11:59:29 +01:00
memory-model
mm tools/mm: fix undefined reference to pthread_once 2023-09-05 10:13:45 -07:00
net/ynl netlink: specs: devlink: fix reply command values 2023-10-13 17:27:27 -07:00
objtool objtool: Propagate early errors 2023-11-20 11:58:52 +01:00
pci
pcmcia
perf perf intel-pt: Fix async branch flags 2023-11-28 17:19:55 +00:00
power tools/power/turbostat: Enable the C-state Pre-wake printing 2023-11-28 17:19:54 +00:00
rcu
scripts
spi
testing selftests/clone3: Fix broken test under !CONFIG_TIME_NS 2023-11-28 17:20:05 +00:00
thermal
time
tracing rtla: Fix uninitialized variable found 2023-11-20 11:59:29 +01:00
usb
verification
virtio tools/virtio: Add dma sync api for virtio test 2023-10-16 05:32:23 -04:00
wmi
workqueue
Makefile