]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: Fix potential null pointer dereference
authorAaron Conole <aconole@bytheb.org>
Wed, 28 Sep 2016 15:35:14 +0000 (11:35 -0400)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 30 Sep 2016 18:15:26 +0000 (20:15 +0200)
commitde655fe779710638f64c9c9772e4b442f46cd1cb
treefb9d0cb7d6486870a61abde7274baf05111e3d76
parent52c8a801fe787fa53776236ef1bfabdd875d1c9a
netfilter: Fix potential null pointer dereference

It's possible for nf_hook_entry_head to return NULL.  If two
nf_unregister_net_hook calls happen simultaneously with a single hook
entry in the list, both will enter the nf_hook_mutex critical section.
The first will successfully delete the head, but the second will see
this NULL pointer and attempt to dereference.

This fix ensures that no null pointer dereference could occur when such
a condition happens.

Fixes: b788bbf51085 ("netfilter: replace list_head with single linked list")
Signed-off-by: Aaron Conole <aconole@bytheb.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/core.c