mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
netfilter: nfnetlink: check callbacks before using those in nfnetlink_rcv_msg
nfnetlink_rcv_msg() might call a NULL callback which will cause NULL pointer dereference. Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
parent
be0593c678
commit
59560a38a3
1 changed files with 3 additions and 1 deletions
|
@ -184,9 +184,11 @@ replay:
|
||||||
lockdep_is_held(&nfnl_mutex)) != ss ||
|
lockdep_is_held(&nfnl_mutex)) != ss ||
|
||||||
nfnetlink_find_client(type, ss) != nc)
|
nfnetlink_find_client(type, ss) != nc)
|
||||||
err = -EAGAIN;
|
err = -EAGAIN;
|
||||||
else
|
else if (nc->call)
|
||||||
err = nc->call(net->nfnl, skb, nlh,
|
err = nc->call(net->nfnl, skb, nlh,
|
||||||
(const struct nlattr **)cda);
|
(const struct nlattr **)cda);
|
||||||
|
else
|
||||||
|
err = -EINVAL;
|
||||||
nfnl_unlock();
|
nfnl_unlock();
|
||||||
}
|
}
|
||||||
if (err == -EAGAIN)
|
if (err == -EAGAIN)
|
||||||
|
|
Loading…
Add table
Reference in a new issue