You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bluetooth: Improve setsockopt() handling of malformed user input
JIRA: https://issues.redhat.com/browse/RHEL-74483
commit 3e643e4
Author: Michal Luczaj <mhal@rbox.co>
Date: Tue Nov 19 14:31:40 2024 +0100
Bluetooth: Improve setsockopt() handling of malformed user input
The bt_copy_from_sockptr() return value is being misinterpreted by most
users: a non-zero result is mistakenly assumed to represent an error code,
but actually indicates the number of bytes that could not be copied.
Remove bt_copy_from_sockptr() and adapt callers to use
copy_safe_from_sockptr().
For sco_sock_setsockopt() (case BT_CODEC) use copy_struct_from_sockptr() to
scrub parts of uninitialized buffer.
Opportunistically, rename `len` to `optlen` in hci_sock_setsockopt_old()
and hci_sock_setsockopt().
Fixes: 51eda36 ("Bluetooth: SCO: Fix not validating setsockopt user input")
Fixes: a97de7b ("Bluetooth: RFCOMM: Fix not validating setsockopt user input")
Fixes: 4f39512 ("Bluetooth: L2CAP: Fix not validating setsockopt user input")
Fixes: 9e8742c ("Bluetooth: ISO: Fix not validating setsockopt user input")
Fixes: b218606 ("Bluetooth: hci_sock: Fix not validating setsockopt user input")
Reviewed-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Reviewed-by: David Wei <dw@davidwei.uk>
Signed-off-by: Michal Luczaj <mhal@rbox.co>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Bastien Nocera <bnocera@redhat.com>
0 commit comments