Commit 5d96fa44 authored by Seth Forshee's avatar Seth Forshee Committed by Tim Gardner

UBUNTU: SAUCE: ima/evm: Allow root in s_user_ns to set xattrs

Signed-off-by: default avatarSeth Forshee <seth.forshee@canonical.com>
Signed-off-by: default avatarTim Gardner <tim.gardner@canonical.com>
parent 68aac61c
...@@ -279,7 +279,7 @@ static int evm_protect_xattr(struct dentry *dentry, const char *xattr_name, ...@@ -279,7 +279,7 @@ static int evm_protect_xattr(struct dentry *dentry, const char *xattr_name,
enum integrity_status evm_status; enum integrity_status evm_status;
if (strcmp(xattr_name, XATTR_NAME_EVM) == 0) { if (strcmp(xattr_name, XATTR_NAME_EVM) == 0) {
if (!capable(CAP_SYS_ADMIN)) if (!ns_capable(dentry->d_sb->s_user_ns, CAP_SYS_ADMIN))
return -EPERM; return -EPERM;
} else if (!evm_protected_xattr(xattr_name)) { } else if (!evm_protected_xattr(xattr_name)) {
if (!posix_xattr_acl(xattr_name)) if (!posix_xattr_acl(xattr_name))
......
...@@ -345,7 +345,7 @@ static int ima_protect_xattr(struct dentry *dentry, const char *xattr_name, ...@@ -345,7 +345,7 @@ static int ima_protect_xattr(struct dentry *dentry, const char *xattr_name,
const void *xattr_value, size_t xattr_value_len) const void *xattr_value, size_t xattr_value_len)
{ {
if (strcmp(xattr_name, XATTR_NAME_IMA) == 0) { if (strcmp(xattr_name, XATTR_NAME_IMA) == 0) {
if (!capable(CAP_SYS_ADMIN)) if (!ns_capable(dentry->d_sb->s_user_ns, CAP_SYS_ADMIN))
return -EPERM; return -EPERM;
return 1; return 1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment