Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 264486
b: refs/heads/master
c: 823eb1c
h: refs/heads/master
v: v3
  • Loading branch information
Mimi Zohar committed Jul 18, 2011
1 parent 23aaf2d commit 9622958
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cb72318069d5e92eb74840118732c66eb38c812f
refs/heads/master: 823eb1ccd0b310449e99c822412ea8208334d14c
18 changes: 12 additions & 6 deletions trunk/security/security.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <linux/ima.h>
#include <linux/evm.h>

#define MAX_LSM_XATTR 1
#define MAX_LSM_EVM_XATTR 2

/* Boot-time LSM user choice */
static __initdata char chosen_lsm[SECURITY_NAME_MAX + 1] =
Expand Down Expand Up @@ -346,8 +346,8 @@ int security_inode_init_security(struct inode *inode, struct inode *dir,
const struct qstr *qstr,
const initxattrs initxattrs, void *fs_data)
{
struct xattr new_xattrs[MAX_LSM_XATTR + 1];
struct xattr *lsm_xattr;
struct xattr new_xattrs[MAX_LSM_EVM_XATTR + 1];
struct xattr *lsm_xattr, *evm_xattr, *xattr;
int ret;

if (unlikely(IS_PRIVATE(inode)))
Expand All @@ -364,11 +364,17 @@ int security_inode_init_security(struct inode *inode, struct inode *dir,
&lsm_xattr->value_len);
if (ret)
goto out;

evm_xattr = lsm_xattr + 1;
ret = evm_inode_init_security(inode, lsm_xattr, evm_xattr);
if (ret)
goto out;
ret = initxattrs(inode, new_xattrs, fs_data);
out:
kfree(lsm_xattr->name);
kfree(lsm_xattr->value);

for (xattr = new_xattrs; xattr->name != NULL; xattr++) {
kfree(xattr->name);
kfree(xattr->value);
}
return (ret == -EOPNOTSUPP) ? 0 : ret;
}
EXPORT_SYMBOL(security_inode_init_security);
Expand Down

0 comments on commit 9622958

Please sign in to comment.