[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20180208.153115.260191898373353330.davem@davemloft.net>
Date: Thu, 08 Feb 2018 15:31:15 -0500 (EST)
From: David Miller <davem@...emloft.net>
To: jon.maloy@...csson.com
Cc: netdev@...r.kernel.org,
mohan.krishna.ghanta.krishnamurthy@...csson.com,
tung.q.nguyen@...tech.com.au, hoang.h.le@...tech.com.au,
canh.d.luu@...tech.com.au, ying.xue@...driver.com,
tipc-discussion@...ts.sourceforge.net
Subject: Re: [net 1/1] tipc: fix skb truesize/datasize ratio control
From: Jon Maloy <jon.maloy@...csson.com>
Date: Thu, 8 Feb 2018 17:16:25 +0100
> From: Hoang Le <hoang.h.le@...tek.com.au>
>
> In commit d618d09a68e4 ("tipc: enforce valid ratio between skb truesize
> and contents") we introduced a test for ensuring that the condition
> truesize/datasize <= 4 is true for a received buffer. Unfortunately this
> test has two problems.
>
> - Because of the integer arithmetics the test
> if (skb->truesize / buf_roundup_len(skb) > 4) will miss all
> ratios [4 < ratio < 5], which was not the intention.
> - The buffer returned by skb_copy() inherits skb->truesize of the
> original buffer, which doesn't help the situation at all.
>
> In this commit, we change the ratio condition and replace skb_copy()
> with a call to skb_copy_expand() to finally get this right.
>
> Acked-by: Jon Maloy <jon.maloy@...csson.com>
> Signed-off-by: Jon Maloy <jon.maloy@...csson.com>
Applied, thanks Jon.
Powered by blists - more mailing lists