Hoang Le 55b3280d1e tipc: fix skb truesize/datasize ratio control
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@ericsson.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-02-08 15:30:40 -05:00
..
2017-11-01 12:19:03 +09:00
2017-11-27 16:20:04 -05:00
2017-11-27 16:20:04 -05:00
2017-11-08 16:12:33 +09:00
2017-11-27 16:20:04 -05:00
2018-01-30 19:03:48 -08:00
2018-02-01 09:51:57 -08:00