Netdev List
 help / color / mirror / Atom feed
From: bot+bpf-ci@kernel.org
To: mahe.tardy@gmail.com,bpf@vger.kernel.org
Cc: andrew+netdev@lunn.ch,andrii@kernel.org,ast@kernel.org,daniel@iogearbox.net,davem@davemloft.net,eddyz87@gmail.com,edumazet@google.com,john.fastabend@gmail.com,kuba@kernel.org,liamwisehart@meta.com,martin.lau@linux.dev,pabeni@redhat.com,song@kernel.org,netdev@vger.kernel.org,sdf.kernel@gmail.com,ameryhung@gmail.com,kuniyu@google.com,memxor@gmail.com,jiayuan.chen@linux.dev,mahe.tardy@gmail.com,ast@kernel.org,andrii@kernel.org,daniel@iogearbox.net,martin.lau@kernel.org,eddyz87@gmail.com,yonghong.song@linux.dev,clm@meta.com,ihor.solodrai@linux.dev
Subject: Re: [PATCH bpf-next v5 1/5] net: Add connect_socket() helper
Date: Fri,  7 Aug 2026 18:11:50 +0000 (UTC)	[thread overview]
Message-ID: <bbfbdee48bdf4ff655479e02a00828655b8dc1580c321feb46bfbb864e46dff7@mail.kernel.org> (raw)
In-Reply-To: <20260807171532.125149-2-mahe.tardy@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2523 bytes --]

> diff --git a/include/linux/socket.h b/include/linux/socket.h
> index 2a8d7b14f1d1..5a5eb1250103 100644
> --- a/include/linux/socket.h
> +++ b/include/linux/socket.h
> @@ -461,6 +461,8 @@ extern struct file *__sys_socket_file(int family, int type, int protocol);
>  extern int __sys_bind(int fd, struct sockaddr __user *umyaddr, int addrlen);
>  extern int __sys_bind_socket(struct socket *sock, struct sockaddr_storage *address,
>  			     int addrlen);
> +int connect_socket(struct socket *sock, struct sockaddr_storage *addr,
> +		   int addrlen, int flags);
>  extern int __sys_connect_file(struct file *file, struct sockaddr_storage *addr,
>  			      int addrlen, int file_flags);
>  extern int __sys_connect(int fd, struct sockaddr __user *uservaddr,
> diff --git a/net/socket.c b/net/socket.c
> index 63c69a0fa74e..8f18f124d92a 100644
> --- a/net/socket.c
> +++ b/net/socket.c
> @@ -2103,6 +2103,20 @@ SYSCALL_DEFINE3(accept, int, fd, struct sockaddr __user *, upeer_sockaddr,
>  	return __sys_accept4(fd, upeer_sockaddr, upeer_addrlen, 0);
>  }
>
> +int connect_socket(struct socket *sock, struct sockaddr_storage *address,
> +		   int addrlen, int flags)
> +{

This isn't a bug, but would a name closer to the neighbouring helpers,
such as __sys_connect_socket(), read better here? The equivalent
socket-level helpers in the same file follow the __sys_<op>_socket() or
__sys_<op>_sock() shape (__sys_bind_socket(), __sys_listen_socket(),
__sys_shutdown_sock()), and the declaration is added in the middle of
that same helpers block in include/linux/socket.h. Also, net/socket.c
already has kernel_connect(), which performs the same
READ_ONCE(sock->ops)->connect() dispatch and differs only in not calling
the LSM hook, so the two names don't signal which one a caller should
pick. Could a short comment note how it differs from kernel_connect()?

> +	int err;
> +
> +	err = security_socket_connect(sock, (struct sockaddr *)address, addrlen);
> +	if (err)
> +		return err;
> +
> +	return READ_ONCE(sock->ops)->connect(sock,
> +				    (struct sockaddr_unsized *)address,
> +				    addrlen, flags);
> +}
> +
>  /*
>   *	Attempt to connect to a socket with the server address.  The address
>   *	is in user space so we verify it is OK and move it to kernel space.

[ ... ]


---
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/31202489240

  reply	other threads:[~2026-08-07 18:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-07 17:15 [PATCH bpf-next v5 0/5] Introduce bpf_ksock Mahe Tardy
2026-08-07 17:15 ` [PATCH bpf-next v5 1/5] net: Add connect_socket() helper Mahe Tardy
2026-08-07 18:11   ` bot+bpf-ci [this message]
2026-08-07 17:15 ` [PATCH bpf-next v5 2/5] bpf: Add ksock kfuncs Mahe Tardy
2026-08-07 17:15 ` [PATCH bpf-next v5 3/5] selftests/bpf: Add ksock kfunc test Mahe Tardy
2026-08-07 17:15 ` [PATCH bpf-next v5 4/5] selftests/bpf: Test forbidden bpf_ksock_send() LSM attach Mahe Tardy
2026-08-07 18:41   ` bot+bpf-ci
2026-08-07 17:15 ` [PATCH bpf-next v5 5/5] selftests/bpf: Add ksock test for async callback guard Mahe Tardy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bbfbdee48bdf4ff655479e02a00828655b8dc1580c321feb46bfbb864e46dff7@mail.kernel.org \
    --to=bot+bpf-ci@kernel.org \
    --cc=ameryhung@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=clm@meta.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=eddyz87@gmail.com \
    --cc=edumazet@google.com \
    --cc=ihor.solodrai@linux.dev \
    --cc=jiayuan.chen@linux.dev \
    --cc=john.fastabend@gmail.com \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=liamwisehart@meta.com \
    --cc=mahe.tardy@gmail.com \
    --cc=martin.lau@kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=memxor@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sdf.kernel@gmail.com \
    --cc=song@kernel.org \
    --cc=yonghong.song@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox