1 /* SPDX-License-Identifier: GPL-2.0-only */ 1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 /* 2 /* 3 * Landlock LSM - Limits for different compone 3 * Landlock LSM - Limits for different components 4 * 4 * 5 * Copyright © 2016-2020 Mickaël Salaün <mi 5 * Copyright © 2016-2020 Mickaël Salaün <mic@digikod.net> 6 * Copyright © 2018-2020 ANSSI 6 * Copyright © 2018-2020 ANSSI 7 */ 7 */ 8 8 9 #ifndef _SECURITY_LANDLOCK_LIMITS_H 9 #ifndef _SECURITY_LANDLOCK_LIMITS_H 10 #define _SECURITY_LANDLOCK_LIMITS_H 10 #define _SECURITY_LANDLOCK_LIMITS_H 11 11 12 #include <linux/bitops.h> 12 #include <linux/bitops.h> 13 #include <linux/limits.h> 13 #include <linux/limits.h> 14 #include <uapi/linux/landlock.h> 14 #include <uapi/linux/landlock.h> 15 15 16 /* clang-format off */ 16 /* clang-format off */ 17 17 18 #define LANDLOCK_MAX_NUM_LAYERS 16 18 #define LANDLOCK_MAX_NUM_LAYERS 16 19 #define LANDLOCK_MAX_NUM_RULES U32_MA 19 #define LANDLOCK_MAX_NUM_RULES U32_MAX 20 20 21 #define LANDLOCK_LAST_ACCESS_FS LANDLO !! 21 #define LANDLOCK_LAST_ACCESS_FS LANDLOCK_ACCESS_FS_TRUNCATE 22 #define LANDLOCK_MASK_ACCESS_FS ((LAND 22 #define LANDLOCK_MASK_ACCESS_FS ((LANDLOCK_LAST_ACCESS_FS << 1) - 1) 23 #define LANDLOCK_NUM_ACCESS_FS __cons 23 #define LANDLOCK_NUM_ACCESS_FS __const_hweight64(LANDLOCK_MASK_ACCESS_FS) >> 24 #define LANDLOCK_SHIFT_ACCESS_FS 0 24 25 25 #define LANDLOCK_LAST_ACCESS_NET LANDLO 26 #define LANDLOCK_LAST_ACCESS_NET LANDLOCK_ACCESS_NET_CONNECT_TCP 26 #define LANDLOCK_MASK_ACCESS_NET ((LAND 27 #define LANDLOCK_MASK_ACCESS_NET ((LANDLOCK_LAST_ACCESS_NET << 1) - 1) 27 #define LANDLOCK_NUM_ACCESS_NET __cons 28 #define LANDLOCK_NUM_ACCESS_NET __const_hweight64(LANDLOCK_MASK_ACCESS_NET) >> 29 #define LANDLOCK_SHIFT_ACCESS_NET LANDLOCK_NUM_ACCESS_FS 28 30 29 #define LANDLOCK_LAST_SCOPE LANDLO << 30 #define LANDLOCK_MASK_SCOPE ((LAND << 31 #define LANDLOCK_NUM_SCOPE __cons << 32 /* clang-format on */ 31 /* clang-format on */ 33 32 34 #endif /* _SECURITY_LANDLOCK_LIMITS_H */ 33 #endif /* _SECURITY_LANDLOCK_LIMITS_H */ 35 34
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.