diff options
author | Mimi Zohar <zohar@linux.vnet.ibm.com> | 2011-08-18 18:07:44 -0400 |
---|---|---|
committer | Mimi Zohar <zohar@linux.vnet.ibm.com> | 2011-09-14 15:24:51 -0400 |
commit | bf6d0f5dcda17df3cc5577e203d0f8ea1c2ad6aa (patch) | |
tree | c6c5f39d43fe0d27bc1d3aedbd2f9b3ba2f8f537 /security/integrity/evm/evm_posix_acl.c | |
parent | a924ce0b35875ef9512135b46a32f4150fd700b2 (diff) | |
download | lwn-bf6d0f5dcda17df3cc5577e203d0f8ea1c2ad6aa.tar.gz lwn-bf6d0f5dcda17df3cc5577e203d0f8ea1c2ad6aa.zip |
evm: posix acls modify i_mode
The posix xattr acls are 'system' prefixed, which normally would not
affect security.evm. An interesting side affect of writing posix xattr
acls is their modifying of the i_mode, which is included in security.evm.
This patch updates security.evm when posix xattr acls are written.
Signed-off-by: Mimi Zohar <zohar@us.ibm.com>
Diffstat (limited to 'security/integrity/evm/evm_posix_acl.c')
-rw-r--r-- | security/integrity/evm/evm_posix_acl.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/security/integrity/evm/evm_posix_acl.c b/security/integrity/evm/evm_posix_acl.c new file mode 100644 index 000000000000..b1753e98bf9a --- /dev/null +++ b/security/integrity/evm/evm_posix_acl.c @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2011 IBM Corporation + * + * Author: + * Mimi Zohar <zohar@us.ibm.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, version 2 of the License. + */ + +#include <linux/module.h> +#include <linux/xattr.h> + +int posix_xattr_acl(char *xattr) +{ + int xattr_len = strlen(xattr); + + if ((strlen(XATTR_NAME_POSIX_ACL_ACCESS) == xattr_len) + && (strncmp(XATTR_NAME_POSIX_ACL_ACCESS, xattr, xattr_len) == 0)) + return 1; + if ((strlen(XATTR_NAME_POSIX_ACL_DEFAULT) == xattr_len) + && (strncmp(XATTR_NAME_POSIX_ACL_DEFAULT, xattr, xattr_len) == 0)) + return 1; + return 0; +} |