mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
audit: set the name_len in audit_inode for parent lookups
Currently, this gets set mostly by happenstance when we call into audit_inode_child. While that might be a little more efficient, it seems wrong. If the syscall ends up failing before audit_inode_child ever gets called, then you'll have an audit_names record that shows the full path but has the parent inode info attached. Fix this by passing in a parent flag when we call audit_inode that gets set to the value of LOOKUP_PARENT. We can then fix up the pathname for the audit entry correctly from the get-go. While we're at it, clean up the no-op macro for audit_inode in the !CONFIG_AUDITSYSCALL case. Signed-off-by: Jeff Layton <[email protected]> Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
parent
78e2e802a8
commit
bfcec70874
8 changed files with 87 additions and 34 deletions
|
|
@ -478,7 +478,7 @@ SYSCALL_DEFINE2(fchmod, unsigned int, fd, umode_t, mode)
|
|||
|
||||
file = fget(fd);
|
||||
if (file) {
|
||||
audit_inode(NULL, file->f_path.dentry);
|
||||
audit_inode(NULL, file->f_path.dentry, 0);
|
||||
err = chmod_common(&file->f_path, mode);
|
||||
fput(file);
|
||||
}
|
||||
|
|
@ -588,7 +588,7 @@ SYSCALL_DEFINE3(fchown, unsigned int, fd, uid_t, user, gid_t, group)
|
|||
error = mnt_want_write_file(f.file);
|
||||
if (error)
|
||||
goto out_fput;
|
||||
audit_inode(NULL, f.file->f_path.dentry);
|
||||
audit_inode(NULL, f.file->f_path.dentry, 0);
|
||||
error = chown_common(&f.file->f_path, user, group);
|
||||
mnt_drop_write_file(f.file);
|
||||
out_fput:
|
||||
|
|
|
|||
Loading…
Reference in a new issue