mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
Security: Add Hook to test if the particular xattr is part of a MAC model.
The interface to request security labels from user space is the xattr interface. When requesting the security label from an NFS server it is important to make sure the requested xattr actually is a MAC label. This allows us to make sure that we get the desired semantics from the attribute instead of something else such as capabilities or a time based LSM. Acked-by: Eric Paris <[email protected]> Acked-by: James Morris <[email protected]> Signed-off-by: Matthew N. Dodd <[email protected]> Signed-off-by: Miguel Rodel Felipe <[email protected]> Signed-off-by: Phua Eu Gene <[email protected]> Signed-off-by: Khin Mi Mi Aung <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
This commit is contained in:
parent
d47be3dfec
commit
746df9b59c
5 changed files with 43 additions and 0 deletions
|
|
@ -3328,6 +3328,16 @@ static void smack_audit_rule_free(void *vrule)
|
|||
|
||||
#endif /* CONFIG_AUDIT */
|
||||
|
||||
/**
|
||||
* smack_ismaclabel - check if xattr @name references a smack MAC label
|
||||
* @name: Full xattr name to check.
|
||||
*/
|
||||
static int smack_ismaclabel(const char *name)
|
||||
{
|
||||
return (strcmp(name, XATTR_SMACK_SUFFIX) == 0);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* smack_secid_to_secctx - return the smack label for a secid
|
||||
* @secid: incoming integer
|
||||
|
|
@ -3524,6 +3534,7 @@ struct security_operations smack_ops = {
|
|||
.audit_rule_free = smack_audit_rule_free,
|
||||
#endif /* CONFIG_AUDIT */
|
||||
|
||||
.ismaclabel = smack_ismaclabel,
|
||||
.secid_to_secctx = smack_secid_to_secctx,
|
||||
.secctx_to_secid = smack_secctx_to_secid,
|
||||
.release_secctx = smack_release_secctx,
|
||||
|
|
|
|||
Loading…
Reference in a new issue