diff options
| author | John Johansen <john.johansen@canonical.com> | 2026-07-23 15:46:45 -0700 |
|---|---|---|
| committer | John Johansen <john.johansen@canonical.com> | 2026-08-10 22:49:42 -0700 |
| commit | a3ed5d43f786bdce14cd9eeeb7ca7ab695c82948 (patch) | |
| tree | fd4bc7470c7a510306bf9952a567e632786ae4fa /security/apparmor/include | |
| parent | 1bd606110942d5014c9eee967c7222862936a20d (diff) | |
| download | linux-a3ed5d43f786bdce14cd9eeeb7ca7ab695c82948.tar.gz linux-a3ed5d43f786bdce14cd9eeeb7ca7ab695c82948.zip | |
apparmor: mark static tables and structs as read only
static tables, and structs that are initialized as part of their
data section or during init should be read only to protect against
accidental or malicous changes.
Signed-off-by: John Johansen <john.johansen@canonical.com>
Diffstat (limited to 'security/apparmor/include')
| -rw-r--r-- | security/apparmor/include/file.h | 2 | ||||
| -rw-r--r-- | security/apparmor/include/match.h | 2 | ||||
| -rw-r--r-- | security/apparmor/include/perms.h | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/security/apparmor/include/file.h b/security/apparmor/include/file.h index ef60f99bc5ae..1614c07fc53e 100644 --- a/security/apparmor/include/file.h +++ b/security/apparmor/include/file.h @@ -72,7 +72,7 @@ struct path_cond { #define COMBINED_PERM_MASK(X) ((X).allow | (X).audit | (X).quiet | (X).kill) int aa_audit_file(const struct cred *cred, - struct aa_profile *profile, struct aa_perms *perms, + struct aa_profile *profile, const struct aa_perms *perms, const char *op, u32 request, const char *name, const char *target, struct aa_label *tlabel, kuid_t ouid, const char *info, int error); diff --git a/security/apparmor/include/match.h b/security/apparmor/include/match.h index 7accb1c39849..094f6b998ea8 100644 --- a/security/apparmor/include/match.h +++ b/security/apparmor/include/match.h @@ -125,7 +125,7 @@ static inline size_t table_size(size_t len, size_t el_size) #define aa_state_t unsigned int -struct aa_dfa *aa_dfa_unpack(void *blob, size_t size, int flags); +struct aa_dfa *aa_dfa_unpack(const void *blob, size_t size, int flags); aa_state_t aa_dfa_match_len(struct aa_dfa *dfa, aa_state_t start, const char *str, int len); aa_state_t aa_dfa_match(struct aa_dfa *dfa, aa_state_t start, diff --git a/security/apparmor/include/perms.h b/security/apparmor/include/perms.h index 37a3781b99a0..bbab28ed7abb 100644 --- a/security/apparmor/include/perms.h +++ b/security/apparmor/include/perms.h @@ -96,8 +96,8 @@ struct aa_perms { #define AA_INDEX_NONE 0 #define ALL_PERMS_MASK 0xffffffff -extern struct aa_perms nullperms; -extern struct aa_perms allperms; +extern const struct aa_perms nullperms; +extern const struct aa_perms allperms; /** * aa_perms_accum_raw - accumulate perms with out masking off overlapping perms |
