Skip to content

Commit

Permalink
netfilter: nf_queue: fix NF_STOLEN skb leak
Browse files Browse the repository at this point in the history
commit 3bc3871 (handle NF_STOP and unknown verdicts in
nf_reinject) was a partial fix to packet leaks.

If user asks NF_STOLEN status, we must free the skb as well.

Reported-by: Afi Gjermund <afigjermund@gmail.com>
Signed-off-by: Eric DUmazet <eric.dumazet@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
  • Loading branch information
Eric Dumazet authored and Patrick McHardy committed Feb 19, 2010
1 parent a88e22a commit 64507fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/netfilter/nf_queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,14 +265,14 @@ void nf_reinject(struct nf_queue_entry *entry, unsigned int verdict)
local_bh_disable();
entry->okfn(skb);
local_bh_enable();
case NF_STOLEN:
break;
case NF_QUEUE:
if (!__nf_queue(skb, elem, entry->pf, entry->hook,
entry->indev, entry->outdev, entry->okfn,
verdict >> NF_VERDICT_BITS))
goto next_hook;
break;
case NF_STOLEN:
default:
kfree_skb(skb);
}
Expand Down

0 comments on commit 64507fd

Please sign in to comment.