2021-04-22 23:41:12 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
|
|
/*
|
|
|
|
* Landlock LSM - Limits for different components
|
|
|
|
*
|
|
|
|
* Copyright © 2016-2020 Mickaël Salaün <mic@digikod.net>
|
|
|
|
* Copyright © 2018-2020 ANSSI
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _SECURITY_LANDLOCK_LIMITS_H
|
|
|
|
#define _SECURITY_LANDLOCK_LIMITS_H
|
|
|
|
|
2022-05-07 00:10:51 +08:00
|
|
|
#include <linux/bitops.h>
|
2021-04-22 23:41:12 +08:00
|
|
|
#include <linux/limits.h>
|
2021-04-22 23:41:17 +08:00
|
|
|
#include <uapi/linux/landlock.h>
|
2021-04-22 23:41:12 +08:00
|
|
|
|
2022-05-07 00:05:07 +08:00
|
|
|
/* clang-format off */
|
|
|
|
|
2022-05-07 00:10:52 +08:00
|
|
|
#define LANDLOCK_MAX_NUM_LAYERS 16
|
2021-04-22 23:41:12 +08:00
|
|
|
#define LANDLOCK_MAX_NUM_RULES U32_MAX
|
|
|
|
|
2022-10-19 02:22:09 +08:00
|
|
|
#define LANDLOCK_LAST_ACCESS_FS LANDLOCK_ACCESS_FS_TRUNCATE
|
2021-04-22 23:41:17 +08:00
|
|
|
#define LANDLOCK_MASK_ACCESS_FS ((LANDLOCK_LAST_ACCESS_FS << 1) - 1)
|
2022-05-07 00:10:51 +08:00
|
|
|
#define LANDLOCK_NUM_ACCESS_FS __const_hweight64(LANDLOCK_MASK_ACCESS_FS)
|
2021-04-22 23:41:17 +08:00
|
|
|
|
2022-05-07 00:05:07 +08:00
|
|
|
/* clang-format on */
|
|
|
|
|
2021-04-22 23:41:12 +08:00
|
|
|
#endif /* _SECURITY_LANDLOCK_LIMITS_H */
|