drm/bridge: adv7511: Switch to atomic operations
[drm/drm-misc.git] / tools / testing / selftests / landlock / scoped_test.c
blobb90f76ed0d9c52640cad14c3ce7b14e03a9b51f3
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3 * Landlock tests - Common scope restriction
5 * Copyright © 2024 Tahera Fahimi <fahimitahera@gmail.com>
6 */
8 #define _GNU_SOURCE
9 #include <errno.h>
10 #include <linux/landlock.h>
11 #include <sys/prctl.h>
13 #include "common.h"
15 #define ACCESS_LAST LANDLOCK_SCOPE_SIGNAL
17 TEST(ruleset_with_unknown_scope)
19 __u64 scoped_mask;
21 for (scoped_mask = 1ULL << 63; scoped_mask != ACCESS_LAST;
22 scoped_mask >>= 1) {
23 struct landlock_ruleset_attr ruleset_attr = {
24 .scoped = scoped_mask,
27 ASSERT_EQ(-1, landlock_create_ruleset(&ruleset_attr,
28 sizeof(ruleset_attr), 0));
29 ASSERT_EQ(EINVAL, errno);
33 TEST_HARNESS_MAIN