]> git.karo-electronics.de Git - karo-tx-linux.git/commit
sysvipc: fix the ipc structures initialization
authorNadia Derbey <Nadia.Derbey@bull.net>
Wed, 19 Nov 2008 23:36:08 +0000 (15:36 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 5 Dec 2008 18:55:11 +0000 (10:55 -0800)
commitcbb502daa826e51ecdc50e7458aaf6216bc87cce
tree1b6800124188a9a028b072948edf86f1c36672dd
parent3cd2da9078ffbb87afc4d5a15fa1cbb0891a724d
sysvipc: fix the ipc structures initialization

commit e00b4ff7ebf098b11b11be403921c1cf41d9e321 upstream.

A problem was found while reviewing the code after Bugzilla bug
http://bugzilla.kernel.org/show_bug.cgi?id=11796.

In ipc_addid(), the newly allocated ipc structure is inserted into the
ipcs tree (i.e made visible to readers) without locking it.  This is not
correct since its initialization continues after it has been inserted in
the tree.

This patch moves the ipc structure lock initialization + locking before
the actual insertion.

Signed-off-by: Nadia Derbey <Nadia.Derbey@bull.net>
Reported-by: Clement Calmels <cboulte@gmail.com>
Cc: Manfred Spraul <manfred@colorfullife.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
ipc/util.c