linux/net/netlink
Breno Leitao 390bf43b77 netlink: convert to getsockopt_iter
Convert AF_NETLINK's getsockopt implementation to use the new
getsockopt_iter callback with sockopt_t.

Key changes:
- Replace (char __user *optval, int __user *optlen) with sockopt_t *opt
- Use opt->optlen for buffer length (input) and returned size (output)
- Use copy_to_iter() instead of put_user()/copy_to_user()
- For NETLINK_LIST_MEMBERSHIPS: walk the groups bitmap and emit each
  u32 sequentially via copy_to_iter(), then set opt->optlen to the
  total size required (ALIGN(BITS_TO_BYTES(ngroups), sizeof(u32))).
  The wrapper writes opt->optlen back to userspace even on partial
  failure, preserving the existing API that lets userspace discover
  the needed allocation size.

Signed-off-by: Breno Leitao <leitao@debian.org>
Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Link: https://patch.msgid.link/20260501-getsock_one-v1-1-810ce23ea70e@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-05-04 19:02:30 -07:00
..
af_netlink.c netlink: convert to getsockopt_iter 2026-05-04 19:02:30 -07:00
af_netlink.h netlink: terminate outstanding dump on socket close 2024-11-07 13:45:34 -08:00
diag.c net: change sock.sk_ino and sock_i_ino() to u64 2026-03-06 14:31:26 +01:00
genetlink.c genetlink: apply reject policy for split ops on the dispatch path 2026-03-12 18:02:13 -07:00
genetlink.h netlink: create a new header for internal genetlink symbols 2024-04-01 21:44:34 -07:00
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
Makefile netlink: add infrastructure to expose policies to userspace 2020-04-30 17:51:42 -07:00
policy.c genetlink: use maxattr of 0 for the reject policy 2026-03-12 18:02:13 -07:00