Re: [PATCH bpf 3/3] bpf: Unconditionally take socket references in lookup helpers
"Kumar Kartikeya Dwivedi" <[email protected]> Sat, 01 Aug 2026 18:29:34 +0200
| Newsgroups | org.kernel.vger.bpf,org.kernel.vger.linux-kernel,org.kernel.vger.netdev |
|---|---|
| Message-ID | <[email protected]> |
On Thu Jul 30, 2026 at 1:55 PM CEST, Michal Luczaj wrote: > 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 <[email protected]> > > 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 > The prompt is correct, but we don't bother for existing comments, if you add a new one, you can use the new style. Overall, looks like the set is pretty close. You can respin targeting bpf-next as John suggested (and we can wait for his ack before landing) so it can go through CI again. pw-bot: cr > Michal