|
Message-ID: <CAGXu5jL45EWVr9PfhF6vpb-PmHPZLOC9Dao_MKpjx2LBhbzKOg@mail.gmail.com> Date: Sun, 1 Jul 2012 18:26:38 -0700 From: Kees Cook <keescook@...omium.org> To: Al Viro <viro@...iv.linux.org.uk> Cc: linux-kernel@...r.kernel.org, Andrew Morton <akpm@...ux-foundation.org>, linux-fsdevel@...r.kernel.org, Eric Paris <eparis@...hat.com>, Matthew Wilcox <matthew@....cx>, Doug Ledford <dledford@...hat.com>, Joe Korty <joe.korty@...r.com>, "Eric W. Biederman" <ebiederm@...ssion.com>, Ingo Molnar <mingo@...e.hu>, David Howells <dhowells@...hat.com>, James Morris <james.l.morris@...cle.com>, linux-doc@...r.kernel.org, Dan Rosenberg <drosenberg@...curity.com>, kernel-hardening@...ts.openwall.com Subject: Re: [PATCH 1/2] fs: add link restrictions On Sun, Jul 1, 2012 at 5:43 PM, Kees Cook <keescook@...omium.org> wrote: > On Sat, Jun 30, 2012 at 2:14 AM, Al Viro <viro@...iv.linux.org.uk> wrote: >> On Mon, Jun 25, 2012 at 02:05:26PM -0700, Kees Cook wrote: >>> + err = may_follow_link(&link); >>> + if (unlikely(err)) >>> + break; >> >> No. This is definitely wrong - you are leaking dentries and vfsmount here. > > What should I do to avoid the leak? I thought it was avoiding the need > to call put_link because it aborts before calling follow_link. Does this need "path_put(&nd->path);" added to the abort case? If so, is this also missing from follow_link()'s final "return error", or is it the responsibility of dentry->d_inode->i_op->follow_link() to have already called path_put()? -Kees -- Kees Cook Chrome OS Security
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.