Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1514100

Re: [PATCH] Re: Problem with setxattr on sockfs with Smack after 971df15bd54ad46e907046ff33750a137b2f0096

From Casey Schaufler <casey@schaufler-ca.com>
Newsgroups linux.kernel
Subject Re: [PATCH] Re: Problem with setxattr on sockfs with Smack after 971df15bd54ad46e907046ff33750a137b2f0096
Date 2016-11-02 21:10 +0100
Message-ID <sza1b-2sn-3@gated-at.bofh.it> (permalink)
References <sysMy-7ZA-17@gated-at.bofh.it> <syJX4-2y5-17@gated-at.bofh.it> <sz9ya-20h-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 11/2/2016 12:34 PM, Andreas Gruenbacher wrote:
> Casey,
>
> does this patch help?

My tests pass with this patch applied.

>
> (The way how security xattrs are handled by LSM is pretty ugly.

I'm open to suggestions.

>   I'm not
> convinced that it doesn't break something else, yet.)
>
> Thanks,
> Andreas
> ---
>  fs/xattr.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/fs/xattr.c b/fs/xattr.c
> index 3368659..bf09836 100644
> --- a/fs/xattr.c
> +++ b/fs/xattr.c
> @@ -183,11 +183,13 @@ int __vfs_setxattr_noperm(struct dentry *dentry, const char *name,
>  			security_inode_post_setxattr(dentry, name, value,
>  						     size, flags);
>  		}
> -	} else if (issec) {
> -		const char *suffix = name + XATTR_SECURITY_PREFIX_LEN;
> -
> +	} else {
>  		if (unlikely(is_bad_inode(inode)))
>  			return -EIO;
> +	}
> +	if (issec && error == -EOPNOTSUPP) {
> +		const char *suffix = name + XATTR_SECURITY_PREFIX_LEN;
> +
>  		error = security_inode_setsecurity(inode, suffix, value,
>  						   size, flags);
>  		if (!error)

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Problem with setxattr on sockfs with Smack after  971df15bd54ad46e907046ff33750a137b2f0096 Casey Schaufler <casey@schaufler-ca.com> - 2016-10-31 23:00 +0100
  Re: Problem with setxattr on sockfs with Smack after  971df15bd54ad46e907046ff33750a137b2f0096 Casey Schaufler <casey@schaufler-ca.com> - 2016-11-01 17:20 +0100
    [PATCH] Re: Problem with setxattr on sockfs with Smack after 971df15bd54ad46e907046ff33750a137b2f0096 Andreas Gruenbacher <agruenba@redhat.com> - 2016-11-02 20:40 +0100
      Re: [PATCH] Re: Problem with setxattr on sockfs with Smack after  971df15bd54ad46e907046ff33750a137b2f0096 Casey Schaufler <casey@schaufler-ca.com> - 2016-11-02 21:10 +0100
        [PATCH] xattr: Fix setting security xattrs on sockfs Andreas Gruenbacher <agruenba@redhat.com> - 2016-11-03 14:50 +0100
          Re: [PATCH] xattr: Fix setting security xattrs on sockfs Casey Schaufler <casey@schaufler-ca.com> - 2016-11-03 17:00 +0100
            Re: [PATCH] xattr: Fix setting security xattrs on sockfs Andreas Gruenbacher <agruenba@redhat.com> - 2016-11-03 17:10 +0100
              Re: [PATCH] xattr: Fix setting security xattrs on sockfs Casey Schaufler <casey@schaufler-ca.com> - 2016-11-03 17:30 +0100

csiph-web