Skip to content

Commit

Permalink
netfilter: nf_queue: Don't recompute the hook_list head
Browse files Browse the repository at this point in the history
If someone sends packets from one of the netdevice ingress hooks to
the a userspace queue, and then userspace later accepts the packet,
the netfilter code can enter an infinite loop as the list head will
never be found.

Pass in the saved list_head to avoid this.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
  • Loading branch information
Eric W. Biederman authored and Pablo Neira Ayuso committed Jul 2, 2015
1 parent 4da3064 commit f307170
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 @@ -213,7 +213,7 @@ void nf_reinject(struct nf_queue_entry *entry, unsigned int verdict)

if (verdict == NF_ACCEPT) {
next_hook:
verdict = nf_iterate(&nf_hooks[entry->state.pf][entry->state.hook],
verdict = nf_iterate(entry->state.hook_list,
skb, &entry->state, &elem);
}

Expand Down

0 comments on commit f307170

Please sign in to comment.