From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailtransmit05.runbox.com (mailtransmit05.runbox.com [185.226.149.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C685041B8CE for ; Thu, 30 Jul 2026 11:55:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.226.149.38 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785412539; cv=none; b=JSH3/5NUBmjnZECvHmMUcz3X8XDgokP9li6BSYBvpDlNZmfVqlkNw/JlC43Hr0jjJ20MQmGbJXsSg9Ry6bDpPRctbtxjIMhQEzlyL4t6dauCwKmBS1Q1e+9t3o1MHXYx1j1XtL094z8nsUekDBBruehShJ5aF8Hjxu5xZp138l0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785412539; c=relaxed/simple; bh=+j1VnqSKqnc+FrNGQ+OqOjsz5AUPNsXurs9CX6pwzbU=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References: In-Reply-To:Content-Type; b=k52GMm+jfBZskpe5NkWlM0GcjuGrNgnWVWVqZ9C1wsEjAUwJ/EItQtdZqayZHdFVO1xqurQqoQ0jZKQ3Oh3Y/MykFFTVtOUenPNXYZo+1DWvc8TmSyRmYgNA/NXXCAViRHqaBxVzdPcrOfEczDVvcvEmFiThDcQpz5wI8d6iY2s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=rbox.co; spf=pass smtp.mailfrom=rbox.co; dkim=pass (2048-bit key) header.d=rbox.co header.i=@rbox.co header.b=mChPwVLU; arc=none smtp.client-ip=185.226.149.38 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=rbox.co Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rbox.co Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rbox.co header.i=@rbox.co header.b="mChPwVLU" Received: from mailtransmit03.runbox ([10.9.9.163] helo=aibo.runbox.com) by mailtransmit05.runbox.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1wpPMB-00ABYs-OY; Thu, 30 Jul 2026 13:55:23 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=rbox.co; s=selector2; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:References: Cc:To:Subject:From:MIME-Version:Date:Message-ID; bh=Y9826SXsKMxkrm5PlSCjhk43jMi0lB5nA/aZyGom5VI=; b=mChPwVLUKjiPadu8Nsa/Kfxf2t IGLp5aif6HFMpAd2uN/BCtLd+mk6LaJttZFQ194Oixzo0nVvcEGiHIW+6NkVfcF64tO7iPfMGIdB7 vdzBaX8mEtTDwyqXpLkRYXgXrAePuPOkufb88wxaknHTGW9GlkZ8jwMFAy/bDnEdwu+HQS+d3qh22 rRFdV2ygZeRPoNZOfFM3wApEwnaXq1LqxM44hfBBRs/YYiDS7R45B/K3PH2Cweqd7cgTvV/XUx62E eom2pmsM2LJvNNL3pU7HUc+/PyC7WYZETL9/ajnxwCM7RuBj0/kAAfpUhCcwWun2jtO9RCsRzMt/C UNzdW8gA==; Received: from [10.9.9.72] (helo=submission01.runbox) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1wpPM9-0000Ug-VS; Thu, 30 Jul 2026 13:55:22 +0200 Received: by submission01.runbox with esmtpsa [Authenticated ID (604044)] (TLS1.2:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.95) id 1wpPLu-004qqu-Vf; Thu, 30 Jul 2026 13:55:07 +0200 Message-ID: <591fd57e-d006-4e51-af5c-fea65a071819@rbox.co> Date: Thu, 30 Jul 2026 13:55:04 +0200 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Michal Luczaj Subject: Re: [PATCH bpf 3/3] bpf: Unconditionally take socket references in lookup helpers To: Emil Tsalapatis , Eric Dumazet , Kuniyuki Iwashima , Paolo Abeni , Willem de Bruijn , John Fastabend , Jakub Sitnicki , Jiayuan Chen , "David S. Miller" , Jakub Kicinski , Simon Horman , Daniel Borkmann , Stanislav Fomichev , Martin KaFai Lau , Alexei Starovoitov , Andrii Nakryiko , Eduard Zingerman , Kumar Kartikeya Dwivedi , Song Liu , Yonghong Song , Jiri Olsa , Joe Stringer Cc: netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, Sashiko References: <20260723-sockmap-lookup-tcp-leak-v1-0-1bbdc58ce514@rbox.co> <20260723-sockmap-lookup-tcp-leak-v1-3-1bbdc58ce514@rbox.co> Content-Language: pl-PL, en-GB In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 7/29/26 22:32, Emil Tsalapatis wrote: > On Thu Jul 23, 2026 at 7:33 AM EDT, Michal Luczaj wrote: >> Lookup helpers gate whether to acquire a socket reference on >> sk_is_refcounted(), a check re-evaluated at release. An established socket >> refcounted at acquire time can gain SOCK_RCU_FREE via >> connect(AF_UNSPEC)+listen() before release runs; the release-side re-check >> then reads sk_is_refcounted() == false and skips the put. The reference >> leaks. >> >> Make acquire and release unconditional and symmetric: always take a >> reference, always put it. Adapt sk_select_reuseport(). > > Reviewed-by: Emil Tsalapatis Thanks! > The bot's concern about the comment style is obviously invalid here. Are the prompts incorrect? https://github.com/masoncl/review-prompts/blob/59469708305eca305cbd9eb94e5aa0ee3627529c/kernel/subsystem/bpf.md#bpf-comment-style Michal