mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eric Paris <eparis@redhat.com>
To: Josh Boyer <jwboyer@fedoraproject.org>
Cc: Anand Avati <avati@redhat.com>, James Morris <jmorris@namei.org>,
	Eric Sandeen <sandeen@redhat.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	"Linux-Kernel@Vger. Kernel. Org" <linux-kernel@vger.kernel.org>
Subject: Re: SELinux change in 3.13 causes sync hang
Date: Tue, 10 Dec 2013 15:25:23 -0500	[thread overview]
Message-ID: <1386707123.23829.23.camel@flatline.rdu.redhat.com> (raw)
In-Reply-To: <CA+5PVA56s68i_Ad+FiT_8_OHZt3BeZdpqdzc6RVbgOx68=MaOQ@mail.gmail.com>

I still believe (assuming Josh says it tests ok) that a revert is a
reasonable fix until next window.  But I might know the actual problem:

Lets assume policy says:
   fuse.gluster == use_xattr

Lets assume this function is called with
sb->s_type->name == fuse
sb->s_subtype == NULL

int security_fs_use(struct super_block *sb)
{
        int rc = 0;
        struct ocontext *c;
        struct superblock_security_struct *sbsec = sb->s_security;
        const char *fstype = sb->s_type->name;
        const char *subtype = (sb->s_subtype && sb->s_subtype[0]) ? sb->s_subtype : NULL;
        struct ocontext *base = NULL;

        read_lock(&policy_rwlock);

        for (c = policydb.ocontexts[OCON_FSUSE]; c; c = c->next) {
                char *sub;
                int baselen;

                baselen = strlen(fstype);

		**********  assume c == the above rule   name = fuse.gluster

                /* if base does not match, this is not the one */
                if (strncmp(fstype, c->u.name, baselen))    <----------- this will match
                        continue;

                /* if there is no subtype, this is the one! */
                if (!subtype)   <--------------------------------------- we will break here!
                        break;
[snip]
        }
[snip]
        if (c) {
                sbsec->behavior = c->v.behavior;

So we just matched on the fuse.gluster rule even though the mount in
question was fstype=fuse subtype=NULL     So we will try to use xattrs
on a fuse FS that can/will deadlock.

I'll try to write a patch to fix that logic...

-Eric


  parent reply	other threads:[~2013-12-10 20:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-10 20:06 Josh Boyer
2013-12-10 20:11 ` Eric Paris
2013-12-10 20:25 ` Eric Paris [this message]
2013-12-10 20:35   ` Eric Paris
2013-12-10 21:58     ` Anand Avati
2013-12-10 22:00       ` Eric Paris
2013-12-10 21:38   ` Josh Boyer

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=1386707123.23829.23.camel@flatline.rdu.redhat.com \
    --to=eparis@redhat.com \
    --cc=avati@redhat.com \
    --cc=jmorris@namei.org \
    --cc=jwboyer@fedoraproject.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sandeen@redhat.com \
    --cc=torvalds@linux-foundation.org \
    /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

all inboxes | Powered by JetHome®