Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ipc/sem.c: fully initialize sem_array before making it visible
(cherry pick from commit e8577d1f0329d4842e8302e289fb2c22156abef4) 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]> Signed-off-by: Mark Salyzyn <[email protected]> Bug: 24551430 Change-Id: I36a8cc2281dfd68e9a399695f1d7e7b038e105d0
- Loading branch information