]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
Bluetooth: SCO: Fix not validating setsockopt user input
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fri, 5 Apr 2024 19:41:52 +0000 (15:41 -0400)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Wed, 10 Apr 2024 19:03:46 +0000 (15:03 -0400)
commit51eda36d33e43201e7a4fd35232e069b2c850b01
tree960adfedb0647decf222d2a17876821c3ae665f8
parent45d355a926ab40f3ae7bc0b0a00cb0e3e8a5a810
Bluetooth: SCO: Fix not validating setsockopt user input

syzbot reported sco_sock_setsockopt() is copying data without
checking user input length.

BUG: KASAN: slab-out-of-bounds in copy_from_sockptr_offset
include/linux/sockptr.h:49 [inline]
BUG: KASAN: slab-out-of-bounds in copy_from_sockptr
include/linux/sockptr.h:55 [inline]
BUG: KASAN: slab-out-of-bounds in sco_sock_setsockopt+0xc0b/0xf90
net/bluetooth/sco.c:893
Read of size 4 at addr ffff88805f7b15a3 by task syz-executor.5/12578

Fixes: ad10b1a48754 ("Bluetooth: Add Bluetooth socket voice option")
Fixes: b96e9c671b05 ("Bluetooth: Add BT_DEFER_SETUP option to sco socket")
Fixes: 00398e1d5183 ("Bluetooth: Add support for BT_PKT_STATUS CMSG data for SCO connections")
Fixes: f6873401a608 ("Bluetooth: Allow setting of codec for HFP offload use case")
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
include/net/bluetooth/bluetooth.h
net/bluetooth/sco.c