bonding: fix race condition in bonding_store_slaves_active
authornikolay@redhat.com <nikolay@redhat.com>
Thu, 29 Nov 2012 01:37:59 +0000 (01:37 +0000)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 3 Jan 2013 03:33:49 +0000 (03:33 +0000)
commitdba4bf75ea4ee734a7537f62817386bebc119413
treed00a29fdd7287d1c793c741564e5094ccdf7e6d3
parent12ca0b6bf4aceb39fa0466335698009aa43affa9
bonding: fix race condition in bonding_store_slaves_active

[ Upstream commit e196c0e579902f42cf72414461fb034e5a1ffbf7 ]

Race between bonding_store_slaves_active() and slave manipulation
 functions. The bond_for_each_slave use in bonding_store_slaves_active()
 is not protected by any synchronization mechanism.
 NULL pointer dereference is easy to reach.
 Fixed by acquiring the bond->lock for the slave walk.

 v2: Make description text < 75 columns

Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/net/bonding/bond_sysfs.c