]> git.karo-electronics.de Git - karo-tx-linux.git/commit
bonding: fix bonding_masters race condition in bond unloading
authornikolay@redhat.com <nikolay@redhat.com>
Sat, 6 Apr 2013 00:54:38 +0000 (00:54 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 May 2013 16:46:16 +0000 (09:46 -0700)
commite6b6133de54db31efc5b28b52a5892584dba409a
tree6b559f92905cc926499935ebd14a1e225d825e71
parentbca07ae344f112d51a3ac548cfae6e100f7665f9
bonding: fix bonding_masters race condition in bond unloading

[ Upstream commit 69b0216ac255f523556fa3d4ff030d857eaaa37f ]

While the bonding module is unloading, it is considered that after
rtnl_link_unregister all bond devices are destroyed but since no
synchronization mechanism exists, a new bond device can be created
via bonding_masters before unregister_pernet_subsys which would
lead to multiple problems (e.g. NULL pointer dereference, wrong RIP,
list corruption).

This patch fixes the issue by removing any bond devices left in the
netns after bonding_masters is removed from sysfs.

Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
Acked-by: Veaceslav Falico <vfalico@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/bonding/bond_main.c