Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp84658pxb; Mon, 13 Sep 2021 13:36:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzX2QlALMArRVbYBPXeelht3tUg1ZLcuidAGYrYhfXabkKLklLzzWDkaokWZhgbwakjCWNO X-Received: by 2002:a17:906:ecb8:: with SMTP id qh24mr14958013ejb.88.1631565410359; Mon, 13 Sep 2021 13:36:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631565410; cv=none; d=google.com; s=arc-20160816; b=Omf3EoiBeuxMaUquUNdk33s2KAYZFh8vci1sC4rh1lpcwGXd40EY3lahJDr2IyJpHc 3aMCuaAFjehxNgyzl9lQK6pv8lPxMI5N5IwppxEWPDSwYcTj5Ol8xKED0yZJBMzaL9nq 4DmklK8oyKcfG/gFXQLXcPB7VVYsQ4HCt+qyb7YNzk1xEDTZCiG+MEPIoTmKicUtk+uh CN17Ks2aYRsOB4QFdbiuRHLHdqkJytPxAT6vMBUMKVaYusz3sW8kFujG32O+xlyUenet bjPJQJqJPfYbkFG1OnoLrZDSG+g9FfdYczlo83l+dQ/XGx4slwXJ4K0Gau7rGzWjbgqj yhcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Hp069mf5wU+WnwAhWqMtqjwEqdmI7KZ5bA/KCF46R4c=; b=A79tu2b8B5ueZb2X4jlbeqQi9hfqzJoygq0uIyf4605ko9UgrJceOccNaO1/GGf2y3 nEv5cmVMJBxshZnlr+nJh8BK5L/+GoCq2WUvlq6pspiU0eDzSZ/2oQmxd/gQesOsoZiC BpkL/ep5IuOodh7jUpKvnAYkwb3mQ6wpTOrnsL0bMGFdHAOS9HB0h5RkSR/zVG0yYQqm Gg1gsLpn1h+f3X3WxaBHBuYHD1Mtq67ZfeSIIqF0haiIq9f18ymEWXifRQ04+OCp0X+W Zdab2PPnIp1AyAMaFYu0LAFQCivyMrJt6Sc5O4YbUEa7otk4SJtGhlDPNEyrciYk6jk6 Ui7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TouwSSJE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z13si7948964edb.22.2021.09.13.13.36.26; Mon, 13 Sep 2021 13:36:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TouwSSJE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242601AbhIMNnV (ORCPT + 99 others); Mon, 13 Sep 2021 09:43:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:37714 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243127AbhIMNiT (ORCPT ); Mon, 13 Sep 2021 09:38:19 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 525D561247; Mon, 13 Sep 2021 13:28:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539703; bh=f2ruVeWyqZ5VeHDIMHYDRVtVZDlzwsNiGtYfBcy54xs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TouwSSJEqF8LyW8pdbye8J6//i0wFMGRoegicbV59hmoVH9zLjM1EAuJZ1XYXxRzE ppWNzqnxQZBfXoIYAuTE1m9kbvKahoIn+MCZYQovTC5VwrGIKcQlZNGDLi4pHgs1pT 3CXrjCOVVsB1YoLeCFSu8f/uCGo5Gu+6U8A7a11E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Marcel Holtmann , Sasha Levin Subject: [PATCH 5.10 100/236] Bluetooth: sco: prevent information leak in sco_conn_defer_accept() Date: Mon, 13 Sep 2021 15:13:25 +0200 Message-Id: <20210913131103.749678014@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131100.316353015@linuxfoundation.org> References: <20210913131100.316353015@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Carpenter [ 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 Signed-off-by: Marcel Holtmann Signed-off-by: Sasha Levin --- net/bluetooth/sco.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c index 22a110f37abc..8ae8af33ae91 100644 --- a/net/bluetooth/sco.c +++ b/net/bluetooth/sco.c @@ -773,6 +773,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, -- 2.30.2