diff options
-rw-r--r-- | ipc/util.c | 24 | ||||
-rw-r--r-- | ipc/util.h | 3 |
2 files changed, 4 insertions, 23 deletions
diff --git a/ipc/util.c b/ipc/util.c index 4704223bfad4..2c8a93b380ba 100644 --- a/ipc/util.c +++ b/ipc/util.c | |||
@@ -733,7 +733,7 @@ int ipc_update_perm(struct ipc64_perm *in, struct kern_ipc_perm *out) | |||
733 | } | 733 | } |
734 | 734 | ||
735 | /** | 735 | /** |
736 | * ipcctl_pre_down - retrieve an ipc and check permissions for some IPC_XXX cmd | 736 | * ipcctl_pre_down_nolock - retrieve an ipc and check permissions for some IPC_XXX cmd |
737 | * @ns: the ipc namespace | 737 | * @ns: the ipc namespace |
738 | * @ids: the table of ids where to look for the ipc | 738 | * @ids: the table of ids where to look for the ipc |
739 | * @id: the id of the ipc to retrieve | 739 | * @id: the id of the ipc to retrieve |
@@ -746,29 +746,13 @@ int ipc_update_perm(struct ipc64_perm *in, struct kern_ipc_perm *out) | |||
746 | * It must be called without any lock held and | 746 | * It must be called without any lock held and |
747 | * - retrieves the ipc with the given id in the given table. | 747 | * - retrieves the ipc with the given id in the given table. |
748 | * - performs some audit and permission check, depending on the given cmd | 748 | * - performs some audit and permission check, depending on the given cmd |
749 | * - returns the ipc with the ipc lock held in case of success | 749 | * - returns a pointer to the ipc object or otherwise, the corresponding error. |
750 | * or an err-code without any lock held otherwise. | ||
751 | * | 750 | * |
752 | * Call holding the both the rw_mutex and the rcu read lock. | 751 | * Call holding the both the rw_mutex and the rcu read lock. |
753 | */ | 752 | */ |
754 | struct kern_ipc_perm *ipcctl_pre_down(struct ipc_namespace *ns, | ||
755 | struct ipc_ids *ids, int id, int cmd, | ||
756 | struct ipc64_perm *perm, int extra_perm) | ||
757 | { | ||
758 | struct kern_ipc_perm *ipcp; | ||
759 | |||
760 | ipcp = ipcctl_pre_down_nolock(ns, ids, id, cmd, perm, extra_perm); | ||
761 | if (IS_ERR(ipcp)) | ||
762 | goto out; | ||
763 | |||
764 | spin_lock(&ipcp->lock); | ||
765 | out: | ||
766 | return ipcp; | ||
767 | } | ||
768 | |||
769 | struct kern_ipc_perm *ipcctl_pre_down_nolock(struct ipc_namespace *ns, | 753 | struct kern_ipc_perm *ipcctl_pre_down_nolock(struct ipc_namespace *ns, |
770 | struct ipc_ids *ids, int id, int cmd, | 754 | struct ipc_ids *ids, int id, int cmd, |
771 | struct ipc64_perm *perm, int extra_perm) | 755 | struct ipc64_perm *perm, int extra_perm) |
772 | { | 756 | { |
773 | kuid_t euid; | 757 | kuid_t euid; |
774 | int err = -EPERM; | 758 | int err = -EPERM; |
diff --git a/ipc/util.h b/ipc/util.h index b6a6a88f3002..41a6c4d26399 100644 --- a/ipc/util.h +++ b/ipc/util.h | |||
@@ -131,9 +131,6 @@ int ipc_update_perm(struct ipc64_perm *in, struct kern_ipc_perm *out); | |||
131 | struct kern_ipc_perm *ipcctl_pre_down_nolock(struct ipc_namespace *ns, | 131 | struct kern_ipc_perm *ipcctl_pre_down_nolock(struct ipc_namespace *ns, |
132 | struct ipc_ids *ids, int id, int cmd, | 132 | struct ipc_ids *ids, int id, int cmd, |
133 | struct ipc64_perm *perm, int extra_perm); | 133 | struct ipc64_perm *perm, int extra_perm); |
134 | struct kern_ipc_perm *ipcctl_pre_down(struct ipc_namespace *ns, | ||
135 | struct ipc_ids *ids, int id, int cmd, | ||
136 | struct ipc64_perm *perm, int extra_perm); | ||
137 | 134 | ||
138 | #ifndef CONFIG_ARCH_WANT_IPC_PARSE_VERSION | 135 | #ifndef CONFIG_ARCH_WANT_IPC_PARSE_VERSION |
139 | /* On IA-64, we always use the "64-bit version" of the IPC structures. */ | 136 | /* On IA-64, we always use the "64-bit version" of the IPC structures. */ |