OSDN Git Service

selftests/memfd: fix test_sysctl
authorJeff Xu <jeffxu@google.com>
Fri, 14 Apr 2023 02:28:01 +0000 (02:28 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 18 Apr 2023 23:53:52 +0000 (16:53 -0700)
commit3cc0c3738cde66a1eadf977fa7b2fdecbbcf5d4f
tree14a64653acf3914c623bba28d17d6157038a5bf0
parentc025da0f14e80028de93f72976a0d81dafc17d03
selftests/memfd: fix test_sysctl

sysctl memfd_noexec is pid-namespaced, non-reservable, and inherent to the
child process.

Move the inherence test from init ns to child ns, so init ns can keep the
default value.

Link: https://lkml.kernel.org/r/20230414022801.2545257-1-jeffxu@google.com
Signed-off-by: Jeff Xu <jeffxu@google.com>
Reported-by: kernel test robot <yujie.liu@intel.com>
Link: https://lore.kernel.org/oe-lkp/202303312259.441e35db-yujie.liu@intel.com
Tested-by: Yujie Liu <yujie.liu@intel.com>
Cc: Daniel Verkamp <dverkamp@chromium.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Jann Horn <jannh@google.com>
Cc: Jorge Lucangeli Obes <jorgelo@chromium.org>
Cc: Kees Cook <keescook@chromium.org>
Cc: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
tools/testing/selftests/memfd/memfd_test.c