aboutsummaryrefslogtreecommitdiffstats
path: root/ipc/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'ipc/util.c')
-rw-r--r--ipc/util.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ipc/util.c b/ipc/util.c
index b3dcfad3b4f7..8193299f45f6 100644
--- a/ipc/util.c
+++ b/ipc/util.c
@@ -10,6 +10,8 @@
10 * Manfred Spraul <manfred@colorfullife.com> 10 * Manfred Spraul <manfred@colorfullife.com>
11 * Oct 2002 - One lock per IPC id. RCU ipc_free for lock-free grow_ary(). 11 * Oct 2002 - One lock per IPC id. RCU ipc_free for lock-free grow_ary().
12 * Mingming Cao <cmm@us.ibm.com> 12 * Mingming Cao <cmm@us.ibm.com>
13 * Mar 2006 - support for audit of ipc object properties
14 * Dustin Kirkland <dustin.kirkland@us.ibm.com>
13 */ 15 */
14 16
15#include <linux/config.h> 17#include <linux/config.h>
@@ -27,6 +29,7 @@
27#include <linux/workqueue.h> 29#include <linux/workqueue.h>
28#include <linux/seq_file.h> 30#include <linux/seq_file.h>
29#include <linux/proc_fs.h> 31#include <linux/proc_fs.h>
32#include <linux/audit.h>
30 33
31#include <asm/unistd.h> 34#include <asm/unistd.h>
32 35
@@ -464,8 +467,10 @@ void ipc_rcu_putref(void *ptr)
464 467
465int ipcperms (struct kern_ipc_perm *ipcp, short flag) 468int ipcperms (struct kern_ipc_perm *ipcp, short flag)
466{ /* flag will most probably be 0 or S_...UGO from <linux/stat.h> */ 469{ /* flag will most probably be 0 or S_...UGO from <linux/stat.h> */
467 int requested_mode, granted_mode; 470 int requested_mode, granted_mode, err;
468 471
472 if (unlikely((err = audit_ipc_obj(ipcp))))
473 return err;
469 requested_mode = (flag >> 6) | (flag >> 3) | flag; 474 requested_mode = (flag >> 6) | (flag >> 3) | flag;
470 granted_mode = ipcp->mode; 475 granted_mode = ipcp->mode;
471 if (current->euid == ipcp->cuid || current->euid == ipcp->uid) 476 if (current->euid == ipcp->cuid || current->euid == ipcp->uid)