Re: [PATCH bpf-next v6 1/5] net: Add connect_socket() helper
Mahe Tardy <[email protected]>
| Newsgroups | org.kernel.vger.bpf,org.kernel.vger.netdev |
|---|---|
| Message-ID | <[email protected]> |
On Wed, Aug 12, 2026 at 05:25:37PM +0000, [email protected] wrote: > > Add a helper that connects an existing socket while invoking the LSM > > hook. Reuse it in __sys_connect_file() to avoid duplicating the connect > > logic. Other socket operations have equivalent helpers that trigger the > > appropriate LSM hooks that can be reused, this one was the only one > > missing. > > This isn't a bug, but could the changelog note which follow-up user needs > connect_socket() to be global (rather than static in net/socket.c), so the > new header declaration is justified within this patch? > > The changelog motivates the helper only by the in-file reuse, but on its own > that would not require a new global symbol: connect_socket() is declared in > include/linux/socket.h while its single caller is 26 lines below it in > net/socket.c. The actual consumer is the bpf_ksock_connect() kfunc added later > in the series, which the message does not mention, so a reader of this patch > alone cannot tell why the helper is not static. Indeed if needed, this could be made more explicit. Currently it's implied that one helper was missing "for the next patches". > > Other socket operations have equivalent helpers that trigger the > > appropriate LSM hooks that can be reused, this one was the only one > > missing. > > > --- > AI reviewed your patch. Please fix the bug or email reply why it's not a bug. > See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md > > CI run summary: https://github.com/kernel-patches/bpf/actions/runs/31618864886