Skip to contentSkip to conversation

log obj label when opening an existing mq

PATCH New Amy Griffis 1 participant 1 message Jan 24, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 log obj label when opening an existing mq

Add an audit_inode() hook to mq_open() so audit will log the object label for an existing POSIX message queue. Without this patch, audit only logs the object label when a new message queue is created.

Untested patch against lspp.63 kernel.

---

ipc/mqueue.c +1 -0
diff -Nrup linux-2.6.18.x86_64/ipc/mqueue.c linux-2.6.18.x86_64-amg/ipc/mqueue.c
@@ -642,6 +642,7 @@ static int oflag2acc[O_ACCMODE] = { MAY_
 		return ERR_PTR(-EINVAL);
 	}
 
+	audit_inode(dentry->d_name.name, dentry->d_inode);
 	if (permission(dentry->d_inode, oflag2acc[oflag & O_ACCMODE], NULL)) {
 		dput(dentry);
 		mntput(mqueue_mnt);