Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1859899pxb; Mon, 13 Sep 2021 07:05:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJywskry2Kz3dFUG4DrlNB8bVNVOqL2pEdb8BZ3PHjpzb2bq3p1YyHI+ND58aIi3eMr9YynD X-Received: by 2002:aa7:c150:: with SMTP id r16mr356544edp.388.1631541959091; Mon, 13 Sep 2021 07:05:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631541959; cv=none; d=google.com; s=arc-20160816; b=PuejFpasfWElH5CDDuweEG+IcWf8AOoHblVvL1k5fc1nEoSq96ukCdanyUqHs/XWmN ihNN8wKI7/s+kllSwhLZL6B2U1/tBEhYpKaTzK83/iJYdFbrBL9mEE9xj3/QOqY9dW43 1yxFj6jmmBb+szJJ7XvEkwDsLXihq1uVwgP877RVNdTQjoBjiFHPBi8eVlSsjIfnWljx gBKNZHZUW9itFsrqHqF916HY4lrdsZT86cNoR65CotcfeP0AejW4Rvc2lTyHnYXneZVL 9iunrtCS3Co2DTTuSk5zpJ3VxJrGvPhq7dPYC6wF899k1zcwzRL86xx7HLRkxiBxsfWf G/8w== 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=JOoKifKpkzO/q+p+rLNFLS+rQpQnnxS3MjKgAcxoFqI=; b=ZD1uCfN8d1a0WSQs2SDXV6oCVbW4bdoJ+UghAlPM2M/i5gp34My1kYqbssrAdlt5RR wuBi2aj75P/j1F3AHZyBqPWVOVZYSU+HNntQfGZKZa/4n9L/IuJ1qqp+uq5jLHWUGcM4 OZypecfqh1cNpw6Oh5WqUm3IcYc56Ql7NrZZrCIq/63W4mLf9Ii2V5/GjIxpcu6LRtWw cwbEo/UdFGusrxTKY+A+VRzLrtq1eZctKl4L73IX0IstANDb+bjAy71UKCUR0U34TEjY dLgFhIdLnK8rKSW+HMdL9tzkJ1+U656BQxMPc5aSlcSFPfTVlDJUkB37Vln3Ldg88vi/ 8izA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qwCHdT0N; 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 y11si5631776eda.74.2021.09.13.07.05.32; Mon, 13 Sep 2021 07:05:59 -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=qwCHdT0N; 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 S244525AbhIMODN (ORCPT + 99 others); Mon, 13 Sep 2021 10:03:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:46016 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244961AbhIMOAj (ORCPT ); Mon, 13 Sep 2021 10:00:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E3DAF61A2A; Mon, 13 Sep 2021 13:37:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631540253; bh=9X9on+uGZfhnLn2z3QlG2aGGzuULxqblXnl/Et2unIY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qwCHdT0N+EicQIKrmKnGe4Q4S+Pv7H/aXGbrPURQrTiMhSjEoc8/6WGP/WYfR/Yfk Uv/xc0mTmXmCXNLS3TydGM9sqp0n9YMCyTufL+P4O5JsHp5v4xjJhUlrnoE1bd+vCd ehrdeN4fBtmrju7D7Oh6uCJFWbxxXtTP31CMvuLg= 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.13 116/300] Bluetooth: sco: prevent information leak in sco_conn_defer_accept() Date: Mon, 13 Sep 2021 15:12:57 +0200 Message-Id: <20210913131113.309272297@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131109.253835823@linuxfoundation.org> References: <20210913131109.253835823@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 3bd41563f118..a7b4555f312f 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