From: Eric Dumazet Date: Sat, 20 Oct 2018 02:11:26 +0000 (-0700) Subject: net: loopback: clear skb->tstamp before netif_rx() X-Git-Tag: v4.19.2~313 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3fdf483bcf76ab19cf4412c6cac31135d7eda30e;p=platform%2Fkernel%2Flinux-rpi.git net: loopback: clear skb->tstamp before netif_rx() [ Upstream commit 4c16128b6271e70c8743178e90cccee147858503 ] At least UDP / TCP stacks can now cook skbs with a tstamp using MONOTONIC base (or arbitrary values with SCM_TXTIME) Since loopback driver does not call (directly or indirectly) skb_scrub_packet(), we need to clear skb->tstamp so that net_timestamp_check() can eventually resample the time, using ktime_get_real(). Fixes: 80b14dee2bea ("net: Add a new socket option for a future transmit time.") Fixes: fb420d5d91c1 ("tcp/fq: move back to CLOCK_MONOTONIC") Signed-off-by: Eric Dumazet Cc: Willem de Bruijn Cc: Soheil Hassas Yeganeh Acked-by: Soheil Hassas Yeganeh Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c index 3061249..d192936 100644 --- a/drivers/net/loopback.c +++ b/drivers/net/loopback.c @@ -75,6 +75,10 @@ static netdev_tx_t loopback_xmit(struct sk_buff *skb, int len; skb_tx_timestamp(skb); + + /* do not fool net_timestamp_check() with various clock bases */ + skb->tstamp = 0; + skb_orphan(skb); /* Before queueing this packet to netif_rx(),