Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3799800pxb; Mon, 9 Nov 2020 23:34:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJw+pNDrsMEYDkEuJHujTcz/4yJuTVoCld98kUT/a/xnAe7F2J5cTe/GBEi+4cLpEThyLTVm X-Received: by 2002:a17:906:3c13:: with SMTP id h19mr19256137ejg.117.1604993693179; Mon, 09 Nov 2020 23:34:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604993693; cv=none; d=google.com; s=arc-20160816; b=UGINrN+AOGIYtT6KX7lvdn74UBSOpbRyQhtxsBkqe5FwDsDxI2xor4quwguXqLdsMW UwmkGA1QwgmqaNvvHmzjagnnreEliCN8FC0wzNh4WnG54VZKZzR/oCWWLIjGL51AlA+p WbnjfqBw3Xw6QNkLy0fZkXxNNrGFnhyHUUadsFFZ8Aq2DpyvwxCM4XRkgUed77DX36bz MKgTDZXbQmOTnq7V/csaxDJcsaHJZ1ttc8GLuq1ojg+fYThrsFsVXvbfIzXNZy4tIKzv F0UtQegOPC2MpUUuvXaO2JxV6lBNw6cZfPbL8GbdDTNHhi3MdVCez4vM3zXRI8wab8nF hVxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=o42yGNfUzOTdDPMZ3l6k7Cu/Tlmyay1zu48jmpASnXo=; b=rsk0fuol7Sj5IJyZdKmt1VlZ8/pWjL+w4jsYqZB4hx36RmbQVPjZzpMO+b90/N8T4A nC/JRT3Nl7JvUOqiHstg4/ykF6UQMyXbWJpgbb1PU+LKf3sL58y5wPvmTnyvQ2viGsMC IdiRGfFRH0WHinjY4YTAAXUZEy/G8TPX8UZ1rRa4Ox1R3NGwwFxZksS1ZnHBj5DtPTun rPAuxrugico6lgtR0+2iaxPPIzkzf6c8yVVIMYLkOgS4MTSPvw7/XMvyMHbcnLHDt/Bq n7TvKSUUwZeuLNL5U/YWlX3xqc9KmWUGOazLWw7mgyIq0yFFLX1dB8XYwiyRrJwAakcB YFwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Bab2g9wn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id um17si8369770ejb.701.2020.11.09.23.34.25; Mon, 09 Nov 2020 23:34:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Bab2g9wn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1727658AbgKJHdG (ORCPT + 99 others); Tue, 10 Nov 2020 02:33:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726849AbgKJHdE (ORCPT ); Tue, 10 Nov 2020 02:33:04 -0500 Received: from mail-io1-xd44.google.com (mail-io1-xd44.google.com [IPv6:2607:f8b0:4864:20::d44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B57A9C0613D4 for ; Mon, 9 Nov 2020 23:33:04 -0800 (PST) Received: by mail-io1-xd44.google.com with SMTP id n12so12811780ioc.2 for ; Mon, 09 Nov 2020 23:33:04 -0800 (PST) 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; bh=o42yGNfUzOTdDPMZ3l6k7Cu/Tlmyay1zu48jmpASnXo=; b=Bab2g9wnlFOdi/TfY6YIOWflmuIFwIHWvW+UQ8g9wuKqnu2gokJkIVhoGPs/zuFUWR jIDj+cDiTAaPP46Y+p15eLHbDUHvcZvnAEQu0v41Xn4IOg/pP94cY6JHYbhopGRLuv9Q 90c6vd+0UbBZ+YWv38kcIcwIM/6/LYUazCgbDgD+VYBNpxw57TC6yhhkI+jhcN2Oi4ax JAZjyMajGAMJIOwfeP0FaFBjw+HcggDQNt05ajNW1wcryUsp1dVQ1n1ROGiZ48SthM1W jge5/bI+y2K+BwPs6YfVs+MTULHNdBnZ5lLI8HTnm81Q6mdSWqd1mi2DHVMgwaDEj59z 5shg== 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; bh=o42yGNfUzOTdDPMZ3l6k7Cu/Tlmyay1zu48jmpASnXo=; b=lsaZpj9NnASE7G8ZG+HNtkglwh0LewY80s0mew5i2A56lE5PVuZkfKEaGNIXlK34x9 mCDv2lFf1d/OUwDcpfEkby3xHBLtZBuez5Kemx6SNVwhksbgtCYBf7M+yMnnuT4k7/v5 UcQI0TafTGqk/c9pZhRQpjMSz/KQZiIz/POA8470W7vFKtNpC0qwCh2X485fH+S5x3RE m2wTF+Cxjxlau/YWuVJ7v2RVVM24Dgs752jZPyHlH0IzaOsFKv7FOqkJJG1w3uU1CIii x8qaQNCNlaQZDLaz+pL5ANR3ZVUQQQ862MnBpJ8Qv2Jay0+1VQo/CCvhDxAVHDxilRjJ +L4Q== X-Gm-Message-State: AOAM53205+yK4bkE4Rnf2sivk8/gXHeFuqcpT6QPF7TM++G804EfUe3P uIsj6PrtUV6jXNWUV2FRMxgBbgBphL/nxcDZUSO7hw== X-Received: by 2002:a5e:980e:: with SMTP id s14mr13190769ioj.195.1604993583691; Mon, 09 Nov 2020 23:33:03 -0800 (PST) MIME-Version: 1.0 References: <1604967391-123737-1-git-send-email-wenan.mao@linux.alibaba.com> In-Reply-To: <1604967391-123737-1-git-send-email-wenan.mao@linux.alibaba.com> From: Eric Dumazet Date: Tue, 10 Nov 2020 08:32:52 +0100 Message-ID: Subject: Re: [PATCH net v5] net: Update window_clamp if SOCK_RCVBUF is set To: Mao Wenan Cc: David Miller , Alexey Kuznetsov , Hideaki YOSHIFUJI , Jakub Kicinski , netdev , LKML , kernel-janitors@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 10, 2020 at 1:16 AM Mao Wenan wrote: > > When net.ipv4.tcp_syncookies=1 and syn flood is happened, > cookie_v4_check or cookie_v6_check tries to redo what > tcp_v4_send_synack or tcp_v6_send_synack did, > rsk_window_clamp will be changed if SOCK_RCVBUF is set, > which will make rcv_wscale is different, the client > still operates with initial window scale and can overshot > granted window, the client use the initial scale but local > server use new scale to advertise window value, and session > work abnormally. > > Fixes: e88c64f0a425 ("tcp: allow effective reduction of TCP's rcv-buffer via setsockopt") > Signed-off-by: Mao Wenan Signed-off-by: Eric Dumazet Thanks !