linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs: prevent use after free in auditing when symlink following was denied
@ 2012-10-04 23:56 Sasha Levin
  2012-10-05  0:33 ` Kees Cook
  2012-10-05  0:43 ` Al Viro
  0 siblings, 2 replies; 3+ messages in thread
From: Sasha Levin @ 2012-10-04 23:56 UTC (permalink / raw)
  To: viro, keescook
  Cc: levinsasha928, davej, linux-fsdevel, linux-kernel, Sasha Levin

Commit "fs: add link restriction audit reporting" has added auditing of failed
attempts to follow symlinks. Unfortunately, the auditing was being done after
the struct path structure was released earlier.

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 fs/namei.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/namei.c b/fs/namei.c
index aa30d19..6d47fac 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -692,9 +692,9 @@ static inline int may_follow_link(struct path *link, struct nameidata *nd)
 	if (uid_eq(parent->i_uid, inode->i_uid))
 		return 0;
 
+	audit_log_link_denied("follow_link", link);
 	path_put_conditional(link, nd);
 	path_put(&nd->path);
-	audit_log_link_denied("follow_link", link);
 	return -EACCES;
 }
 
-- 
1.7.12


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] fs: prevent use after free in auditing when symlink following was denied
  2012-10-04 23:56 [PATCH] fs: prevent use after free in auditing when symlink following was denied Sasha Levin
@ 2012-10-05  0:33 ` Kees Cook
  2012-10-05  0:43 ` Al Viro
  1 sibling, 0 replies; 3+ messages in thread
From: Kees Cook @ 2012-10-05  0:33 UTC (permalink / raw)
  To: Sasha Levin
  Cc: viro, keescook, levinsasha928, davej, linux-fsdevel, linux-kernel

On Thu, Oct 04, 2012 at 07:56:40PM -0400, Sasha Levin wrote:
> Commit "fs: add link restriction audit reporting" has added auditing of failed
> attempts to follow symlinks. Unfortunately, the auditing was being done after
> the struct path structure was released earlier.
> 
> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>

Thanks for catching that!

Cc: stable@vger.kernel.org
Acked-by: Kees Cook <keescook@chromium.org>

-- 
Kees Cook                                            @outflux.net

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] fs: prevent use after free in auditing when symlink following was denied
  2012-10-04 23:56 [PATCH] fs: prevent use after free in auditing when symlink following was denied Sasha Levin
  2012-10-05  0:33 ` Kees Cook
@ 2012-10-05  0:43 ` Al Viro
  1 sibling, 0 replies; 3+ messages in thread
From: Al Viro @ 2012-10-05  0:43 UTC (permalink / raw)
  To: Sasha Levin; +Cc: keescook, levinsasha928, davej, linux-fsdevel, linux-kernel

On Thu, Oct 04, 2012 at 07:56:40PM -0400, Sasha Levin wrote:
> Commit "fs: add link restriction audit reporting" has added auditing of failed
> attempts to follow symlinks. Unfortunately, the auditing was being done after
> the struct path structure was released earlier.

Applied, and it's -stable fodder as well.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-10-05  0:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-04 23:56 [PATCH] fs: prevent use after free in auditing when symlink following was denied Sasha Levin
2012-10-05  0:33 ` Kees Cook
2012-10-05  0:43 ` Al Viro

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).