]> git.baikalelectronics.ru Git - kernel.git/commit
tipc: ensure all name sequences are properly protected with its lock
authorYing Xue <ying.xue@windriver.com>
Tue, 2 Dec 2014 07:00:26 +0000 (15:00 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 9 Dec 2014 01:39:56 +0000 (20:39 -0500)
commit960a9b50da500be3584f0da5d0b5d2738c9090ba
tree9a42f3c86666854a6b1221b89d4971dc9584055a
parentbcf0237fe5b55c55b45b065b00ef85c8d41f9da6
tipc: ensure all name sequences are properly protected with its lock

TIPC internally created a name table which is used to store name
sequences. Now there is a read-write lock - tipc_nametbl_lock to
protect the table, and each name sequence saved in the table is
protected with its private lock. When a name sequence is inserted
or removed to or from the table, its members might need to change.
Therefore, in normal case, the two locks must be held while TIPC
operates the table. However, there are still several places where
we only hold tipc_nametbl_lock without proprerly obtaining name
sequence lock, which might cause the corruption of name sequence.

Signed-off-by: Ying Xue <ying.xue@windriver.com>
Reviewed-by: Erik Hugne <erik.hugne@ericsson.com>
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
Tested-by: Erik Hugne <erik.hugne@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/name_table.c