lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHc6FU7gH54C-hfV8VQzgpYv=PYNvpA9dc8stgVf2_khF7dUdg@mail.gmail.com>
Date:	Fri, 11 Mar 2016 18:03:11 +0100
From:	Andreas Gruenbacher <agruenba@...hat.com>
To:	Christoph Hellwig <hch@...radead.org>
Cc:	Alexander Viro <viro@...iv.linux.org.uk>,
	"J. Bruce Fields" <bfields@...ldses.org>,
	Linux NFS Mailing List <linux-nfs@...r.kernel.org>,
	"Theodore Ts'o" <tytso@....edu>, linux-cifs@...r.kernel.org,
	Linux API <linux-api@...r.kernel.org>,
	Trond Myklebust <trond.myklebust@...marydata.com>,
	LKML <linux-kernel@...r.kernel.org>,
	XFS Developers <xfs@....sgi.com>,
	Andreas Dilger <adilger.kernel@...ger.ca>,
	linux-fsdevel <linux-fsdevel@...r.kernel.org>,
	Jeff Layton <jlayton@...chiereds.net>,
	linux-ext4 <linux-ext4@...r.kernel.org>,
	Anna Schumaker <anna.schumaker@...app.com>
Subject: Re: [PATCH v18 18/22] richacl: xattr mapping functions

On Fri, Mar 11, 2016 at 3:17 PM, Christoph Hellwig <hch@...radead.org> wrote:
>> +#include <linux/richacl_xattr.h>
>> +
>> +MODULE_LICENSE("GPL");
>
> what's the point given that the code isn't even modolar?

A leftover, removed now.

>> +static void
>> +fix_xattr_from_user(const char *kname, void *kvalue, size_t size)
>> +{
>> +     if (strncmp(kname, XATTR_SYSTEM_PREFIX, XATTR_SYSTEM_PREFIX_LEN))
>> +             return;
>> +     kname += XATTR_SYSTEM_PREFIX_LEN;
>> +     if (!strcmp(kname, XATTR_POSIX_ACL_ACCESS) ||
>> +         !strcmp(kname, XATTR_POSIX_ACL_DEFAULT))
>> +             posix_acl_fix_xattr_from_user(kvalue, size);
>> +}
>>
>>  /*
>>   * Extended attribute SET operations
>> @@ -329,9 +339,7 @@ setxattr(struct dentry *d, const char __user *name, const void __user *value,
>>                       error = -EFAULT;
>>                       goto out;
>>               }
>> -             if ((strcmp(kname, XATTR_NAME_POSIX_ACL_ACCESS) == 0) ||
>> -                 (strcmp(kname, XATTR_NAME_POSIX_ACL_DEFAULT) == 0))
>> -                     posix_acl_fix_xattr_from_user(kvalue, size);
>> +             fix_xattr_from_user(kname, kvalue, size);
>>       }
>>
>>       error = vfs_setxattr(d, kname, kvalue, size, flags);
>> @@ -396,6 +404,17 @@ SYSCALL_DEFINE5(fsetxattr, int, fd, const char __user *, name,
>>       return error;
>>  }
>>
>> +static void
>> +fix_xattr_to_user(const char *kname, void *kvalue, size_t size)
>> +{
>> +     if (strncmp(kname, XATTR_SYSTEM_PREFIX, XATTR_SYSTEM_PREFIX_LEN))
>> +             return;
>> +     kname += XATTR_SYSTEM_PREFIX_LEN;
>> +     if (!strcmp(kname, XATTR_POSIX_ACL_ACCESS) ||
>> +         !strcmp(kname, XATTR_POSIX_ACL_DEFAULT))
>> +             posix_acl_fix_xattr_to_user(kvalue, size);
>> +}
>> +
>>  /*
>>   * Extended attribute GET operations
>>   */
>> @@ -426,9 +445,7 @@ getxattr(struct dentry *d, const char __user *name, void __user *value,
>>
>>       error = vfs_getxattr(d, kname, kvalue, size);
>>       if (error > 0) {
>> -             if ((strcmp(kname, XATTR_NAME_POSIX_ACL_ACCESS) == 0) ||
>> -                 (strcmp(kname, XATTR_NAME_POSIX_ACL_DEFAULT) == 0))
>> -                     posix_acl_fix_xattr_to_user(kvalue, size);
>> +             fix_xattr_to_user(kname, kvalue, size);
>
> I don't see how this is related to the rest of the patch.

Indeed, this is unrelated now. I'll split it off.

>> +++ b/include/linux/richacl_xattr.h
>
> What's the point in splitting this from the richacl.h header?
>
> Same for the uapi versions.
>
>> +struct richacl_xattr {
>> +     unsigned char   a_version;
>> +     unsigned char   a_flags;
>
> Explicit __u8 for uapi headers, please.

Okay.

Thanks,
Andreas

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ