Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp6787199imm; Tue, 28 Aug 2018 00:39:26 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbK02PVDaWvukNxQCpyuKQesRjOh/yEjXaImSAZD4eRKltXxNRKhth/ELg7a6C4K/jvwVUm X-Received: by 2002:a63:2043:: with SMTP id r3-v6mr364715pgm.105.1535441966268; Tue, 28 Aug 2018 00:39:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535441966; cv=none; d=google.com; s=arc-20160816; b=rHhRSGhLCKvhkVpxrqJTcQwxlffJLPxzfrWF6MulMWrXn2XUbN7wrTPyHKywOXRufb JqD0knrL4W0f7kU8FNH2u3b9+F1Wxqj1Go42jmKxWiJsN5AZKfl0YTQRBSp3M1VHVq86 kT52AZXDj1zN8x6AScebbnHmiR1OI+oFQMtRMi1ZoHd14xBSRWnTov1XgcxQl+A222yG KL/v8WWfTPpchfUUfR8g92o40Tc4X/5BHoMggRepuGmp2YON8neFBreO7De+/pnGjc4f kSsMuajrjcyd5BWOde7ToFqO6JeUrKjB2yLduYjtPBiA1ZqcRcaEkR/fM8t4ysSh1nXd yahw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature:arc-authentication-results; bh=PVA+vqLMdABFy01XRPbmRoR0rVMY6hxh+YDsbDryhzU=; b=utoKqZa4ZKs0AluJ0QxGxDlOTHLFPu8k8C2x06dXm8QgxowezXu4QhdtTVht0Di1yL rG2g66Chlp9pKef2Jpvb/mG3jgC7sFUNLQIbFHg7sXyaBAsa1q/Z2KAORuuu7Vhl1JEv Lcbfzgoq/b6RD1503FnY7RgFMW5PKracxKLMY2blbHcBEYDSy8+qHlpXG/CsRMxn0xVJ 5Gg22if2oNNFNJ6nSVNZEk5iVtaZtBTvpav77F/ZHdytk3tXnsQZBdbEPbb7XuAcIDCD iTD2cuzVOaScbFeiQIEx0h2O8G9YQo70wglVLSAJvzIV8+j++eeIwJXTKilGy5nuX1lo SVmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=vSq23RR2; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k91-v6si374895pld.187.2018.08.28.00.39.10; Tue, 28 Aug 2018 00:39:26 -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=@google.com header.s=20161025 header.b=vSq23RR2; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727417AbeH1L1J (ORCPT + 99 others); Tue, 28 Aug 2018 07:27:09 -0400 Received: from mail-it0-f67.google.com ([209.85.214.67]:40093 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727130AbeH1L1J (ORCPT ); Tue, 28 Aug 2018 07:27:09 -0400 Received: by mail-it0-f67.google.com with SMTP id h23-v6so1259087ita.5 for ; Tue, 28 Aug 2018 00:36:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=PVA+vqLMdABFy01XRPbmRoR0rVMY6hxh+YDsbDryhzU=; b=vSq23RR2SNaFs+e+IWJFX3ZrclzXKzDBYL+jzVGwlfrODCS2b9VvkoRTYm6fP5CIc9 1Gqzp7LtsJRPEis3FkDn/wFc8ApfDO1Q0xRLRGfNaPkcXZbzvfFn8j7tUl0b5OYiqhfG qgwrScc3OX5ZKTVBXq8ZRLhfbpTKwiAwBLNS7QuWFo3gJUwPGbcI/8lV95fLrx06peBt Bgp6p4I0NyKfDyCGoY/mHIz0HlmatjmTkkwzdb/YgEixOGmPyWKFrckB+L72C90bjJAn 0V9iP+QcnhAG5N5jjsXx3MYG6VAakCNAE3jqMC7N5y1vQw1MxyUIb65wXk995awi4W+7 hSfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=PVA+vqLMdABFy01XRPbmRoR0rVMY6hxh+YDsbDryhzU=; b=uAGx8yDoj+YEZ8y52iePsbM/BQL9S5ANQW0qWMZonQuepmn7dwCiiEp6+9fnIY0H/F YXncSsCWlQIEuNf1pBnAjjCJtNRZE2Gv9+KfVJsNwkQDftrrYY5WbQbtn16uWdd0H/YO ZOEnvlNQPFdjlEsgKaSVre/IQJKQdbcn6+40lDdCdxRWeh9tw/8ABd+wUebE2zIh/ZXv 5LQQSadomFBaLkzFWKfgqXscLaO4dAXHPUeYXQe1OdTpzkhppRXMcoh07rTMCOJbjVon +/8SxD6Tx7I2+TsmTxz78XL1iC+R9u6brgn4pne6S3DXuV3mskKcB7KtSuawgGw1fJAa h60w== X-Gm-Message-State: APzg51A2GtX9evZa4qZdrmxbTSDK0tXcpjjfWPGzpNfM1CPiF7YlVnDx mI4Ayqgh8fb5dwGIYaw5TEjjDe6dWVLbgkPx0whPwA== X-Received: by 2002:a24:7f87:: with SMTP id r129-v6mr473680itc.107.1535441808405; Tue, 28 Aug 2018 00:36:48 -0700 (PDT) MIME-Version: 1.0 References: <1535441465-65170-1-git-send-email-wen.yang99@zte.com.cn> In-Reply-To: <1535441465-65170-1-git-send-email-wen.yang99@zte.com.cn> From: Eric Dumazet Date: Tue, 28 Aug 2018 00:36:37 -0700 Message-ID: Subject: Re: [PATCH] tcp: another fix of uncloning packets before mangling them To: wen.yang99@zte.com.cn Cc: David Miller , Alexey Kuznetsov , Hideaki YOSHIFUJI , netdev , LKML , jiang.biao2@zte.com.cn, zhong.weidong@zte.com.cn, liu.bo9@zte.com.cn Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 28, 2018 at 12:32 AM Wen Yang wrote: > > The following warning was caught=EF=BC=9A > > [937151.638394] Call Trace: > [937151.638401] [] dump_stack+0x19/0x1b > [937151.638405] [] warn_slowpath_common+0x70/0xb0 > [937151.638407] [] warn_slowpath_null+0x1a/0x20 > [937151.638410] [] tcp_set_skb_tso_segs+0xeb/0x100 > [937151.638412] [] tcp_init_tso_segs+0x37/0x50 > [937151.638414] [] tcp_write_xmit+0x1d9/0xce0 > [937151.638417] [] __tcp_push_pending_frames+0x2e/0xc0 > [937151.638419] [] tcp_push+0xec/0x120 > [937151.638421] [] tcp_sendmsg+0xc8/0xc20 > [937151.638424] [] inet_sendmsg+0x64/0xb0 > [937151.638428] [] ? check_preempt_curr+0x75/0xa0 > [937151.638434] [] sock_aio_write+0x157/0x180 > [937151.638437] [] do_sync_write+0x8d/0xd0 > [937151.638440] [] vfs_write+0x1b5/0x1e0 > [937151.638442] [] SyS_write+0x7f/0xe0 > [937151.638445] [] system_call_fastpath+0x16/0x1b > > According commit c52e2421f736 ("tcp: must unclone packets before > mangling them"), TCP stack should make sure it owns skbs before > mangling them. > And there is another place where skb_unclone() is needed. This patch > fix that. > > Signed-off-by: Wen Yang > Tested-by: Liu Bo > Reviewed-by: Jiang Biao > --- > net/ipv4/tcp_output.c | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c > index 597dbd7..fbe8140 100644 > --- a/net/ipv4/tcp_output.c > +++ b/net/ipv4/tcp_output.c > @@ -1793,6 +1793,9 @@ static int tcp_init_tso_segs(struct sk_buff *skb, u= nsigned int mss_now) > int tso_segs =3D tcp_skb_pcount(skb); > Certainly not needed. TCP stack owns its packets, as long they were never sent (not yet in retransmit queue) You probably are using an old kernel, missing some backport...