Thread (14 messages) 14 messages, 4 authors, 2d ago

Re: [PATCH net-next v2 1/4] net: add sockopt_init_user() for getsockopt conversion

From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Date: 2026-07-01 21:50:49
Also in: linux-kselftest, lkml

Breno Leitao wrote:
Add a helper that initializes a user-backed sockopt_t from the (optval,
optlen) __user pair passed to a getsockopt() callback.

It is used by transitional __user getsockopt wrappers while the
proto-layer getsockopt callbacks are converted to take a sockopt_t, and
is removed once the conversion is complete.

The goal is to help to convert leafs. Example:

 sock_common_getsockopt(... char __user *optval, int __user *optlen)
      → udp_getsockopt(sk, level, optname, optval__user, optlen__user)
               → udp_lib_getsockopt(sk, level, optname, &opt)   /* needs a sockopt_t */

Signed-off-by: Breno Leitao <leitao@debian.org>
Acked-by: Willem de Bruijn <willemb@google.com>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help