On 8/15/19 3:27 PM, James Morris wrote:
On Thu, 15 Aug 2019, Mark Salyzyn wrote:

Good Idea, but using the same argument structure for set and get I would be
concerned about the loss of compiler protection for the buffer argument;
Agreed, I missed that.

Sadly, the pattern of

struct getxattr_args args;

memset(&args, 0, sizeof(args));

args.xxxx = ...

__vfs_getxattr(&args};

...

__vfs_setxattr(&args);

would be nice, so maybe we need to cool our jets and instead:

struct xattr_gs_args {
        struct dentry *dentry;
        struct inode *inode;
        const char *name;
        union {
                void *buffer;
                const void *value;
        };
        size_t size;
        int flags;
};

value _must_ be referenced for all setxattr operations, buffer for getxattr 
operations (how can we enforce that?).

struct getxattr_args {
        struct dentry *dentry;
        struct inode *inode;
        const char *name;
        void *buffer;
        size_t size;
        int flags;
Does 'get' need flags?

:-) That was the _whole_ point of the patch, flags is how we pass in the recursion so that a security/internal getxattr call has the rights to acquire the data in the lower layer(s).

-- Mark

Reply via email to