mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-08-09 06:14:34 +02:00
Adds the UAPI for the quiet flags feature (but not the implementation yet). Even though currently LANDLOCK_ADD_RULE_QUIET only affects audit logging, in the future this can also be used as part of a supervisor mechanism, where it will also suppress denial notifications on a per-object basis. Thus the name is deliberately generic, as opposed to e.g. LANDLOCK_ADD_RULE_LOG_QUIET. According to pahole, even after adding the struct access_masks quiet_masks in struct landlock_hierarchy, the u32 log_* bitfield still only has a size of 2 bytes, so there's minimal wasted space. Assisted-by: GitHub-Copilot:claude-opus-4.8 Signed-off-by: Tingmao Wang <m@maowtm.org> [mic: Update date, fix comment formatting] Link: https://patch.msgid.link/031184748a8e74c0bb02f1fa13d7a3f10918c627.1781228815.git.m@maowtm.org Signed-off-by: Mickaël Salaün <mic@digikod.net>
35 lines
839 B
C
35 lines
839 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Landlock LSM - Network management and hooks
|
|
*
|
|
* Copyright © 2022-2023 Huawei Tech. Co., Ltd.
|
|
*/
|
|
|
|
#ifndef _SECURITY_LANDLOCK_NET_H
|
|
#define _SECURITY_LANDLOCK_NET_H
|
|
|
|
#include "common.h"
|
|
#include "ruleset.h"
|
|
#include "setup.h"
|
|
|
|
#if IS_ENABLED(CONFIG_INET)
|
|
__init void landlock_add_net_hooks(void);
|
|
|
|
int landlock_append_net_rule(struct landlock_ruleset *const ruleset,
|
|
const u16 port, access_mask_t access_rights,
|
|
const u32 flags);
|
|
#else /* IS_ENABLED(CONFIG_INET) */
|
|
static inline void landlock_add_net_hooks(void)
|
|
{
|
|
}
|
|
|
|
static inline int
|
|
landlock_append_net_rule(struct landlock_ruleset *const ruleset, const u16 port,
|
|
access_mask_t access_rights, const u32 flags)
|
|
{
|
|
return -EAFNOSUPPORT;
|
|
}
|
|
#endif /* IS_ENABLED(CONFIG_INET) */
|
|
|
|
#endif /* _SECURITY_LANDLOCK_NET_H */
|