From: Jeff Layton <jlayton@redhat.com>
To: David Howells <dhowells@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>,
Andreas Gruenbacher <agruenba@redhat.com>,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] posix_acl: de-union a_refcount and a_rcu
Date: Thu, 07 Jul 2016 10:20:17 -0400 [thread overview]
Message-ID: <1467901217.3195.25.camel@redhat.com> (raw)
In-Reply-To: <1426.1467900668@warthog.procyon.org.uk>
On Thu, 2016-07-07 at 15:11 +0100, David Howells wrote:
> Jeff Layton <jlayton@redhat.com> wrote:
>
> >
> > Currently the two are unioned together, but I don't think that's
> > safe.
> >
> > It looks like get_cached_acl could race with the last put in
> > posix_acl_release. get_cached_acl calls atomic_inc_not_zero on
> > a_refcount, but that field could have already been clobbered by
> > call_rcu, and may no longer be zero. Fix this by de-unioning the
> > two
> > fields.
> >
> > Fixes: b8a7a3a66747 (posix_acl: Inode acl caching fixes)
> > Signed-off-by: Jeff Layton <jlayton@redhat.com>
> Acked-by: David Howells <dhowells@redhat.com>
Thanks David,
I think we're spared in most cases, as long as the atomic_inc_not_zero
occurs while the next pointer in the rcu_head is still NULL. If it's
not though, then we're set up for a GPF and/or a use-after-free.
AFAICT, this is a regression from v4.6, so I think we want this in
v4.7. Al, do you mind picking this up? Or NAK it and propose an
alternate fix?
Thanks,
--
Jeff Layton <jlayton@redhat.com>
next prev parent reply other threads:[~2016-07-07 14:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-05 23:55 [PATCH] posix_acl: de-union a_refcount and a_rcu Jeff Layton
2016-07-07 14:11 ` David Howells
2016-07-07 14:20 ` Jeff Layton [this message]
-- strict thread matches above, loose matches on Subject: below --
2016-07-11 15:01 Andreas Gruenbacher
2016-07-11 16:50 ` Linus Torvalds
2016-07-11 17:08 ` Jeff Layton
2016-07-11 17:49 ` Al Viro
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=1467901217.3195.25.camel@redhat.com \
--to=jlayton@redhat.com \
--cc=agruenba@redhat.com \
--cc=dhowells@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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).