Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1689211ybe; Tue, 3 Sep 2019 01:58:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqwGm7sjJYaEDJtrlnfoux1o/DTFr/3b/k4u1EyM4qWbT6Op/JDuPA/tbYWLdPRK0+hR+wt1 X-Received: by 2002:a17:902:e413:: with SMTP id ci19mr14543427plb.256.1567501080881; Tue, 03 Sep 2019 01:58:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567501080; cv=none; d=google.com; s=arc-20160816; b=Rj8nIzD9B5DqAaPk0A1Y/oyCizkeAuddrISJ4szr4T/6Eni3xghMvfULIScZFIJKQe lB+i9tczCIXqpJD0/OPhzkGPi+FAXETGs3bpz8CnhBkgiUJFNhKwv6RYcC6iIlWNv+Fv lras42dqT/hbpKMHTjoTc9dCRvINLf7m5KC23DYPqVXjMQNwrcF2f8iBaS4kZIJxFxZs nj4SfUGWJfzpJSA3+6DoWFQxXMDBlkhLuaMDTAb6B6ZJiuzaRncZh8j9jJsVEt01yA36 GsJ8KRSAnzAmtPeT8K0c4h7Li2YpTe0ULoxdEOj7s0BatFbK0l2GG9jHezvERr7jxqB0 GY6w== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=a1vKEGH2U6Nv5V3PnznaI7u4rcdQjLwPto6LH9l1opM=; b=gCqwiXK7UVHA/al+X6FjI1eW/YmTKpN7DHCr1zlvyZHf+MPaZ0dOqqqqhn47obkD6p H30S7lhLt7PbabpvbeWz8DVroFFNAcekFYpEmQvXUj32T0s0WNNmTfOAIjZdE6Mh51sH zvSgSTE5oXlX/FmRyIWugCwWjijAIY2gSWyWLKD45DZoecfN5E7uIQOAVFr4OwLZ47RZ /cvWAkY4YaUkroUiMhWcRtSWNv4K+RdIHhuaKihof5dNHR0kDc3o84BM7dJ6O9BY0eHi 6MTO9wCAdd/Q/UYEtRhTrkLiehmwh7WaEDPXoZtoYbU2A3G/SM5tN9GuWgAsJSAsuiKB Z9TQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b9si13896930pgb.478.2019.09.03.01.57.45; Tue, 03 Sep 2019 01:58:00 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728222AbfICIzq (ORCPT + 99 others); Tue, 3 Sep 2019 04:55:46 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:5730 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726946AbfICIzp (ORCPT ); Tue, 3 Sep 2019 04:55:45 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 9048D9AD3D7876E57CA4; Tue, 3 Sep 2019 16:55:43 +0800 (CST) Received: from [127.0.0.1] (10.177.96.96) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.439.0; Tue, 3 Sep 2019 16:55:39 +0800 Subject: Re: [PATCH 4.14] tcp: fix tcp_rtx_queue_tail in case of empty retransmit queue To: Tim Froidcoeur , CC: David Miller , "cpaasch@apple.com" , "jonathan.lemon@gmail.com" , "stable@vger.kernel.org" , "gregkh@linuxfoundation.org" , "matthieu.baerts@tessares.net" , "aprout@ll.mit.edu" , "edumazet@google.com" , "jtl@netflix.com" , "linux-kernel@vger.kernel.org" , "mkubecek@suse.cz" , "ncardwell@google.com" , "sashal@kernel.org" , "ycheng@google.com" , "netdev@vger.kernel.org" References: <20190824060351.3776-1-tim.froidcoeur@tessares.net> <400C4757-E7AD-4CCF-8077-79563EA869B1@gmail.com> <20190830232657.GL45416@MacBook-Pro-64.local> <20190830.192049.1447010488040109227.davem@davemloft.net> From: maowenan Message-ID: <88936af6-4b98-c78f-930f-47e5d69c961d@huawei.com> Date: Tue, 3 Sep 2019 16:55:38 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.177.96.96] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/9/3 14:58, Tim Froidcoeur wrote: > Hi, > > I also tried to reproduce this in a targeted way, and run into the > same difficulty as you: satisfying the first condition “ > (sk->sk_wmem_queued >> 1) > limit “. > I will not have bandwidth the coming days to try and reproduce it in > this way. Maybe simply forcing a very small send buffer using sysctl > net.ipv4.tcp_wmem might even do the trick? > > I suspect that the bug is easier to trigger with the MPTCP patch like > I did originally, due to the way this patch manages the tcp subflow > buffers (it can temporarily overfill the buffers, satisfying that > first condition more often). > > another thing, the stacktrace you shared before seems caused by > another issue (corrupted socket?), it will not be solved by the patch > we submitted. The trace shows zero window probe message can be BUG_ON in skb_queue_prev, this is reproduced on our platform with syzkaller. It can be resolved by your fix patch. The thing I need to think is why the first condition can be satisfied? Eric, Do you have any comments to reproduce it as the first condition is hard to be true? (sk->sk_wmem_queued >> 1) > limit > > kind regards, > > Tim > > > On Tue, Sep 3, 2019 at 5:22 AM maowenan wrote: >> >> Hi Tim, >> >> >> >> I try to reproduce it with packetdrill or user application, but I can’t. >> >> The first condition “ (sk->sk_wmem_queued >> 1) > limit “ can’t be satisfied, >> >> This condition is to avoid tiny SO_SNDBUF values set by user. >> >> It also adds the some room due to the fact that tcp_sendmsg() >> >> and tcp_sendpage() might overshoot sk_wmem_queued by about one full >> >> TSO skb (64KB size). >> >> >> >> limit = sk->sk_sndbuf + 2 * SKB_TRUESIZE(GSO_MAX_SIZE); >> >> if (unlikely((sk->sk_wmem_queued >> 1) > limit && >> >> skb != tcp_rtx_queue_head(sk) && >> >> skb != tcp_rtx_queue_tail(sk))) { >> >> NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPWQUEUETOOBIG); >> >> return -ENOMEM; >> >> } >> >> >> >> Can you try to reproduce it with packetdrill or C socket application? >> >> > > >