From: Breno Leitao <leitao@debian.org>
To: sdf@fomichev.me, "David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Simon Horman" <horms@kernel.org>,
"Alexander Aring" <alex.aring@gmail.com>,
"Stefan Schmidt" <stefan@datenfreihafen.org>,
"Miquel Raynal" <miquel.raynal@bootlin.com>,
"Remi Denis-Courmont" <courmisch@gmail.com>,
"Rémi Denis-Courmont" <remi.denis-courmont@nokia.com>,
"John Fastabend" <john.fastabend@gmail.com>,
"Sabrina Dubroca" <sd@queasysnail.net>,
"Shuah Khan" <shuah@kernel.org>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-wpan@vger.kernel.org, linux-kselftest@vger.kernel.org,
"Breno Leitao" <leitao@debian.org>,
kernel-team@meta.com, "Rémi Denis-Courmont" <remi@remlab.net>
Subject: [PATCH net-next v2 0/7] net: convert rawv6, ieee802154, phonet and tls getsockopt to sockopt_t
Date: Mon, 20 Jul 2026 09:17:41 -0700 [thread overview]
Message-ID: <20260720-getsockopt_phase4-v2-0-8a08fcfa0d72@debian.org> (raw)
Now that sockopt_init_user() was already merged, builds a user-backed
sockopt_t from the __user pair. A getsockopt leaf can then take
a sockopt_t behind a thin __user wrapper: the wrapper builds it, calls
the leaf, and writes the length back to optlen. The leaf copies with
copy_to_iter() instead of copy_to_user().
Convert four more leaves the way udp and raw already were: ipv6 raw
(do_rawv6_getsockopt), ieee802154 dgram, phonet pep, and tls
(do_tls_getsockopt and its per-option helpers).
Converting phonet surfaced a pre-existing bug: pep_getsockopt() clamps the
length it reports but writes a full int with put_user(), overrunning an
optval buffer shorter than sizeof(int). It is fixed in its own patch, with
a Fixes: tag, before the phonet conversion, so it can be backported alone.
The last patch adds getsockopt_iter selftest fixtures for rawv6,
ieee802154, phonet and tls, checking the returned length and errno across
exact, oversized and short buffers, an unknown optname and a bad level.
For full motivation about these changes, please check the initial thread
at link
https://lore.kernel.org/all/20260401-getsockopt-v2-0-611df6771aff@debian.org/#t
Signed-off-by: Breno Leitao <leitao@debian.org>
---
Changes in v2:
- Replace min_t() by umin() (David)
- Link to v1: https://patch.msgid.link/20260716-getsockopt_phase4-v1-0-4f45cb12dce7@debian.org
---
Breno Leitao (7):
ipv6: raw: drop unused level argument from do_rawv6_getsockopt
ipv6: raw: convert do_rawv6_getsockopt to sockopt_t
ieee802154: convert dgram getsockopt to sockopt_t
phonet: pep: do not write beyond optlen in getsockopt
phonet: pep: convert getsockopt to sockopt_t
tls: convert getsockopt to sockopt_t
selftests: net: getsockopt_iter: cover rawv6, ieee802154, phonet and tls
net/ieee802154/socket.c | 38 ++-
net/ipv6/raw.c | 27 +-
net/phonet/pep.c | 36 ++-
net/tls/tls_main.c | 80 +++--
tools/testing/selftests/net/getsockopt_iter.c | 424 ++++++++++++++++++++++++++
5 files changed, 533 insertions(+), 72 deletions(-)
---
base-commit: f6f3b36c15ed44de1fbb44e645e4fae8c4a4453e
change-id: 20260715-getsockopt_phase4-180209cfc60a
Best regards,
--
Breno Leitao <leitao@debian.org>
next reply other threads:[~2026-07-20 16:23 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-20 16:17 Breno Leitao [this message]
2026-07-20 16:17 ` [PATCH net-next v2 1/7] ipv6: raw: drop unused level argument from do_rawv6_getsockopt Breno Leitao
2026-07-20 16:17 ` [PATCH net-next v2 2/7] ipv6: raw: convert do_rawv6_getsockopt to sockopt_t Breno Leitao
2026-07-20 16:17 ` [PATCH net-next v2 3/7] ieee802154: convert dgram getsockopt " Breno Leitao
2026-07-22 13:40 ` Joe Damato
2026-07-20 16:17 ` [PATCH net-next v2 4/7] phonet: pep: do not write beyond optlen in getsockopt Breno Leitao
2026-07-20 16:17 ` [PATCH net-next v2 5/7] phonet: pep: convert getsockopt to sockopt_t Breno Leitao
2026-07-20 16:17 ` [PATCH net-next v2 6/7] tls: " Breno Leitao
2026-07-20 16:17 ` [PATCH net-next v2 7/7] selftests: net: getsockopt_iter: cover rawv6, ieee802154, phonet and tls Breno Leitao
2026-07-22 13:42 ` [PATCH net-next v2 0/7] net: convert rawv6, ieee802154, phonet and tls getsockopt to sockopt_t Joe Damato
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=20260720-getsockopt_phase4-v2-0-8a08fcfa0d72@debian.org \
--to=leitao@debian.org \
--cc=alex.aring@gmail.com \
--cc=courmisch@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=john.fastabend@gmail.com \
--cc=kernel-team@meta.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-wpan@vger.kernel.org \
--cc=miquel.raynal@bootlin.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=remi.denis-courmont@nokia.com \
--cc=remi@remlab.net \
--cc=sd@queasysnail.net \
--cc=sdf@fomichev.me \
--cc=shuah@kernel.org \
--cc=stefan@datenfreihafen.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.