sch_dsmark: fix invalid skb_cow() usage
authorEric Dumazet <edumazet@google.com>
Fri, 17 Mar 2017 15:05:28 +0000 (08:05 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Dec 2017 13:22:10 +0000 (14:22 +0100)
commitffde339b95f5729e9d57ba0802b50a611854b728
tree1b3a25c5c67690d00359b5ab819b7939eaf7ee82
parent4bf8a4f179ed5c9775f0970fc652cc04c0994186
sch_dsmark: fix invalid skb_cow() usage

[ Upstream commit aea92fb2e09e29653b023d4254ac9fbf94221538 ]

skb_cow(skb, sizeof(ip header)) is not very helpful in this context.

First we need to use pskb_may_pull() to make sure the ip header
is in skb linear part, then use skb_try_make_writable() to
address clones issues.

Fixes: 4c30719f4f55 ("[PKT_SCHED] dsmark: handle cloned and non-linear skb's")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/sched/sch_dsmark.c