1 /* SPDX-License-Identifier: GPL-2.0-only */ 1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 /* 2 /* 3 * Landlock LSM - Network management and hooks 3 * Landlock LSM - Network management and hooks 4 * 4 * 5 * Copyright © 2022-2023 Huawei Tech. Co., Lt 5 * Copyright © 2022-2023 Huawei Tech. Co., Ltd. 6 */ 6 */ 7 7 8 #ifndef _SECURITY_LANDLOCK_NET_H 8 #ifndef _SECURITY_LANDLOCK_NET_H 9 #define _SECURITY_LANDLOCK_NET_H 9 #define _SECURITY_LANDLOCK_NET_H 10 10 11 #include "common.h" 11 #include "common.h" 12 #include "ruleset.h" 12 #include "ruleset.h" 13 #include "setup.h" 13 #include "setup.h" 14 14 15 #if IS_ENABLED(CONFIG_INET) 15 #if IS_ENABLED(CONFIG_INET) 16 __init void landlock_add_net_hooks(void); 16 __init void landlock_add_net_hooks(void); 17 17 18 int landlock_append_net_rule(struct landlock_r 18 int landlock_append_net_rule(struct landlock_ruleset *const ruleset, 19 const u16 port, a 19 const u16 port, access_mask_t access_rights); 20 #else /* IS_ENABLED(CONFIG_INET) */ 20 #else /* IS_ENABLED(CONFIG_INET) */ 21 static inline void landlock_add_net_hooks(void 21 static inline void landlock_add_net_hooks(void) 22 { 22 { 23 } 23 } 24 24 25 static inline int 25 static inline int 26 landlock_append_net_rule(struct landlock_rules 26 landlock_append_net_rule(struct landlock_ruleset *const ruleset, const u16 port, 27 access_mask_t access_ 27 access_mask_t access_rights) 28 { 28 { 29 return -EAFNOSUPPORT; 29 return -EAFNOSUPPORT; 30 } 30 } 31 #endif /* IS_ENABLED(CONFIG_INET) */ 31 #endif /* IS_ENABLED(CONFIG_INET) */ 32 32 33 #endif /* _SECURITY_LANDLOCK_NET_H */ 33 #endif /* _SECURITY_LANDLOCK_NET_H */ 34 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.