Linux Overlay Filesystem development
 help / color / mirror / Atom feed
From: Mark Salyzyn <salyzyn@android.com>
To: James Morris <jmorris@namei.org>
Cc: "Latchesar Ionkov" <lucho@ionkov.net>,
	"Dave Kleikamp" <shaggy@kernel.org>,
	jfs-discussion@lists.sourceforge.net, kernel-team@android.com,
	"Martin Brandenburg" <martin@omnibond.com>,
	samba-technical@lists.samba.org,
	"Dominique Martinet" <asmadeus@codewreck.org>,
	"Chao Yu" <yuchao0@huawei.com>,
	"Mimi Zohar" <zohar@linux.ibm.com>,
	linux-unionfs@vger.kernel.org,
	"David Howells" <dhowells@redhat.com>, "Chris Mason" <clm@fb.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Andreas Dilger" <adilger.kernel@dilger.ca>,
	"Eric Paris" <eparis@parisplace.org>,
	netdev@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net,
	linux-afs@lists.infradead.org,
	"Mike Marshall" <hubcap@omnibond.com>,
	linux-xfs@vger.kernel.org, "Sage Weil" <sage@redhat.com>,
	"Miklos Szeredi" <miklos@szeredi.hu>,
	"Richard Weinberger" <richard@nod.at>,
	"Mark Fasheh" <mark@fasheh.com>,
	"Hugh Dickins" <hughd@google.com>
Subject: Re: [PATCH] Add flags option to get xattr method paired to __vfs_getxattr
Date: Fri, 16 Aug 2019 08:30:30 -0700	[thread overview]
Message-ID: <92b1df4b-6433-7d01-9c08-23de10e8d527@android.com> (raw)
In-Reply-To: <alpine.LRH.2.21.1908160825310.22623@namei.org>

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	other threads:[~2019-08-16 15:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-12 19:32 [PATCH] Add flags option to get xattr method paired to __vfs_getxattr Mark Salyzyn via Linux-f2fs-devel
2019-08-13  8:28 ` kbuild test robot
2019-08-13  8:48 ` Greg Kroah-Hartman
2019-08-13 14:37   ` Mark Salyzyn via Linux-f2fs-devel
2019-08-15 19:20   ` James Morris
2019-08-15 20:43     ` Greg Kroah-Hartman
2019-08-15 21:26     ` Mark Salyzyn
2019-08-15 22:27       ` James Morris
2019-08-16 15:30         ` Mark Salyzyn [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=92b1df4b-6433-7d01-9c08-23de10e8d527@android.com \
    --to=salyzyn@android.com \
    --cc=adilger.kernel@dilger.ca \
    --cc=asmadeus@codewreck.org \
    --cc=clm@fb.com \
    --cc=davem@davemloft.net \
    --cc=dhowells@redhat.com \
    --cc=eparis@parisplace.org \
    --cc=hubcap@omnibond.com \
    --cc=hughd@google.com \
    --cc=jfs-discussion@lists.sourceforge.net \
    --cc=jmorris@namei.org \
    --cc=kernel-team@android.com \
    --cc=linux-afs@lists.infradead.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=lucho@ionkov.net \
    --cc=mark@fasheh.com \
    --cc=martin@omnibond.com \
    --cc=miklos@szeredi.hu \
    --cc=netdev@vger.kernel.org \
    --cc=richard@nod.at \
    --cc=sage@redhat.com \
    --cc=samba-technical@lists.samba.org \
    --cc=shaggy@kernel.org \
    --cc=yuchao0@huawei.com \
    --cc=zohar@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox