Messages in this thread | | | Date | Sun, 1 Jul 2012 18:26:38 -0700 | Subject | Re: [PATCH 1/2] fs: add link restrictions | From | Kees Cook <> |
| |
On Sun, Jul 1, 2012 at 5:43 PM, Kees Cook <keescook@chromium.org> wrote: > On Sat, Jun 30, 2012 at 2:14 AM, Al Viro <viro@zeniv.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
| |