]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ipc: introduce ipc_valid_object() helper to sort out IPC_RMID races
authorRafael Aquini <aquini@redhat.com>
Fri, 3 Jan 2014 03:10:37 +0000 (14:10 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 3 Jan 2014 03:10:37 +0000 (14:10 +1100)
commit53b216442e4b729e6b2766a45cb8ca3779bf2e35
tree55af3f1cd7f128fd037df0009d44f6bc2f7a1af4
parente940ef6b8eeadb774f51476971136eb8a17638ee
ipc: introduce ipc_valid_object() helper to sort out IPC_RMID races

After the locking semantics for the SysV IPC API got improved, a couple of
IPC_RMID race windows were opened because we ended up dropping the
'kern_ipc_perm.deleted' check performed way down in ipc_lock().  The
spotted races got sorted out by re-introducing the old test within the
racy critical sections.

This patch introduces ipc_valid_object() to consolidate the way we cope
with IPC_RMID races by using the same abstraction across the API
implementation.

Signed-off-by: Rafael Aquini <aquini@redhat.com>
Acked-by: Rik van Riel <riel@redhat.com>
Acked-by: Greg Thelen <gthelen@google.com>
Reviewed-by: Davidlohr Bueso <davidlohr@hp.com>
Cc: Manfred Spraul <manfred@colorfullife.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
ipc/msg.c
ipc/sem.c
ipc/shm.c
ipc/util.h