Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a1d7c1b4 authored by Patrick McHardy's avatar Patrick McHardy
Browse files

netfilter: nf_ct_sip: handle non-linear skbs



Handle non-linear skbs by linearizing them instead of silently failing.
Long term the helper should be fixed to either work with non-linear skbs
directly by using the string search API or work on a copy of the data.

Based on patch by Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
parent 736d58e3
Loading
Loading
Loading
Loading
+4 −8
Original line number Diff line number Diff line
@@ -1393,10 +1393,8 @@ static int sip_help_tcp(struct sk_buff *skb, unsigned int protoff,

	nf_ct_refresh(ct, skb, sip_timeout * HZ);

	if (skb_is_nonlinear(skb)) {
		pr_debug("Copy of skbuff not supported yet.\n");
		return NF_ACCEPT;
	}
	if (unlikely(skb_linearize(skb)))
		return NF_DROP;

	dptr = skb->data + dataoff;
	datalen = skb->len - dataoff;
@@ -1455,10 +1453,8 @@ static int sip_help_udp(struct sk_buff *skb, unsigned int protoff,

	nf_ct_refresh(ct, skb, sip_timeout * HZ);

	if (skb_is_nonlinear(skb)) {
		pr_debug("Copy of skbuff not supported yet.\n");
		return NF_ACCEPT;
	}
	if (unlikely(skb_linearize(skb)))
		return NF_DROP;

	dptr = skb->data + dataoff;
	datalen = skb->len - dataoff;