From: Vivek Goyal <vgoyal@redhat.com>
To: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Cc: virtio-fs@redhat.com, qemu-devel@nongnu.org
Subject: Re: [PATCH 0/2] virtiofsd: Add capability to block xattrs
Date: Wed, 22 Sep 2021 08:30:18 -0400 [thread overview]
Message-ID: <YUsh2s/oJhVCLpoL@redhat.com> (raw)
In-Reply-To: <YUsMwfZI3sQyT/Rj@work-vm>
On Wed, Sep 22, 2021 at 12:00:17PM +0100, Dr. David Alan Gilbert wrote:
> * Vivek Goyal (vgoyal@redhat.com) wrote:
> > As of now we have a knob "-o xattr/no_xattr" which either enables
> > all xattrs or disables all xattrs.
>
> Hi Vivek,
> Thanks for this.
>
> > We need something more fine grained where we can selectively disable
> > only certain xattrs (and not all).
> >
> > For example, in some cases we want to disable "security.selinux"
> > xattr. This is equivalent to virtiofs not supporting security.selinux
> > and guest kernel will fallback to a single label for whole fs
> > (virtiofs_t).
> >
> > So add an option "-o block_xattr=<list-of-xattrs>" which will allow
> > specifying a list of xattrs to block.
>
> This is quite interesting; I'd not noticed you had the exisitng blocking
> mechanism,
Yes, that's for blocking posix acl xattrs if needed. If xattr map
support blocking, then we could probably insert an internal rule
to block posix acl xattrs. But that's more of a cleanup exercise
I will take up some other time.
> however, as discussed, I think my preference is if this could
> be done as a modification of the xattrmap it would avoid another set of
> options.
>
> The mapping code already has 'type's of:
>
> prefix, ok, bad
>
> I think you just need to add a 'reject' type
> that produces the error code you need.
How about "unsupported" and then return -EOPNOTSUPP?
I am looking at selinux kernel code and it expect -EOPNOTSUPP to decide
that selinux xattr is not supported and looks into fallback options.
static int sb_check_xattr_support(struct super_block *sb)
{
rc = __vfs_getxattr(root, root_inode, XATTR_NAME_SELINUX, NULL, 0);
if (rc < 0 && rc != -ENODATA) {
if (rc == -EOPNOTSUPP) {
pr_warn("SELinux: (dev %s, type %s) has no security xattr handler\n",
sb->s_id, sb->s_type->name);
goto fallback;
...
...
}
Vivek
prev parent reply other threads:[~2021-09-22 12:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-26 21:19 [PATCH 0/2] virtiofsd: Add capability to block xattrs Vivek Goyal
2021-08-26 21:19 ` [PATCH 1/2] virtiofsd: Add an array to keep track of blocked xattrs Vivek Goyal
2021-08-26 21:19 ` [PATCH 2/2] virtiofsd: Add option "block_xattr=" to block certain xattrs Vivek Goyal
2021-09-22 11:00 ` [PATCH 0/2] virtiofsd: Add capability to block xattrs Dr. David Alan Gilbert
2021-09-22 12:30 ` Vivek Goyal [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=YUsh2s/oJhVCLpoL@redhat.com \
--to=vgoyal@redhat.com \
--cc=dgilbert@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=virtio-fs@redhat.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;
as well as URLs for NNTP newsgroup(s).