Skip to content

Commit

Permalink
netfilter: nf_queue: relax NFQA_CT attribute check
Browse files Browse the repository at this point in the history
Allow modifying attributes of the conntrack associated with a packet
without first requesting ct data via CFG_F_CONNTRACK or extra
nfnetlink_conntrack socket.

Also remove unneded rcu_read_lock; the entire function is already
protected by rcu.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
  • Loading branch information
Florian Westphal authored and Pablo Neira Ayuso committed Jul 31, 2013
1 parent 5813a8e commit 957bec3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions net/netfilter/nfnetlink_queue_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -987,8 +987,7 @@ nfqnl_recv_verdict(struct sock *ctnl, struct sk_buff *skb,
if (entry == NULL)
return -ENOENT;

rcu_read_lock();
if (nfqa[NFQA_CT] && (queue->flags & NFQA_CFG_F_CONNTRACK))
if (nfqa[NFQA_CT])
ct = nfqnl_ct_parse(entry->skb, nfqa[NFQA_CT], &ctinfo);

if (nfqa[NFQA_PAYLOAD]) {
Expand All @@ -1002,7 +1001,6 @@ nfqnl_recv_verdict(struct sock *ctnl, struct sk_buff *skb,
if (ct)
nfqnl_ct_seq_adjust(skb, ct, ctinfo, diff);
}
rcu_read_unlock();

if (nfqa[NFQA_MARK])
entry->skb->mark = ntohl(nla_get_be32(nfqa[NFQA_MARK]));
Expand Down

0 comments on commit 957bec3

Please sign in to comment.