Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp179476imd; Wed, 31 Oct 2018 16:55:41 -0700 (PDT) X-Google-Smtp-Source: AJdET5eZ3yfx6kumsJqL4dsj5CdusJQlHnwz2z6xqcgRXpr6hpAlNbInNK56IQNOxlV6xUsgr368 X-Received: by 2002:a63:91c1:: with SMTP id l184mr2346538pge.29.1541030141710; Wed, 31 Oct 2018 16:55:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541030141; cv=none; d=google.com; s=arc-20160816; b=st8gcK/Yvyf+ps9KrzBOIrGHBgFBbTDHKpImzMfT9qVnlLNIPva/XMf+azWunU5X99 /+ptauDdjdod8xstBx/aZbtNeTiVGYc6SHbwEYq4K+syAVjyxkUNwDIBQ6WCYkminJZx CXX8813K7c6X3dbxLdOo9MWLRjXJjPaLVPrGW4ZkyhvWnCeBiJ+Tj1UEVCPSM6iAakXS ub7EC5JvsPKQQ/BWsZHhE+d4rJv2VlcGMT+GcNCcluYC94QMKvAnounvP+tgDukfEfNC FH2+xk2oaKg7SDebqTcO5TPqYcuko0On1penmj1LttroYgnFOs0JD7kyS2dV/iHNnfF7 1TyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=tWp0u807OOjOZHP0yUdnGTF41riqgsJiaqoPnWvscKg=; b=VFK0ND+/b2U0Q72BParvXfZYe0FgEHFyNFx9SYDUd/tRxQxx0jgbTmGIUFf0MwFshl P7QXRbQ80sXX6uYcujLOv+8QCWprErvExJdIIRyg7uew+qZ5RDPR6HY+v0s3kQVMvOl2 FPnaq6WkVrpBKZjTmOTUM34cSKmF99rBBs9fL02Bg6BpZxS4iTs6uZTZ0R/7UOxh6AB8 DyC03fwRLTauV/MZtCovEv6LWLkmFaUv1k4e8xHPtyhiB9Sx/JBsTVQBoIu7RD0n5BI0 z3xn/ZcH/8sFxxXVV8aIamD/afItRc62U+cVmqufvwoFEGBaQd6SFI+QSu0oSj7d9Reh 13yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tq1+rO5o; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y5-v6si25019286pgv.38.2018.10.31.16.55.27; Wed, 31 Oct 2018 16:55:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tq1+rO5o; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726342AbeKAIF4 (ORCPT + 99 others); Thu, 1 Nov 2018 04:05:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:52536 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726202AbeKAIFz (ORCPT ); Thu, 1 Nov 2018 04:05:55 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D425020823; Wed, 31 Oct 2018 23:05:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541027145; bh=nPzAxlsCI9yFomFr6wYxP465lWD3iXRwQOLKzvJV+iY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tq1+rO5otNiz2m15K+jJ5a1JHo1ZWG6YR6w8Q1VXGLyvfzzwRZli0SdO5nlTHOnNc LjaCbTcb4GgU6393SljIWjY91jIqIeJ2WQQH4/StYai7vpQ7C498g19KENJd4fuLHz MAZnVY7rJDSyDw2dfL7m4cKqeiyJsDJfinN3noag= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Eric Dumazet , Willem de Bruijn , Soheil Hassas Yeganeh , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL 4.19 003/146] net: loopback: clear skb->tstamp before netif_rx() Date: Wed, 31 Oct 2018 19:03:18 -0400 Message-Id: <20181031230541.28822-3-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181031230541.28822-1-sashal@kernel.org> References: <20181031230541.28822-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Eric Dumazet [ 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 --- drivers/net/loopback.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c index 30612497643c..d192936b76cf 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(), -- 2.17.1