diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-19 16:05:38 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-19 16:05:38 -0400 |
commit | a7204d72db251784808b0c050220992d7f833a2c (patch) | |
tree | 3491452ea74b039f3278fd95bb7ad7c88b6b3631 /ipc/util.c | |
parent | ba6857b2d49646f2d4c245ff58d95d145f380177 (diff) | |
parent | 31d141e3a666269a3b6fcccddb0351caf7454240 (diff) |
Merge 3.12-rc6 into driver-core-next
We want these fixes here too.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'ipc/util.c')
-rw-r--r-- | ipc/util.c | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/ipc/util.c b/ipc/util.c index fdb8ae740775..7684f41bce76 100644 --- a/ipc/util.c +++ b/ipc/util.c | |||
@@ -17,12 +17,27 @@ | |||
17 | * Pavel Emelianov <xemul@openvz.org> | 17 | * Pavel Emelianov <xemul@openvz.org> |
18 | * | 18 | * |
19 | * General sysv ipc locking scheme: | 19 | * General sysv ipc locking scheme: |
20 | * when doing ipc id lookups, take the ids->rwsem | 20 | * rcu_read_lock() |
21 | * rcu_read_lock() | 21 | * obtain the ipc object (kern_ipc_perm) by looking up the id in an idr |
22 | * obtain the ipc object (kern_ipc_perm) | 22 | * tree. |
23 | * perform security, capabilities, auditing and permission checks, etc. | 23 | * - perform initial checks (capabilities, auditing and permission, |
24 | * acquire the ipc lock (kern_ipc_perm.lock) throught ipc_lock_object() | 24 | * etc). |
25 | * perform data updates (ie: SET, RMID, LOCK/UNLOCK commands) | 25 | * - perform read-only operations, such as STAT, INFO commands. |
26 | * acquire the ipc lock (kern_ipc_perm.lock) through | ||
27 | * ipc_lock_object() | ||
28 | * - perform data updates, such as SET, RMID commands and | ||
29 | * mechanism-specific operations (semop/semtimedop, | ||
30 | * msgsnd/msgrcv, shmat/shmdt). | ||
31 | * drop the ipc lock, through ipc_unlock_object(). | ||
32 | * rcu_read_unlock() | ||
33 | * | ||
34 | * The ids->rwsem must be taken when: | ||
35 | * - creating, removing and iterating the existing entries in ipc | ||
36 | * identifier sets. | ||
37 | * - iterating through files under /proc/sysvipc/ | ||
38 | * | ||
39 | * Note that sems have a special fast path that avoids kern_ipc_perm.lock - | ||
40 | * see sem_lock(). | ||
26 | */ | 41 | */ |
27 | 42 | ||
28 | #include <linux/mm.h> | 43 | #include <linux/mm.h> |