summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2021-06-25 18:00:09 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-09-22 11:47:52 +0200
commitba0a4e09a438871b9ce7052dfcc156e9df1c71b2 (patch)
tree0fc179445771d093af46f82490b2ce003a9a4c78 /net
parente5444d813ec17510d788930526be6d9926751812 (diff)
downloadlinux-stable-ba0a4e09a438871b9ce7052dfcc156e9df1c71b2.tar.gz
linux-stable-ba0a4e09a438871b9ce7052dfcc156e9df1c71b2.tar.bz2
linux-stable-ba0a4e09a438871b9ce7052dfcc156e9df1c71b2.zip
Bluetooth: sco: prevent information leak in sco_conn_defer_accept()
[ Upstream commit 59da0b38bc2ea570ede23a3332ecb3e7574ce6b2 ] Smatch complains that some of these struct members are not initialized leading to a stack information disclosure: net/bluetooth/sco.c:778 sco_conn_defer_accept() warn: check that 'cp.retrans_effort' doesn't leak information This seems like a valid warning. I've added a default case to fix this issue. Fixes: 2f69a82acf6f ("Bluetooth: Use voice setting in deferred SCO connection request") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/sco.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c
index a4ca55df7390..2561e462400e 100644
--- a/net/bluetooth/sco.c
+++ b/net/bluetooth/sco.c
@@ -761,6 +761,11 @@ static void sco_conn_defer_accept(struct hci_conn *conn, u16 setting)
cp.max_latency = cpu_to_le16(0xffff);
cp.retrans_effort = 0xff;
break;
+ default:
+ /* use CVSD settings as fallback */
+ cp.max_latency = cpu_to_le16(0xffff);
+ cp.retrans_effort = 0xff;
+ break;
}
hci_send_cmd(hdev, HCI_OP_ACCEPT_SYNC_CONN_REQ,