diff options
author | James Morris <james.l.morris@oracle.com> | 2013-10-30 07:07:10 +0400 |
---|---|---|
committer | James Morris <james.l.morris@oracle.com> | 2013-10-30 07:07:10 +0400 |
commit | 50b719f811583a47762ecb7e480d253abc2eb22f (patch) | |
tree | 290e6cb4f15695140a9dbef1164e69ac9c80e454 /security/smack/smack_access.c | |
parent | 3ea7a56067e663278470c04fd655adf809e72d4d (diff) | |
parent | b5dfd8075bc26636d11c3d8888940198afbf5112 (diff) | |
download | linux-50b719f811583a47762ecb7e480d253abc2eb22f.tar.xz |
Merge branch 'smack-for-3.13' of git://git.gitorious.org/smack-next/kernel into ra-next
Diffstat (limited to 'security/smack/smack_access.c')
-rw-r--r-- | security/smack/smack_access.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/security/smack/smack_access.c b/security/smack/smack_access.c index b3b59b1e93d6..14293cd9b1e5 100644 --- a/security/smack/smack_access.c +++ b/security/smack/smack_access.c @@ -84,6 +84,8 @@ int log_policy = SMACK_AUDIT_DENIED; * * Do the object check first because that is more * likely to differ. + * + * Allowing write access implies allowing locking. */ int smk_access_entry(char *subject_label, char *object_label, struct list_head *rule_list) @@ -99,6 +101,11 @@ int smk_access_entry(char *subject_label, char *object_label, } } + /* + * MAY_WRITE implies MAY_LOCK. + */ + if ((may & MAY_WRITE) == MAY_WRITE) + may |= MAY_LOCK; return may; } @@ -245,6 +252,7 @@ out_audit: static inline void smack_str_from_perm(char *string, int access) { int i = 0; + if (access & MAY_READ) string[i++] = 'r'; if (access & MAY_WRITE) @@ -255,6 +263,8 @@ static inline void smack_str_from_perm(char *string, int access) string[i++] = 'a'; if (access & MAY_TRANSMUTE) string[i++] = 't'; + if (access & MAY_LOCK) + string[i++] = 'l'; string[i] = '\0'; } /** |