selftests/landlock: Fully test file rename with "remove" access
authorMickaël Salaün <mic@digikod.net>
Fri, 6 May 2022 16:08:16 +0000 (18:08 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jun 2022 08:23:23 +0000 (10:23 +0200)
commite3e10606ba50b1ac9d2518cda27a90302dec341e
treec2b60d74970c7cb9adacf5ebc4228254dc3de75d
parentdf2af378bc0c837453c5d544061e017dc0263d3c
selftests/landlock: Fully test file rename with "remove" access

commit 6a1bdd4a0bfc30fa4fa2b3a979e6525f28996db9 upstream.

These tests were missing to check the check_access_path() call with all
combinations of maybe_remove(old_dentry) and maybe_remove(new_dentry).

Extend layout1.link with a new complementary test and check that
REMOVE_FILE is not required to link a file.

Cc: Shuah Khan <shuah@kernel.org>
Link: https://lore.kernel.org/r/20220506160820.524344-7-mic@digikod.net
Cc: stable@vger.kernel.org
Signed-off-by: Mickaël Salaün <mic@digikod.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/testing/selftests/landlock/fs_test.c