aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/netpoll.h
diff options
context:
space:
mode:
authorNikolay Aleksandrov <nikolay@redhat.com>2013-10-23 15:04:49 +0200
committerDavid S. Miller <davem@davemloft.net>2013-10-25 19:26:58 -0400
commit45e526e80e6fdc796d3bc05716d5c930a427df4d (patch)
tree1d6909c66190e5e5a30c28fa66b6edd760126f07 /include/linux/netpoll.h
parentnet: wan: sbni: remove assembly crc32 code (diff)
downloadwireguard-linux-45e526e80e6fdc796d3bc05716d5c930a427df4d.tar.xz
wireguard-linux-45e526e80e6fdc796d3bc05716d5c930a427df4d.zip
netconsole: fix NULL pointer dereference
We need to disable the netconsole (enabled = 0) before setting nt->np.dev to NULL because otherwise we might still have users after the netpoll_cleanup() since nt->enabled is set afterwards and we can have a message which will result in a NULL pointer dereference. It is very easy to hit dereferences all over the netpoll_send_udp function by running the following two loops in parallel: while [ 1 ]; do echo 1 > enabled; echo 0 > enabled; done; while [ 1 ]; do echo 00:11:22:33:44:55 > remote_mac; done; (the second loop is to generate messages, it can be done by anything) We're safe to set nt->np.dev = NULL and nt->enabled = 0 with the spinlock since it's required in the write_msg() function. Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com> Reviewed-by: Veacelsav Falico <vfalico@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netpoll.h')
0 files changed, 0 insertions, 0 deletions