diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2008-12-10 03:40:06 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-01-04 15:14:39 -0500 |
commit | a33e6751003c5ade603737d828b1519d980ce392 (patch) | |
tree | aa484d033e886945aed78172dbdd4d2fd928bacf /ipc | |
parent | f3298dc4f2277874d40cb4fc3a6e277317d6603b (diff) |
sanitize audit_ipc_obj()
* get rid of allocations
* make it return void
* simplify callers
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'ipc')
-rw-r--r-- | ipc/shm.c | 4 | ||||
-rw-r--r-- | ipc/util.c | 9 |
2 files changed, 4 insertions, 9 deletions
@@ -747,9 +747,7 @@ asmlinkage long sys_shmctl(int shmid, int cmd, struct shmid_ds __user *buf) | |||
747 | goto out; | 747 | goto out; |
748 | } | 748 | } |
749 | 749 | ||
750 | err = audit_ipc_obj(&(shp->shm_perm)); | 750 | audit_ipc_obj(&(shp->shm_perm)); |
751 | if (err) | ||
752 | goto out_unlock; | ||
753 | 751 | ||
754 | if (!capable(CAP_IPC_LOCK)) { | 752 | if (!capable(CAP_IPC_LOCK)) { |
755 | uid_t euid = current_euid(); | 753 | uid_t euid = current_euid(); |
diff --git a/ipc/util.c b/ipc/util.c index 5a1808c774a2..579552abd50a 100644 --- a/ipc/util.c +++ b/ipc/util.c | |||
@@ -624,10 +624,9 @@ void ipc_rcu_putref(void *ptr) | |||
624 | int ipcperms (struct kern_ipc_perm *ipcp, short flag) | 624 | int ipcperms (struct kern_ipc_perm *ipcp, short flag) |
625 | { /* flag will most probably be 0 or S_...UGO from <linux/stat.h> */ | 625 | { /* flag will most probably be 0 or S_...UGO from <linux/stat.h> */ |
626 | uid_t euid = current_euid(); | 626 | uid_t euid = current_euid(); |
627 | int requested_mode, granted_mode, err; | 627 | int requested_mode, granted_mode; |
628 | 628 | ||
629 | if (unlikely((err = audit_ipc_obj(ipcp)))) | 629 | audit_ipc_obj(ipcp); |
630 | return err; | ||
631 | requested_mode = (flag >> 6) | (flag >> 3) | flag; | 630 | requested_mode = (flag >> 6) | (flag >> 3) | flag; |
632 | granted_mode = ipcp->mode; | 631 | granted_mode = ipcp->mode; |
633 | if (euid == ipcp->cuid || | 632 | if (euid == ipcp->cuid || |
@@ -803,9 +802,7 @@ struct kern_ipc_perm *ipcctl_pre_down(struct ipc_ids *ids, int id, int cmd, | |||
803 | goto out_up; | 802 | goto out_up; |
804 | } | 803 | } |
805 | 804 | ||
806 | err = audit_ipc_obj(ipcp); | 805 | audit_ipc_obj(ipcp); |
807 | if (err) | ||
808 | goto out_unlock; | ||
809 | 806 | ||
810 | if (cmd == IPC_SET) { | 807 | if (cmd == IPC_SET) { |
811 | err = audit_ipc_set_perm(extra_perm, perm->uid, | 808 | err = audit_ipc_set_perm(extra_perm, perm->uid, |