Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1826230pxb; Mon, 13 Sep 2021 06:25:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw//2xFJ3ezund1EABlFk6JJ+8XoJHtHywGR4q9QPXZVxa5HAu//FJcAQbm9ASasDmVgZ2/ X-Received: by 2002:a5d:9247:: with SMTP id e7mr9088467iol.161.1631539523971; Mon, 13 Sep 2021 06:25:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631539523; cv=none; d=google.com; s=arc-20160816; b=OUEh/vnarCPR+exTQ29I4ody3NcFiuLK8D7Dus7Pf/4yk+4ld0DB80jG3QLYGFR8NM N9Z1DOz121jWCDE+beHsEE8FTRWPx+RqlhMzzG+PPH03ApJHDxMn2cBeY04hLgukrKvm anBlqX72gNiXMHl7EZnDZANL0Ec6rdpuMkIwL7L5P73+cLZs6T6T76cKsW5uTnbRsdNz Wgkpnjh0SmG4d8j1F/UuiIaB+NdBZqp6xwOLxfAfc4Nd0B+cIMHMafWoyl6KT8bag8vs tFfEsAATB5quJ0JrWGSE/WFJjeeHjZPC3l7jcs0OAHWazIMDekPx2syL4OtyjUuQzStJ malQ== 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=ng6JOeldEwinPJvUkArDpBE74+TLxojOQrwXM9I1410=; b=SAkpjFLFugOPaIhIZJo9mJKEKVRp4pYFa/Ms0+Ep4qZXX8MZOGGKbs4Exh8sReUvVh 4vlDbsqlb3XfzOac4AJiBx9l4Dsa5L1P4Nm3VkZFzDoGBAPopsKUIs0lG+qpB67buD1g AXM6tTl0pFRsSb7FQl848sD2O7cvrEoDJfkqubU2KZGvMj8Xr8CKFpL6B2HZr6ZI1NUC K18YZ7ImBZ9kjV5U9ib44t6kELggIK6Cny38WbTA02caTeFsYYKoAgzOjpytPMXsOivJ fwp424Wf8AtO5DxmsAtHl+cXiZa7oJy/TfZ9wJ6fin+pbOCaCeDl/amzqST7MeLlotYY guJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Px88F4aB; 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 z17si6586374ils.47.2021.09.13.06.25.10; Mon, 13 Sep 2021 06:25:23 -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=Px88F4aB; 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 S241281AbhIMNXp (ORCPT + 99 others); Mon, 13 Sep 2021 09:23:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:37818 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240802AbhIMNVi (ORCPT ); Mon, 13 Sep 2021 09:21:38 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 821D8610E6; Mon, 13 Sep 2021 13:20:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539223; bh=31iWokU5YgI53j4AyT/g0+V+sQt5CtOrfxglvAlH6qo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Px88F4aB3BTulqhiCMcmy2PskVDY4Yx1YI4/2KA2D6ZRRqguJF/sKLwe9JWqDC4DN DRE86BN6ENKDXLausSkjowCDm4fobeTtJC76LzWihkhI5/V06tyUwbu5APdsBAoxru cBXDEWK4ce//eX3uC7Wv3YOlEpHfsAq9qhoxvlmw= 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.4 060/144] Bluetooth: sco: prevent information leak in sco_conn_defer_accept() Date: Mon, 13 Sep 2021 15:14:01 +0200 Message-Id: <20210913131049.980269753@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131047.974309396@linuxfoundation.org> References: <20210913131047.974309396@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 b91d6b440fdf..335264706aae 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, -- 2.30.2