From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.215.178 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796418297; b=X8ZX09ux4hLBe1hHUGkft9z9q5rajG67bwZ5fe+25JLduOopGXqstYeS7roGWj3szosk bAwAZXYETzyMXKsErtAIaY7ZqCU+TpUbyz+2REvlyatKSFXlEHqu8zUj5rLV/ROmuE3IA 7+QZzWxzDW6sNtcuZ4DsnJ6Jao6qF0sbd33a7Ec3x0VCqjzx/Um844/PA0+ASVyom75zE aoa2st7ma31V1Y2aQJiW8haO3lNh1kpOLZ1TgYeT7FCEdPIIuP/qRRFk4ATw+/6Pz/pT4 KZ93CEnxONWDO5P47oCb2DhtqA5r/9dO5tQ59rR5onOlCV5q5mVW46gt82E3WW2R1cQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796418297; 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=WX2T7InjrSW7Ibwrtae9AEohU+dA4LMlZ8VwDM5eEKg=; b=km9NfTSz1fihrc+kIEXcKWRc2zS18V0OuYElrjx7B2TgxZI+3B2esedR7Xblf+0zcNYd +ymtNtSB5d4ZUiWbtpxx2zXLbu6D85Jwf/GX1RdGwXv6/XPhvve/ANmuCWppg+1A3P2JM 06XOsUOYYcTsmd+o/HmSxt4JqIrxuPfSF7D46nlBIjQJQvnlen1A5IlAVRiw+EnvL/LWI JqGk92KfXCsEqzxf9HSlIylPany3xv9fxXEAT3FlytRdn27rP0niOFYlKUA6GS1W10KJG 8+G50MWCvmPwI4eI0MNspG0SEWl3jYXTao5njOXzjRQ5y7bc4mGwBrUNOco+2fdS1aQ== 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=oCnMx6ni; arc=none smtp.remote-ip=209.85.215.178 Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.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 38C10606A322 for ; Fri, 4 Dec 2026 21:04:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 38C10606A322 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=oCnMx6ni Received: by mail-pg1-f178.google.com with SMTP id 41be03b00d2f7-ce12ecc2af9so242859a12.1 for ; Fri, 04 Dec 2026 13:04:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796418296; x=1797023096; 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=WX2T7InjrSW7Ibwrtae9AEohU+dA4LMlZ8VwDM5eEKg=; b=oCnMx6nivH9paVLU23TCV0MS0N2eohfAw48jVg9GDZkxlZKK9dzyICuW3zAUziEkqe 8FTaB0pW9tCNfVwsMFYNcMGsyB5xXIqUvpChouSi2XIhmNrghrZNhJq+WFEv+wfFQBxv VTQkDRmIfywMaEm4M7QacUSg0BsSUgWvB/ttNx/sYh9Acb4rlCh2ZPfQbKEqBhXBJhK4 TrH6P2lfwm3ZTILNZA3kZ/mDTpHxYyw8HIdFaVXEu33MXkKY8q4KelRFi6ZwdhQQLsN8 rGbT+LivybMD+J1dXGTjj1g11GIkghmMZY3e4UbeCcMWptwjcf/5Jl1mqC/iX8ygQUmS 3jiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796418296; x=1797023096; 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=WX2T7InjrSW7Ibwrtae9AEohU+dA4LMlZ8VwDM5eEKg=; b=Mmwcj4inyVOloUFxwlA91Ha/xTht9DlOTihmzMdVcJV1mCxewEUBvM2G6YqfkaEDv/ f5aKpO4yh4u+3OS27yUFsrLf9tJS137JFW/7r8HNgP1lcK7P1pKnG+sqIeN869f52m/g IR/Z0lzn/N0QV3Qb6Mb4u7XEq2ppEvYTTtoTmSY/0bGzDUfRWCnbsd8oC5OCXcqcdlTP 2iCHhZCVbCoT8rlxaR/jhiCF+Ts+a1ZB6V3CPVpTQyFku4Sf3QGnTe/L/aqpmPXdSHWt yCVPZGvLcl3paq+4mFxcVnufYl7yagN4jwfFeGe8nC2mKZXWD1tolijLWtQav4PBkCHV BFmw== X-Forwarded-Encrypted: i=1; AL+hErFgpyhVcNbgIGDoK5Ay1wo4pnKShDFQAspEXmsxNLR1uiscXfhE6nWWAc20b3gxEharhGo=@vger.kernel.org X-Gm-Message-State: AB4q+uFtp/NmVcHVZk9FXMKZzQ0dVnt9Ot/CqVDPI+wrhdVVEqLgWH8f F8zxz52LiCPcd1SkFIwg8K+UFJDL0wXlPTCLbHKpc8dc104azG0LxkqB X-Gm-Gg: AZFdTZcxQKCQnYoY7hnAVeqvt6p5BFb2oJ1aoW4ABfYF1YhxyeGv584ruNvaAgDRFF+ dQVtLikusU4ctfCKrACLgJY3FXWei15qeaF63TVtX6Jhdpov6HyzdGMln1iosY5oJhzgDHPymCV 7ZUvUL1CaPK/NETEHGP4B/8jtpPskDCkKh0wahbAeQBiNN2/sYoftD0/dGLkKBeC/BffgbByJij Ip22whTNozyeaHNh9yx7yOLHtR3useM21IrA/20rV5Pd/gjjIa79EuktlHLb1po5h75p9bSHdpp qFuSB3g/Kwnr43RDnZrRfkTBrxmEVjlyyD4C0gM73ZR1TyTpEqCanlEyHYJhXJgVbhEs5uNd2E7 Y1lLMVr/+YMIhMfBuHyiT6i3oOzIG5yfADqJCzSvkCxfbW0voeYzqe/kXev+/1FKWfHCsg07ndn FCQI9CgfdxLsCm4b0ZkpbSVEF28+2133btGNBw0n6YCIjVNAqlyTElGJ2NYsF/lfFK3i7mMF8Ia yyMLDy0aoxzm5nZQOthHIyMIOYRyrhcttXP9w81oZdAVaI/pZ+7PxU79ejcKHgJxjiSTJYuahbY Fug3Ff8o2WLIlYN8kvX2P7/ozNZLDuwxCSTwxgVvmll4pRUQqwVP5MIsnH+thpuNP8EqMdZSv8s dQoL/D5q5tVYqQkCriCMsO8d1AN10zUXsiQ== X-Received: by 2002:a17:90b:4c02:b0:3b5:32db:130 with SMTP id 98e67ed59e1d1-3b5e0619bd3mr1763928a91.13.1796418296281; Fri, 04 Dec 2026 13:04:56 -0800 (PST) Received: from localhost ([153.61.198.241]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b5c7d65000sm11003014a91.11.2026.12.04.13.04.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 04 Dec 2026 13:04:55 -0800 (PST) Content-Type: text/plain; charset=UTF-8 Date: Fri, 04 Dec 2026 21:04:55 +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: Content-Transfer-Encoding: 8bit X-Mailing-List: bpf@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 01:01 AM Paul Moses wrote: > Patches 1 and 2 fix the cases Alexei reported [1]: stale CA state > when a route changes the algorithm or a child inherits the listener's > private state. Patch 3 uses the same name for the CDG check and lookup. tcp fixes go via net tree. Patch 1 fixes a tcp bug. bpf is not needed to hit it. Use setsockopt("vegas") instead of bpf_cc in the sequence from [1]. tcp_vegas_init() sets minRTT and baseRTT to 0x7fffffff. They are at offsets 16 and 20 of icsk_ca_priv. cdg keeps ca->gradients there. tcp_init_transfer() skips tcp_cdg_init(), so tcp_cdg_grad() and tcp_cdg_release() see ca->gradients == 0x7fffffff7fffffff. > Patch 2 needs Jiayuan's fix [2] so the clone hook runs after the > child's CA state is cleared. It doesn't. Without [2] the lsm prog can init a cc on the child before tcp_ca_openreq_child() runs. The reset drops that state without ->release(). cdg is the only in-tree cc with ->release(), and bpf_setsockopt() refuses cdg. So there is nothing to free. A bpf cc gets ->init() twice. That's all. Patches 1 and 2 don't depend on [2]. The backports don't either. > I left the callback issue [3] out after reading more historical context. In [3] you asked whether bpf_setsockopt(TCP_CONGESTION) can be limited to .init. No. It doesn't help. .init of a bpf cc can write icsk_ca_priv after bpf_setsockopt() returns. Pls resend patches 1 and 2 as [PATCH net]. Pls resend patch 3 alone as [PATCH bpf v3]. It doesn't depend on them. pw-bot: cr