[PATCH net-next v3 0/6] net: convert atm/xdp/af_iucv/l2tp_ppp/rxrpc/tipc to getsockopt_iter

Breno Leitao <[email protected]> Wed, 20 May 2026 09:53:45 -0700
Newsgroups dev.linux.lists.oe-linux-nfc,org.kernel.vger.bpf,org.kernel.vger.linux-kernel,org.kernel.vger.linux-s390,org.kernel.vger.netdev
Message-ID <[email protected]>
This series continues the conversion of the remaining proto_ops getsockopt
callbacks to the new getsockopt_iter callback introduced in commit 67fab22a7adc
("net: add getsockopt_iter callback to proto_ops").

The new callback takes a sockopt_t — a type-safe wrapper around iov_iter
plus an optlen field — instead of raw __user pointers. This:

    - Replaces (char __user *optval, int __user *optlen) with sockopt_t *opt
    - Reads the input buffer size from opt->optlen instead of get_user()
    - Writes the option value via copy_to_iter() instead of copy_to_user()
    - Reports the returned length via opt->optlen instead of put_user(),
      independently of the bytes copied through the iter

Each conversion is a behaviour-preserving and code-style-preserving refactor;
no big changes being introduced, even when the code looks weird.

Signed-off-by: Breno Leitao <[email protected]>
---
Changes in v3:
- Drop the "af_iucv" fix, and I will send it separately
- Remove a left-over comment (Paolo)
- Link to v2: https://patch.msgid.link/[email protected]

Changes in v2:
- Fix a issue reported by sashiko, where I was using "long int" instead
  of "int" for a value.
- Nit from Stanislav
- Added an additional patch to make the af_iucv SO_MSGSIZE similar to
  its partners.
- Link to v1: https://patch.msgid.link/[email protected]

To: Alexandra Winter <[email protected]>
To: Thorsten Winkler <[email protected]>
To: "David S. Miller" <[email protected]>
To: Eric Dumazet <[email protected]>
To: Jakub Kicinski <[email protected]>
To: Paolo Abeni <[email protected]>
To: Simon Horman <[email protected]>
To: Chas Williams <[email protected]>
To: Magnus Karlsson <[email protected]>
To: Maciej Fijalkowski <[email protected]>
To: Stanislav Fomichev <[email protected]>
To: Alexei Starovoitov <[email protected]>
To: Daniel Borkmann <[email protected]>
To: Jesper Dangaard Brouer <[email protected]>
To: John Fastabend <[email protected]>
To: James Chapman <[email protected]>
To: David Howells <[email protected]>
To: Marc Dionne <[email protected]>
To: Jon Maloy <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
Breno Leitao (6):
      af_iucv: convert to getsockopt_iter
      atm: convert to getsockopt_iter
      xdp: convert to getsockopt_iter
      l2tp: ppp: convert to getsockopt_iter
      rxrpc: convert to getsockopt_iter
      tipc: convert to getsockopt_iter

 net/atm/common.c     | 18 +++++++++++-------
 net/atm/common.h     |  2 +-
 net/atm/pvc.c        |  6 +++---
 net/atm/svc.c        | 15 +++++++--------
 net/iucv/af_iucv.c   | 14 ++++++--------
 net/l2tp/l2tp_ppp.c  | 20 +++++++-------------
 net/rxrpc/af_rxrpc.c | 16 +++++++++-------
 net/tipc/socket.c    | 33 +++++++++++++++++----------------
 net/xdp/xsk.c        | 24 +++++++++++-------------
 9 files changed, 72 insertions(+), 76 deletions(-)
---
base-commit: 95c1d0b80d73a9508ceea198c6132500410846e5
change-id: 20260513-getsock_four-063e6a724555

Best regards,
--  
Breno Leitao <[email protected]>