mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-14 21:01:29 +00:00
[PATCH] Fix do_path_lookup() to add the check for error in link_path_walk()
Fix do_path_lookup() to avoid accessing invalid dentry or inode when the link_path_walk() has failed. This should fix Bugme #5897. Signed-off-by: Suzuki K P <suzuki@in.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
c00a76aea3
commit
3bc8414b07
@ -1119,9 +1119,11 @@ static int fastcall do_path_lookup(int dfd, const char *name,
|
||||
current->total_link_count = 0;
|
||||
retval = link_path_walk(name, nd);
|
||||
out:
|
||||
if (unlikely(current->audit_context
|
||||
&& nd && nd->dentry && nd->dentry->d_inode))
|
||||
if (likely(retval == 0)) {
|
||||
if (unlikely(current->audit_context && nd && nd->dentry &&
|
||||
nd->dentry->d_inode))
|
||||
audit_inode(name, nd->dentry->d_inode, flags);
|
||||
}
|
||||
return retval;
|
||||
|
||||
fput_unlock_fail:
|
||||
|
Loading…
Reference in New Issue
Block a user