Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Landlock LSM - Limits for different components
0004  *
0005  * Copyright © 2016-2020 Mickaël Salaün <mic@digikod.net>
0006  * Copyright © 2018-2020 ANSSI
0007  */
0008 
0009 #ifndef _SECURITY_LANDLOCK_LIMITS_H
0010 #define _SECURITY_LANDLOCK_LIMITS_H
0011 
0012 #include <linux/bitops.h>
0013 #include <linux/limits.h>
0014 #include <uapi/linux/landlock.h>
0015 
0016 /* clang-format off */
0017 
0018 #define LANDLOCK_MAX_NUM_LAYERS     16
0019 #define LANDLOCK_MAX_NUM_RULES      U32_MAX
0020 
0021 #define LANDLOCK_LAST_ACCESS_FS     LANDLOCK_ACCESS_FS_REFER
0022 #define LANDLOCK_MASK_ACCESS_FS     ((LANDLOCK_LAST_ACCESS_FS << 1) - 1)
0023 #define LANDLOCK_NUM_ACCESS_FS      __const_hweight64(LANDLOCK_MASK_ACCESS_FS)
0024 
0025 /* clang-format on */
0026 
0027 #endif /* _SECURITY_LANDLOCK_LIMITS_H */