mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
ipc: rename ipcctl_pre_down_nolock()
Both the comment and the name of ipcctl_pre_down_nolock() are misleading: The function must be called while holdling the rw semaphore. Therefore the patch renames the function to ipcctl_obtain_check(): This name matches the other names used in util.c: - "obtain" function look up a pointer in the idr, without acquiring the object lock. - The caller is responsible for locking. - _check means that the sequence number is checked. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Manfred Spraul <[email protected]> Reviewed-by: Davidlohr Bueso <[email protected]> Cc: Davidlohr Bueso <[email protected]> Cc: Dmitry Vyukov <[email protected]> Cc: Herbert Xu <[email protected]> Cc: Kees Cook <[email protected]> Cc: Michael Kerrisk <[email protected]> Cc: Michal Hocko <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
39cfffd774
commit
4241c1a304
5 changed files with 8 additions and 8 deletions
|
|
@ -688,7 +688,7 @@ int ipc_update_perm(struct ipc64_perm *in, struct kern_ipc_perm *out)
|
|||
}
|
||||
|
||||
/**
|
||||
* ipcctl_pre_down_nolock - retrieve an ipc and check permissions for some IPC_XXX cmd
|
||||
* ipcctl_obtain_check - retrieve an ipc object and check permissions
|
||||
* @ns: ipc namespace
|
||||
* @ids: the table of ids where to look for the ipc
|
||||
* @id: the id of the ipc to retrieve
|
||||
|
|
@ -698,16 +698,16 @@ int ipc_update_perm(struct ipc64_perm *in, struct kern_ipc_perm *out)
|
|||
*
|
||||
* This function does some common audit and permissions check for some IPC_XXX
|
||||
* cmd and is called from semctl_down, shmctl_down and msgctl_down.
|
||||
* It must be called without any lock held and:
|
||||
*
|
||||
* - retrieves the ipc with the given id in the given table.
|
||||
* It:
|
||||
* - retrieves the ipc object with the given id in the given table.
|
||||
* - performs some audit and permission check, depending on the given cmd
|
||||
* - returns a pointer to the ipc object or otherwise, the corresponding
|
||||
* error.
|
||||
*
|
||||
* Call holding the both the rwsem and the rcu read lock.
|
||||
*/
|
||||
struct kern_ipc_perm *ipcctl_pre_down_nolock(struct ipc_namespace *ns,
|
||||
struct kern_ipc_perm *ipcctl_obtain_check(struct ipc_namespace *ns,
|
||||
struct ipc_ids *ids, int id, int cmd,
|
||||
struct ipc64_perm *perm, int extra_perm)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue