Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3618416pxv; Mon, 28 Jun 2021 08:43:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoe9rjDSL3h/U2/x7p2WO0Ed77Nb/j4CnwuRs9WkK2RGbEO4ZxSx6iMcY22WFVv0JQD93o X-Received: by 2002:a50:ff01:: with SMTP id a1mr33433321edu.253.1624895003225; Mon, 28 Jun 2021 08:43:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624895003; cv=none; d=google.com; s=arc-20160816; b=GMMwo4nipzAcUYIaGLiq4i0JPT7gIaWe1YZU0q4FzXMjW/ZRzwkq3ZU8qrq/nMJS/U 3CtapKepwU6mwfu8NNz48TIS/sZ0daQy3FiPU0TMfqFx41GM3a+J6Kpto0gabP6xwgPE 6C0KuLUCLFBsadSrNCBKyZ91AqO3dlG/QG3J4tGPUmq15rIrrbPS81WfeOAhPUo0/o4a Yh4zyIDUeSh/chrVIFQU1vW4/D321GhX/qQJzWkh36gfDSVgJ8TGonLGQ9vhpLF03I8o DJD/LAteUMzrMKYl7mtcdV/CuZagzEmsk8hDE6QrXP8hbCq+MqwqTqcVSERax395kPIw lp3w== 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=HYLutEvMYIfZinEiWGKyAJ7H0pxGUzBzdhu6yQBXQiU=; b=jZDNNyWfhjccbtysG5od+A1LGDjegXzW+cLrAMAj0yydCU3JChqOxAw2P6YSEg+VRf 6n7WmZhsJbzU0Ajlgu+aInsM6L3FducMcYPS8dgkP1Pj/LH9ChmaPsqE81JRDEMo3ACQ EMg11VVdrFyILU84sSp4saG01M0pR9P9Cl0logrfG191UBd7Sfcji9T/ts1Askr06H0F 5DSK/mK93bsSAjeBcZKe+8Jm0xepExyQ3SSJIt+k1myHcxhLuvwIvz5E7prBrmACKn2d 6RucKNXVXNq915DIu9EGwMjhw34CMM/AmUGlwceVc3qstiCAY4oJPCkllrcsdrg+ug8i ya+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=NNF8m9YH; 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 ko17si9494902ejc.115.2021.06.28.08.42.56; Mon, 28 Jun 2021 08:43:23 -0700 (PDT) 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=NNF8m9YH; 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 S236334AbhF1Plj (ORCPT + 99 others); Mon, 28 Jun 2021 11:41:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233346AbhF1PlF (ORCPT ); Mon, 28 Jun 2021 11:41:05 -0400 Received: from mail-yb1-xb2c.google.com (mail-yb1-xb2c.google.com [IPv6:2607:f8b0:4864:20::b2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D623C08ED90 for ; Mon, 28 Jun 2021 07:52:54 -0700 (PDT) Received: by mail-yb1-xb2c.google.com with SMTP id m9so18935456ybo.5 for ; Mon, 28 Jun 2021 07:52:54 -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; bh=HYLutEvMYIfZinEiWGKyAJ7H0pxGUzBzdhu6yQBXQiU=; b=NNF8m9YHL731PTEUPT9jRJ1Q0bYi8Dyl/M7BYPqCO+0H3vFGAs5Hqvl3J3EJnfOsso 6bkDsTJuI/EWf8udfG+br3cHu4MejupGkv2/7O7skXXp01Ey8kfO40Tb0It515+isBNq 4/T7/n5TxteHuz4zEqJTGEbWr0Dpma+7TvlX7WtGfIJU729OKb/9K5qv4QQILEDaIwPb fkzRkLrChufF4zO+J5QEHdba2lT9gLTcuk+Q4TfD+58vXL0BchXwE+pRy3T0K+bv/EFf 8Wh/3EnR8QnO3x/LCM31UoPK1WHlacIn7QoUiKnv49U5D2wn3z3Eg3t+YSSsWOQVOeUC bAbw== 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=HYLutEvMYIfZinEiWGKyAJ7H0pxGUzBzdhu6yQBXQiU=; b=mNzT/buLpNoChpe6QYqgmYtAOE6p/ayNWJiBsDkhundCyou40AJFbO5W3p39BD9WL6 cDlJ0E7MMFnm0athmvZGr6r8bJLarFJ9EjP7qO4DBvzcLlKtpUzyU0G05PefBefotTN/ WDwktlCYjc8+ByEymc0zUBQfFq5tdK16KaauWsUiH18JHN/hBMN3QGMjr5D07+20Dr1a SYsdf17ueBa9hOgmcz2r0dhfmeLAXNqGKZIr/VIW4ZuzDcXMzQJWwcE/xB5P2urixUdV pvRNxG+3qgphl++Ym1ZjdEDc9slcEAcmHKyKdVm3pyXAMxxTprlpIrOCGEMzdsSqRPKM D4+A== X-Gm-Message-State: AOAM532kFXhrEcsDDv1n84A5plf7jwAqxv3smQDkJILPDTb5o38lQKSy 58TlgoIaKMDoFprraQWhRC//PTdhvCtBOd3Btdi/5g== X-Received: by 2002:a25:8081:: with SMTP id n1mr34237963ybk.253.1624891973002; Mon, 28 Jun 2021 07:52:53 -0700 (PDT) MIME-Version: 1.0 References: <20210628144908.881499-1-phind.uet@gmail.com> In-Reply-To: <20210628144908.881499-1-phind.uet@gmail.com> From: Eric Dumazet Date: Mon, 28 Jun 2021 16:52:41 +0200 Message-ID: Subject: Re: [PATCH] tcp: Do not reset the icsk_ca_initialized in tcp_init_transfer. To: Nguyen Dinh Phi Cc: David Miller , Hideaki YOSHIFUJI , David Ahern , Jakub Kicinski , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , John Fastabend , kpsingh@kernel.org, netdev , LKML , bpf , linux-kernel-mentees@lists.linuxfoundation.org, syzbot+f1e24a0594d4e3a895d3@syzkaller.appspotmail.com, Yuchung Cheng , Neal Cardwell Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 28, 2021 at 4:49 PM Nguyen Dinh Phi wrote: > > icsk_ca_initialized be always set to zero before we examine it in if > block, this makes the congestion control module's initialization be > called even if the CC module was initialized already. > In case the CC module allocates and setups its dynamically allocated > private data in its init() function, e.g, CDG, the memory leak may occur. > > Reported-by: syzbot+f1e24a0594d4e3a895d3@syzkaller.appspotmail.com > > Signed-off-by: Nguyen Dinh Phi > --- > net/ipv4/tcp_input.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c > index 7d5e59f688de..855ada2be25e 100644 > --- a/net/ipv4/tcp_input.c > +++ b/net/ipv4/tcp_input.c > @@ -5922,7 +5922,6 @@ void tcp_init_transfer(struct sock *sk, int bpf_op, struct sk_buff *skb) > tp->snd_cwnd = tcp_init_cwnd(tp, __sk_dst_get(sk)); > tp->snd_cwnd_stamp = tcp_jiffies32; > > - icsk->icsk_ca_initialized = 0; Unfortunately this patch might break things. We keep changing this CC switching, with eBPF being mixed in the equation. I would suggest you find a Fixes: tag first, so that we can continue the discussion. Thank you. > bpf_skops_established(sk, bpf_op, skb); > if (!icsk->icsk_ca_initialized) > tcp_init_congestion_control(sk); > -- > 2.25.1 >