aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorHoang Le <hoang.h.le@dektek.com.au>2018-02-08 17:16:25 +0100
committerDavid S. Miller <davem@davemloft.net>2018-02-08 15:30:40 -0500
commit55b3280d1e471795c08dbbe17325720a843e104c (patch)
tree540f61caa564a39a197d6980c0a244f1cd93a807 /drivers/net
parentnet/sched: cls_u32: fix cls_u32 on filter replace (diff)
downloadlinux-dev-55b3280d1e471795c08dbbe17325720a843e104c.tar.xz
linux-dev-55b3280d1e471795c08dbbe17325720a843e104c.zip
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>
Diffstat (limited to 'drivers/net')
0 files changed, 0 insertions, 0 deletions