[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+EESO6XGpiTLnxPraZqBigY7mh6G2jkHa2PKXaHXpzdrZd4wA@mail.gmail.com>
Date: Tue, 4 Aug 2020 13:49:30 -0700
From: Lokesh Gidra <lokeshgidra@...gle.com>
To: Eric Biggers <ebiggers@...nel.org>
Cc: Alexander Viro <viro@...iv.linux.org.uk>,
Stephen Smalley <stephen.smalley.work@...il.com>,
casey@...aufler-ca.com, James Morris <jmorris@...ei.org>,
Kalesh Singh <kaleshsingh@...gle.com>,
Daniel Colascione <dancol@...col.org>,
Suren Baghdasaryan <surenb@...gle.com>,
Linux FS Devel <linux-fsdevel@...r.kernel.org>,
linux-kernel <linux-kernel@...r.kernel.org>,
Nick Kralevich <nnk@...gle.com>,
Jeffrey Vander Stoep <jeffv@...gle.com>,
Calin Juravle <calin@...gle.com>, kernel-team@...roid.com,
yanfei.xu@...driver.com,
syzbot+75867c44841cb6373570@...kaller.appspotmail.com
Subject: Re: [PATCH] Userfaultfd: Avoid double free of userfault_ctx and
remove O_CLOEXEC
On Tue, Aug 4, 2020 at 1:45 PM Eric Biggers <ebiggers@...nel.org> wrote:
>
> On Tue, Aug 04, 2020 at 01:31:55PM -0700, Lokesh Gidra wrote:
> > when get_unused_fd_flags returns error, ctx will be freed by
> > userfaultfd's release function, which is indirectly called by fput().
> > Also, if anon_inode_getfile_secure() returns an error, then
> > userfaultfd_ctx_put() is called, which calls mmdrop() and frees ctx.
> >
> > Also, the O_CLOEXEC was inadvertently added to the call to
> > get_unused_fd_flags() [1].
> >
> > Adding Al Viro's suggested-by, based on [2].
> >
> > [1] https://lore.kernel.org/lkml/1f69c0ab-5791-974f-8bc0-3997ab1d61ea@dancol.org/
> > [2] https://lore.kernel.org/lkml/20200719165746.GJ2786714@ZenIV.linux.org.uk/
> >
> > Fixes: d08ac70b1e0d (Wire UFFD up to SELinux)
> > Suggested-by: Al Viro <viro@...iv.linux.org.uk>
> > Reported-by: syzbot+75867c44841cb6373570@...kaller.appspotmail.com
> > Signed-off-by: Lokesh Gidra <lokeshgidra@...gle.com>
>
> What branch does this patch apply to? Neither mainline nor linux-next works.
>
On James Morris' tree (secure_uffd_v5.9 branch).
> - Eric
Powered by blists - more mailing lists