diff options
author | Christian Brauner <christian.brauner@ubuntu.com> | 2021-05-28 11:24:17 +0200 |
---|---|---|
committer | Christian Brauner <christian.brauner@ubuntu.com> | 2021-05-28 17:44:37 +0200 |
commit | 15845cbcd12a571869c6703892427f9e5839d5fb (patch) | |
tree | a60882136c149b4352b88ece7417404bd71f977a /tools/testing/selftests/openat2 | |
parent | cfe80306a0dd6d363934913e47c3f30d71b721e5 (diff) | |
download | lwn-15845cbcd12a571869c6703892427f9e5839d5fb.tar.gz lwn-15845cbcd12a571869c6703892427f9e5839d5fb.zip |
test: add openat2() test for invalid upper 32 bit flag value
Test that openat2() rejects unknown flags in the upper 32 bit range.
Link: https://lore.kernel.org/r/20210528092417.3942079-4-brauner@kernel.org
Cc: Richard Guy Briggs <rgb@redhat.com>
Cc: Aleksa Sarai <cyphar@cyphar.com>
Cc: linux-fsdevel@vger.kernel.org
Reviewed-by: Richard Guy Briggs <rgb@redhat.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Diffstat (limited to 'tools/testing/selftests/openat2')
-rw-r--r-- | tools/testing/selftests/openat2/openat2_test.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/testing/selftests/openat2/openat2_test.c b/tools/testing/selftests/openat2/openat2_test.c index 381d874cce99..d7ec1e7da0d0 100644 --- a/tools/testing/selftests/openat2/openat2_test.c +++ b/tools/testing/selftests/openat2/openat2_test.c @@ -155,7 +155,7 @@ struct flag_test { int err; }; -#define NUM_OPENAT2_FLAG_TESTS 24 +#define NUM_OPENAT2_FLAG_TESTS 25 void test_openat2_flags(void) { @@ -229,6 +229,11 @@ void test_openat2_flags(void) { .name = "invalid how.resolve and O_PATH", .how.flags = O_PATH, .how.resolve = 0x1337, .err = -EINVAL }, + + /* currently unknown upper 32 bit rejected. */ + { .name = "currently unknown bit (1 << 63)", + .how.flags = O_RDONLY | (1ULL << 63), + .how.resolve = 0, .err = -EINVAL }, }; BUILD_BUG_ON(ARRAY_LEN(tests) != NUM_OPENAT2_FLAG_TESTS); |