summaryrefslogtreecommitdiff
path: root/tools/lib/python
diff options
context:
space:
mode:
authorBreno Leitao <leitao@debian.org>2026-05-12 14:12:16 +0300
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2026-06-11 21:24:38 +0300
commit79cf74d870603939183760888ea1cf0ff787d6b1 (patch)
tree850d19d02cb5390376a066693e046565d2772f6f /tools/lib/python
parent794b5e7727de1ebaa07366ae346a139870874c2d (diff)
downloadlinux-79cf74d870603939183760888ea1cf0ff787d6b1.tar.xz
Bluetooth: hci_sock: write the full optval for getsockopt
In hci_sock_getsockopt_old(), HCI_DATA_DIR and HCI_TIME_STAMP both store their value into a local int and then call put_user(opt, optval). Because optval is the function parameter typed char __user *, put_user sizes the write from sizeof(*optval), so only the low byte of the int is copied to userspace. The matching setsockopt path reads sizeof(int) via copy_safe_from_sockptr, so userspace passes a 4-byte buffer in both directions but previously got back only one initialized byte on the read side. Not sending this through 'net' tree given this bug is mostly invisble, given opt is 0/1, and the last byte is being properly copied. With this change, the upcoming translation to .getsockopt_iter becomes mechanical. FWIW: This behavior appeared in commit 1da177e4c3f4 ("Linux-2.6.12-rc2"). Signed-off-by: Breno Leitao <leitao@debian.org> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions