Skip to content

Bluetooth: convert remaining bluetooth socket families to getsockopt_iter

Breno Leitao linux-bluetooth linux-kselftest lkml netdev 2 versions – Applied

Status from this message: This series was applied to bluetooth/bluetooth-next.git (master)

Get series with b4
b4 am [email protected] change-id 20260511-getsock_three-d0d7f1b2629e

Versions newest first

  1. v2 Latest6 patches 3 repliesApplied 6/6
  2. v17 patches 4 repliesSuperseded 6 of 7 applied

Changes in v2 from the cover letter

- rebase the tree on top of bluetooth-next.
- Remove the selftest, which was mixing network and bluetooth together.
- Link to v1: https://patch.msgid.link/[email protected]

Patches in v2 All 6 applied

#Subject and filesSizeRepliesApplied
1/6Bluetooth: hci_sock: write the full optval for getsockoptnet/bluetooth/hci_sock.c+2 -21 replyApplied
2/6Bluetooth: hci_sock: convert to getsockopt_iternet/bluetooth/hci_sock.c+15 -110 repliesApplied
3/6Bluetooth: ISO: convert to getsockopt_iternet/bluetooth/iso.c+14 -130 repliesApplied
4/6Bluetooth: RFCOMM: convert to getsockopt_iternet/bluetooth/rfcomm/sock.c+17 -130 repliesApplied
5/6Bluetooth: L2CAP: convert to getsockopt_iternet/bluetooth/l2cap_sock.c+37 -240 repliesApplied
6/6Bluetooth: SCO: convert to getsockopt_iternet/bluetooth/sco.c+31 -280 repliesApplied

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH net-next v2 0/6] Bluetooth: convert remaining bluetooth socket families to getsockopt_iter

Continue the conversion to .getsockopt_iter for the Bluetooth socket
families: hci_sock, ISO, RFCOMM, SCO and L2CAP. The first patch is a small precursor that fixes a long-standing 1-byte put_user write in hci_sock_getsockopt_old() so the subsequent conversion stays mechanical.

The riskiest change in this series is the SCO BT_CODEC conversion: it is the only one that drops an open-coded ptr cursor in favour of relying on iter_out advancing naturally on every copy_to_iter() call. Every other socket option is a near-mechanical s/copy_to_user/ copy_to_iter/ rewrite, but BT_CODEC walks a variable-length list of codecs + capabilities and previously tracked its own write offset by hand. Getting the cursor semantics wrong here would silently truncate or misalign user-visible codec data.

For more context about the motivation for this change, please check commit 67fab22a7ad ("net: add getsockopt_iter callback to proto_ops")

---
Changes in v2:
- rebase the tree on top of bluetooth-next.
- Remove the selftest, which was mixing network and bluetooth together.
- Link to v1: https://patch.msgid.link/[email protected]

To: Marcel Holtmann <[email protected]>
To: Luiz Augusto von Dentz <[email protected]>
Cc: [email protected]
Cc: [email protected]

---
Breno Leitao (6):
Bluetooth: hci_sock: write the full optval for getsockopt
Bluetooth: hci_sock: convert to getsockopt_iter
Bluetooth: ISO: convert to getsockopt_iter
Bluetooth: RFCOMM: convert to getsockopt_iter
Bluetooth: L2CAP: convert to getsockopt_iter
Bluetooth: SCO: convert to getsockopt_iter

 net/bluetooth/hci_sock.c    | 26 +++++++++++--------
 net/bluetooth/iso.c         | 27 ++++++++++----------
 net/bluetooth/l2cap_sock.c  | 61 +++++++++++++++++++++++++++------------------
 net/bluetooth/rfcomm/sock.c | 30 ++++++++++++----------
 net/bluetooth/sco.c         | 59 ++++++++++++++++++++++---------------------
 5 files changed, 114 insertions(+), 89 deletions(-)

---
base-commit: c2f0079e8c42fd6814c8d6b1491e3ce0a0e3b3fa
change-id: 20260511-getsock_three-d0d7f1b2629e

Best regards,

Signature · 1 line
Breno Leitao <[email protected]>