mirror of
https://github.com/torvalds/linux.git
synced 2026-09-15 15:01:08 -04:00
[PATCH] fix faulty inode data collection for open() with O_CREAT
When the specified path is an existing file or when it is a symlink, audit collects the wrong inode number, which causes it to miss the open() event. Adding a second hook to the open() path fixes this. Also add audit_copy_inode() to consolidate some code. Signed-off-by: Amy Griffis <amy.griffis@hp.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
@@ -1659,6 +1659,7 @@ do_last:
|
||||
* It already exists.
|
||||
*/
|
||||
mutex_unlock(&dir->d_inode->i_mutex);
|
||||
audit_inode_update(path.dentry->d_inode);
|
||||
|
||||
error = -EEXIST;
|
||||
if (flag & O_EXCL)
|
||||
@@ -1669,6 +1670,7 @@ do_last:
|
||||
if (flag & O_NOFOLLOW)
|
||||
goto exit_dput;
|
||||
}
|
||||
|
||||
error = -ENOENT;
|
||||
if (!path.dentry->d_inode)
|
||||
goto exit_dput;
|
||||
|
||||
Reference in New Issue
Block a user