From: Anand Avati <avati@redhat.com>
To: Eric Paris <eparis@redhat.com>, Josh Boyer <jwboyer@fedoraproject.org>
Cc: 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 13:58:54 -0800 [thread overview]
Message-ID: <52A78E9E.8080706@redhat.com> (raw)
In-Reply-To: <1386707744.23829.25.camel@flatline.rdu.redhat.com>
On 12/10/13, 12:35 PM, Eric Paris wrote:
> On Tue, 2013-12-10 at 15:25 -0500, Eric Paris wrote:
>
>> I'll try to write a patch to fix that logic...
>
> Anand,
>
> How about something like (untested but it compiles):
Sorry, it took me a while to compare the committed patch and my original
submission. The original patch did not have the subtype matching issue
(but had a different issue) and it looks like this bug has come in the
reworked/committed patch. I think the fix you have pasted below works.
Reviewed-by: Anand Avati <avati@redhat.com>
Thanks,
Avati
>
> diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c
> index ee470a0..2b437fc8 100644
> --- a/security/selinux/ss/services.c
> +++ b/security/selinux/ss/services.c
> @@ -2349,9 +2359,17 @@ int security_fs_use(struct super_block *sb)
> if (strncmp(fstype, c->u.name, baselen))
> continue;
>
> - /* if there is no subtype, this is the one! */
> - if (!subtype)
> - break;
> + /* current mount has no subtype */
> + if (!subtype) {
> + /*
> + * if there is no subtype in policy this is our match
> + * if there is a subtype in policy keep looking,
> + */
> + if (baselen == strlen(c->u.name))
> + break;
> + else
> + continue;
> + }
>
> /* skip past the base in this entry */
> sub = c->u.name + baselen;
>
>
next prev parent reply other threads:[~2013-12-10 21:58 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
2013-12-10 20:35 ` Eric Paris
2013-12-10 21:58 ` Anand Avati [this message]
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=52A78E9E.8080706@redhat.com \
--to=avati@redhat.com \
--cc=eparis@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®