diff options
| author | Manfred Spraul <[email protected]> | 2014-12-02 23:59:34 +0000 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2014-12-03 17:36:03 +0000 |
| commit | e8577d1f0329d4842e8302e289fb2c22156abef4 (patch) | |
| tree | f16f344a3d414db2a0d848b7ca19470b468c902e /lib/genalloc.c | |
| parent | drivers/input/evdev.c: don't kfree() a vmalloc address (diff) | |
| download | kernel-e8577d1f0329d4842e8302e289fb2c22156abef4.tar.gz kernel-e8577d1f0329d4842e8302e289fb2c22156abef4.zip | |
ipc/sem.c: fully initialize sem_array before making it visible
ipc_addid() makes a new ipc identifier visible to everyone. New objects
start as locked, so that the caller can complete the initialization
after the call. Within struct sem_array, at least sma->sem_base and
sma->sem_nsems are accessed without any locks, therefore this approach
doesn't work.
Thus: Move the ipc_addid() to the end of the initialization.
Signed-off-by: Manfred Spraul <[email protected]>
Reported-by: Rik van Riel <[email protected]>
Acked-by: Rik van Riel <[email protected]>
Acked-by: Davidlohr Bueso <[email protected]>
Acked-by: Rafael Aquini <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'lib/genalloc.c')
0 files changed, 0 insertions, 0 deletions
