diff options
author | Florian Westphal <fw@strlen.de> | 2020-03-27 03:24:48 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2020-03-29 16:28:29 +0200 |
commit | af370ab36fcd19f04e3408c402608e7e56e6f188 (patch) | |
tree | 611e42c64973cbfbed7d42259708738b42c32964 /arch/unicore32 | |
parent | 119e52e664c57d5f7c0174dc2b3a296b1e40591d (diff) | |
download | linux-af370ab36fcd19f04e3408c402608e7e56e6f188.tar.gz linux-af370ab36fcd19f04e3408c402608e7e56e6f188.tar.bz2 linux-af370ab36fcd19f04e3408c402608e7e56e6f188.zip |
netfilter: nf_queue: do not release refcouts until nf_reinject is done
nf_queue is problematic when another NF_QUEUE invocation happens
from nf_reinject().
1. nf_queue is invoked, increments state->sk refcount.
2. skb is queued, waiting for verdict.
3. sk is closed/released.
3. verdict comes back, nf_reinject is called.
4. nf_reinject drops the reference -- refcount can now drop to 0
Instead of get_ref/release_ref pattern, we need to nest the get_ref calls:
get_ref
get_ref
release_ref
release_ref
So that when we invoke the next processing stage (another netfilter
or the okfn()), we hold at least one reference count on the
devices/socket.
After previous patch, it is now safe to put the entry even after okfn()
has potentially free'd the skb.
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'arch/unicore32')
0 files changed, 0 insertions, 0 deletions