Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fs: prevent use after free in auditing when symlink following was denied

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 <>
Signed-off-by: Al Viro <>
  • Loading branch information...
commit ffd8d101a3a7d3f2e79deee1e342801703b6dc70 1 parent 547b1e8
@sashalevin sashalevin authored Al Viro committed
Showing with 1 addition and 1 deletion.
  1. +1 −1  fs/namei.c
2  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);
- audit_log_link_denied("follow_link", link);
return -EACCES;
Please sign in to comment.
Something went wrong with that request. Please try again.