Commit 605303cc authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] selinux: Add dname to audit output when a path cannot be generated.

From: James Morris <jmorris@redhat.com>

This patch adds dname to audit output when a path cannot be generated.
This makes analysis of SELinux audit logs easier.

Patch by Stephen Smalley <sds@epoch.ncsc.mil>.
parent da6e57a2
...@@ -575,17 +575,26 @@ void avc_audit(u32 ssid, u32 tsid, ...@@ -575,17 +575,26 @@ void avc_audit(u32 ssid, u32 tsid,
break; break;
case AVC_AUDIT_DATA_FS: case AVC_AUDIT_DATA_FS:
if (a->u.fs.dentry) { if (a->u.fs.dentry) {
struct dentry *dentry = a->u.fs.dentry;
if (a->u.fs.mnt) { if (a->u.fs.mnt) {
p = d_path(a->u.fs.dentry, p = d_path(dentry,
a->u.fs.mnt, a->u.fs.mnt,
avc_audit_buffer, avc_audit_buffer,
PAGE_SIZE); PAGE_SIZE);
if (p) if (p)
printk(" path=%s", p); printk(" path=%s", p);
} else {
printk(" name=%s", dentry->d_name.name);
} }
inode = a->u.fs.dentry->d_inode; inode = dentry->d_inode;
} else if (a->u.fs.inode) { } else if (a->u.fs.inode) {
struct dentry *dentry;
inode = a->u.fs.inode; inode = a->u.fs.inode;
dentry = d_find_alias(inode);
if (dentry) {
printk(" name=%s", dentry->d_name.name);
dput(dentry);
}
} }
if (inode) if (inode)
printk(" dev=%s ino=%ld", printk(" dev=%s ino=%ld",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment