mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
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 <sasha.levin@oracle.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Change-Id: Id6639dd23f00eb29ee19c8c7c714769ba25efca7
This commit is contained in:
parent
2378a18866
commit
276d16ddf7
1 changed files with 1 additions and 1 deletions
|
@ -687,9 +687,9 @@ static inline int may_follow_link(struct path *link, struct nameidata *nd)
|
|||
if (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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue