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:23:38 +0000 (14:23 +0100)
commitb3f662ccd3677915f79861bd19854250836aea4b
treea0a298d019d71e9dc51b7a5dd83699aea96ae09b
parent98d20e5902667f9b44a75116041a630823f81e46
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