]> git.itanic.dy.fi Git - linux-stable/commit
Bluetooth: L2CAP: Fix not validating setsockopt user input
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fri, 5 Apr 2024 19:50:47 +0000 (15:50 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Apr 2024 09:23:32 +0000 (11:23 +0200)
commit8ee0c132a61df9723813c40e742dc5321824daa9
treec2e2feb7c64240083d50c2d94a2355893354bcf6
parentc3f787a3eafe519c93df9abbb0ca5145861c8d0f
Bluetooth: L2CAP: Fix not validating setsockopt user input

[ Upstream commit 4f3951242ace5efc7131932e2e01e6ac6baed846 ]

Check user input length before copying data.

Fixes: 33575df7be67 ("Bluetooth: move l2cap_sock_setsockopt() to l2cap_sock.c")
Fixes: 3ee7b7cd8390 ("Bluetooth: Add BT_MODE socket option")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/bluetooth/l2cap_sock.c