Commit 41499bd6 authored by David S. Miller's avatar David S. Miller
parents 622e0ca1 7ea7b858
...@@ -333,7 +333,7 @@ struct xt_target { ...@@ -333,7 +333,7 @@ struct xt_target {
/* Called when user tries to insert an entry of this type: /* Called when user tries to insert an entry of this type:
hook_mask is a bitmask of hooks from which it can be hook_mask is a bitmask of hooks from which it can be
called. */ called. */
/* Should return true or false, or an error code (-Exxxx). */ /* Should return 0 on success or an error code otherwise (-Exxxx). */
int (*checkentry)(const struct xt_tgchk_param *); int (*checkentry)(const struct xt_tgchk_param *);
/* Called when entry of this type deleted. */ /* Called when entry of this type deleted. */
......
...@@ -61,7 +61,7 @@ static inline int nf_conntrack_confirm(struct sk_buff *skb) ...@@ -61,7 +61,7 @@ static inline int nf_conntrack_confirm(struct sk_buff *skb)
int ret = NF_ACCEPT; int ret = NF_ACCEPT;
if (ct && ct != &nf_conntrack_untracked) { if (ct && ct != &nf_conntrack_untracked) {
if (!nf_ct_is_confirmed(ct) && !nf_ct_is_dying(ct)) if (!nf_ct_is_confirmed(ct))
ret = __nf_conntrack_confirm(skb); ret = __nf_conntrack_confirm(skb);
if (likely(ret == NF_ACCEPT)) if (likely(ret == NF_ACCEPT))
nf_ct_deliver_cached_events(ct); nf_ct_deliver_cached_events(ct);
......
...@@ -424,6 +424,16 @@ __nf_conntrack_confirm(struct sk_buff *skb) ...@@ -424,6 +424,16 @@ __nf_conntrack_confirm(struct sk_buff *skb)
spin_lock_bh(&nf_conntrack_lock); spin_lock_bh(&nf_conntrack_lock);
/* We have to check the DYING flag inside the lock to prevent
a race against nf_ct_get_next_corpse() possibly called from
user context, else we insert an already 'dead' hash, blocking
further use of that particular connection -JM */
if (unlikely(nf_ct_is_dying(ct))) {
spin_unlock_bh(&nf_conntrack_lock);
return NF_ACCEPT;
}
/* See if there's one in the list already, including reverse: /* See if there's one in the list already, including reverse:
NAT could have grabbed it without realizing, since we're NAT could have grabbed it without realizing, since we're
not in the hash. If there is, we lost race. */ not in the hash. If there is, we lost race. */
......
...@@ -1393,10 +1393,8 @@ static int sip_help_tcp(struct sk_buff *skb, unsigned int protoff, ...@@ -1393,10 +1393,8 @@ static int sip_help_tcp(struct sk_buff *skb, unsigned int protoff,
nf_ct_refresh(ct, skb, sip_timeout * HZ); nf_ct_refresh(ct, skb, sip_timeout * HZ);
if (skb_is_nonlinear(skb)) { if (unlikely(skb_linearize(skb)))
pr_debug("Copy of skbuff not supported yet.\n"); return NF_DROP;
return NF_ACCEPT;
}
dptr = skb->data + dataoff; dptr = skb->data + dataoff;
datalen = skb->len - dataoff; datalen = skb->len - dataoff;
...@@ -1455,10 +1453,8 @@ static int sip_help_udp(struct sk_buff *skb, unsigned int protoff, ...@@ -1455,10 +1453,8 @@ static int sip_help_udp(struct sk_buff *skb, unsigned int protoff,
nf_ct_refresh(ct, skb, sip_timeout * HZ); nf_ct_refresh(ct, skb, sip_timeout * HZ);
if (skb_is_nonlinear(skb)) { if (unlikely(skb_linearize(skb)))
pr_debug("Copy of skbuff not supported yet.\n"); return NF_DROP;
return NF_ACCEPT;
}
dptr = skb->data + dataoff; dptr = skb->data + dataoff;
datalen = skb->len - dataoff; datalen = skb->len - dataoff;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment