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 <jlayton@redhat.com> Signed-off-by:
Al Viro <viro@zeniv.linux.org.uk>
Showing
- fs/namei.c 7 additions, 7 deletionsfs/namei.c
- fs/open.c 2 additions, 2 deletionsfs/open.c
- fs/xattr.c 4 additions, 4 deletionsfs/xattr.c
- include/linux/audit.h 10 additions, 5 deletionsinclude/linux/audit.h
- ipc/mqueue.c 4 additions, 4 deletionsipc/mqueue.c
- kernel/audit.h 1 addition, 0 deletionskernel/audit.h
- kernel/auditfilter.c 30 additions, 0 deletionskernel/auditfilter.c
- kernel/auditsc.c 29 additions, 12 deletionskernel/auditsc.c
Loading
Please register or sign in to comment