projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branches 'acpi-hotplug', 'acpi-sysfs' and 'acpi-sleep'
[firefly-linux-kernel-4.4.55.git]
/
security
/
smack
/
smack_access.c
diff --git
a/security/smack/smack_access.c
b/security/smack/smack_access.c
index b3b59b1e93d6e6b056789243b77f0b319e56c982..14293cd9b1e53b4a260e9258a5cad54c75d71204 100644
(file)
--- 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.
*
* 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)
*/
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;
}
return may;
}
@@
-245,6
+252,7
@@
out_audit:
static inline void smack_str_from_perm(char *string, int access)
{
int i = 0;
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)
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';
string[i++] = 'a';
if (access & MAY_TRANSMUTE)
string[i++] = 't';
+ if (access & MAY_LOCK)
+ string[i++] = 'l';
string[i] = '\0';
}
/**
string[i] = '\0';
}
/**