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