From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.214.178 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796438194; b=afoTxH6zuZu05B0cwgowjHus+EZsAbcfrTD4hKXP06Z7NqBTg4nAORfSKYoPHq3dcFW8 5WMm4iPP+QVjx4CIUHSrYECcxsE80qYJ52tmhWB8goA0io1EBFRmEAzjyC01i5N4Qq755 uNS9sTbMwH55bMJ4vjIzw49A/zyh8Cwtve+24ktVhf5IXUINPrLqL47wXBnGOPMXIbgAI i4YUCYbI+Hir7TCQ/3D4x10/XdQiUcfwhMp8QU1nQa4LQYQJbwSjTvajHm/GVXq0t2Imz dxNTcKA85b5lUEp5vZRUAnU83IYwkc92n1nV3TwBqpmoeCbEiqHP2iLxJ/PPJPdYKIQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796438194; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Content-Type:Date:Message-Id:Cc:Subject:From:To:In-Reply-To: References:Content-Transfer-Encoding:MIME-Version; bh=ctkpT32JinMDytizxIwGQ6fVOJc1WI8oohL+lvcaesI=; b=xz7EvWvPy+rLDrWK3JKwvVUOTwmV7AsRipd3NkrMIE6ghUgMeAyOPgiM/0yw6VIO614d BtOxfH0WYC+MCWyR0TT3vuXFUi5xc9q6ddiM3dnXzJUxP/QcwmKfcbmFgAxZw9fHW42uG wJGnBUgD6aK2QUJIhxqwMrhpgSPLPKVB3OvRZgXoqm6sD+z3gnxhMCTD69IjcjbWDRmKN OULkFEHVg25fNLARzYZE6lqp4yXyzn2QKKTaH0+igjbs2sad1E3jRw8K+mbgAdujt7gmm DkTbKfir9bPOnkWZ4gbTprT4j2Mb3oJzWvQQDLOlF/eh9kLb55cpc0eGFqhxggcMQbw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=B3swnB9K; arc=none smtp.remote-ip=209.85.214.178 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CA73A606A32C for ; Sat, 5 Dec 2026 02:36:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org CA73A606A32C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=B3swnB9K Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-2f04fab527eso15477555ad.0 for ; Fri, 04 Dec 2026 18:36:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796438193; x=1797042993; darn=vger.kernel.org; h=mime-version:content-transfer-encoding:references:in-reply-to:to :from:subject:cc:message-id:date:content-type:from:to:cc:subject :date:message-id:reply-to:content-type; bh=ctkpT32JinMDytizxIwGQ6fVOJc1WI8oohL+lvcaesI=; b=B3swnB9Ku8MnsUUxsY+gCRnO3+JTfBPwLnQD1NpQpCYZCB6Pl7drCJmmHyJGQVe06o E3vU39rxUOHWt32Jp0YQbOUyvprIAP347GG1YNuaOxGeFJK/Qpi5iPCEkUuvZoCDWqmz dKS8xKho/DjpfzX4D2VWHr8V0FmaYfefXZd2HDTCmKzHeS5sginf9hO8h4MMPag4Hint qx4I1P9h147pS13zSxVmGy4kOEtOzSOkFH7Kt/5ST9ooOHIyzey/BL0UphRvDQH4bkOb lEfBhpxyYnOcR2OSlVxUmrHZERpVfvemeReLW+RqWYc5TEPOROT1vBWJ991EZXLE9AGR jp8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796438193; x=1797042993; h=mime-version:content-transfer-encoding:references:in-reply-to:to :from:subject:cc:message-id:date:content-type:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=ctkpT32JinMDytizxIwGQ6fVOJc1WI8oohL+lvcaesI=; b=qnbYXTjPZkj8/eTGKPxY/BtXifTU0oYNEtZ+hClW8Qbxtb6YjFJpIEAtWns/sd/3H4 4A9JEM5lWn88QrF9dMjkAjDR/ttQkB12EoT/FhnzO98feR8ZQjCfmFs6EUpvAGCuhsB6 fNpBS/dhq8OJNsyUhgIW1iVXS3vfAywp6TYddf6XgMDtcgzVChYJUgHnOfv3ZZrSZuaf 3GrW+IjArNDIF85qYCmYfiJB12G92F+y5RaVEk5+ppvFfdUsou460vjpkRWLfmC0mBh8 An85ro1iVPmbV7pdyhZKsanjWxwJlFsAJ9e+tLKBuRFGI/o+gTE6+lfWIxBcEG89oRcs /+xQ== X-Forwarded-Encrypted: i=1; AL+hErFlHLa0Uqh2cFtiMNdvxINOvvOfPnlAXruxJcgCTpR6n/MUuzEaPV5SSxB8sqBLh+RLtjPOerQ=@vger.kernel.org X-Gm-Message-State: AB4q+uEbaBv0QoLu6lNNgFr27tB36RGhDMDAefPGZMYTCA85qwmFmgDH 1qt9W/5lTEB/ixgeoZnpIm001Yq9DHHcqBUO89/3cPFr0djeorWyv9jm X-Gm-Gg: AZFdTZc9hJteB5UzjcTTq2xei1DQfnb+ic76qgZdkQ+aRf+NZ3gJu6dK1u73oo4JEb0 A4rsBtTTLUudi7dhmNiuQ1Y1LYyrqA7RPM7qNl/MuZdEpWj+bsfkOMdoEkm5JdVoyJ3uYsCd6lW wlvKWAP1PIcrRs2wf8ql6FH7diXb9a2HNSgdizQVc6xLXHgXEyuwjmELCJ6YdEWVpRBg1eMJdWv y8AYehIMrKERKLhYYWkRuPOi2IzYUzTyutOjf+//FnTXiHKrpN9gCcql++PxtltbHLNImucU9JS EFnTEyqIYy1+8yXZD1Ih34fOArVdczTO+b43LX6qp+xHzwzdHUFZF3058ZQ8RnvAeEhNZG/D5qC nzvLlMKNy1rimOviHRtaNXkkiD4iBY6pewy4NGRzCo+J2dNWDCVs8OT5Dg+hPpqm5dl2h2uQ1IN 3End+Rss7o47rXcjrsqtAttRHwMHGRA3v7wPKC37U8unfv8ZS9feeFz1XGjHKGeUh92Og/jD1Nw xbxZnHFJQt/aRdAFpBzD5dd633/5oTQhREn8495R0TRpZllu9vJpcCHXaFCmC/iW5VAfZR9stqQ 7fUBI+pwDGTSb1BLsojBxnGOVE4OpA4aiw/VPtdjOo1eo3eBwlu6SOtxSv7DA+5qeQZLIEFONyg oph3Yx3iwgyOx1ws9GdIPE4j1wFr6/rxCxGU= X-Received: by 2002:a17:903:1a44:b0:2ef:f3df:7d7d with SMTP id d9443c01a7336-2f1ba21daebmr36948675ad.51.1796438192791; Fri, 04 Dec 2026 18:36:32 -0800 (PST) Received: from localhost ([153.61.198.246]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2f1b791c0f1sm21197905ad.30.2026.12.04.18.36.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 04 Dec 2026 18:36:32 -0800 (PST) Content-Type: text/plain; charset=UTF-8 Date: Sat, 05 Dec 2026 02:36:31 +0000 Message-Id: Cc: , , , , , , , Subject: Re: [PATCH bpf v2 0/3] tcp, bpf: fix CA state on open and the TCP_CONGESTION name check From: "Alexei Starovoitov" To: "Paul Moses" In-Reply-To: References: <0qI4bliEJoe1Gzuxoccq94xz28S015yDsjw2nfkjEAyABbd6OQ3d8MEGJ5WX6zuDQhbfOH2IxT36YERbqvYrlYwHeaRGXNsWeurXQahMGH0=@1g4.org> Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 On Fri, Dec 04, 2026 at 06:22 PM Paul Moses wrote: > Yes, the refcount bug is independent. My concern is that patch 2 clears CA state > already initialized by the hook. > > unpatched (#14): init=1 release=1 > all patches without [2]: init=2 release=1 > all patches with [2]: init=1 release=1 > > Without [2], the child's CA is initialized twice without a release in between. Yes. ->init() runs twice. It's harmless. The second ->init() starts from zeroed icsk_ca_priv, like the first one. Rows 1 and 2 have a real bug. They leak a reference on ca_count. The lsm prog takes one. tcp_ca_openreq_child() takes one more, because icsk_ca_setsockopt == 1. close() puts one. So this prog needs [2] with and without patch 2. > I can move the reset before the hook instead and drop the backport prereq note, > but I feel like we're making this more complicated than it needs to be. Pls don't move it. Without [2] the moved reset misses this case: inet_csk_clone_lock() reset lsm prog: bpf_setsockopt("vegas") tcp_vegas_init() icsk_ca_initialized = 1 tcp_ca_openreq_child() route has "congctl cdg" icsk_ca_ops = cdg tcp_init_transfer() skips tcp_cdg_init() cdg sees ca->gradients == 0x7fffffff7fffffff again. The reset in tcp_ca_openreq_child() covers it with and without [2]. Keep patch 2 as-is. Drop the note only.