]> git.baikalelectronics.ru Git - kernel.git/commit
netconsole: fix a deadlock with rtnl and netconsole's mutex
authorNikolay Aleksandrov <nikolay@redhat.com>
Thu, 19 Sep 2013 13:02:36 +0000 (15:02 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 19 Sep 2013 18:15:53 +0000 (14:15 -0400)
commit192666a5e18742e3c067203624e324582ef31f84
tree4d753b6aa3cb50f68f15e85b02cc7f17a443c802
parentcf2914884aeb0302e5deeaf1742c01f2ebddc8bf
netconsole: fix a deadlock with rtnl and netconsole's mutex

This bug was introduced by commit
925dc2a1df4c4f8113458903c1a7fe2cd6429305 ("netconsole: avoid a crash with
multiple sysfs writers"). In store_enabled() we have the following
sequence: acquire nt->mutex then rtnl, but in the netconsole netdev
notifier we have rtnl then nt->mutex effectively leading to a deadlock.
The NULL pointer dereference that the above commit tries to fix is
actually due to another bug in netpoll_cleanup(). This is fixed by dropping
the mutex from the netdev notifier as it's already protected by rtnl.

Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/netconsole.c