Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2318867pxb; Mon, 20 Sep 2021 18:41:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPDYJQ1Jr8d5FB3wOIkIOoVkao8I9uHn2m2ftcT1F51gg9PvxhuNtmzatrN2l1F1JvR9TP X-Received: by 2002:a5e:860b:: with SMTP id z11mr5146263ioj.145.1632188486321; Mon, 20 Sep 2021 18:41:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632188486; cv=none; d=google.com; s=arc-20160816; b=STQXfJssWwkHLncxGkXgK3gHWag7dmwtF1SAbvJaiLaM3K/mAxZryIG+JIirwCLwbz snQeaxPAZWA0c3UatLbBFDqTllKHxE+w2RJ7EEEnJBjLJ4cg6yBlCmtpL6oui1sx9eUn iKnCAaykjN8aiJstEwRqDhdXCF/59/9yAXDxr1Bc9loJ3O/CgQW8PpMV2nMpjmyHdrhW K+qquWcrpGu/f62bWkwtbALQsFUh8lBVNzkuZ0ox3UlH6+19xRUAwSD1zPfKNR+f1b1w WA5fvGPW1EIlNQTapDwtJzo8MroLhxAu3AsyI/95dnUKtKb69NVhJvqnFIZKBPx1qztQ 9r5A== 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=rDjryjXPGt1Xkf+mCbXDTmdC8e7fVANtWeRL62XlFC0=; b=kDIoC5/PGDbtpgXKcDicCgqnA/5cl54JDi+sv1kCG8cmAcRHxRe3XKpbczMIWwZpJL o1m9vkIkvr/fHtdEnzm8UZ71cqix5qI2pe6HKifU83J/8x/+UiC5VZMgnhntUZVIKvrg JLH0aZ3lwKBWv/8CKrRm+r8P1uAso+URGZml88XYKIxcJPGq0mnKG5TrTop4pk142F3+ /LdzwUU5gkkJSvgG2VHL3ry9kaWVuxXEuq3UHU3J96FDxWlthkLWBPxvGxUMAWhzPMkY UCWvAtJalXZdluGdWfVG+TY3TnrciL2UPuzTR4DitfEQAvV9on0sknrsta3tgqRTtO0h HDHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aM4f4aQJ; 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 q7si17035082ilu.111.2021.09.20.18.41.15; Mon, 20 Sep 2021 18:41:26 -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=aM4f4aQJ; 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 S244025AbhITQtC (ORCPT + 99 others); Mon, 20 Sep 2021 12:49:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:36634 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243657AbhITQsG (ORCPT ); Mon, 20 Sep 2021 12:48:06 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8E0126124A; Mon, 20 Sep 2021 16:46:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632156400; bh=woNrVDUHc1yrFGagMHyYJ7X0GF+fZoINBr4/vMUjUYk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aM4f4aQJGhcL4ltMKzM2fOREdFMLOIIUpoy85Y6lbzZmDofumB+z2D9inUqIeJB8z /mHz99KV9rQyePhZNQdF4k7fYrAamORPtvDxc1gn7QvzcjHLSqJYauJat3XyfOPVFx 5cXSmGrHUModj8scu/ToZbbbobSiec8oTaHpdkJU= 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 4.4 041/133] Bluetooth: sco: prevent information leak in sco_conn_defer_accept() Date: Mon, 20 Sep 2021 18:41:59 +0200 Message-Id: <20210920163913.996259744@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163912.603434365@linuxfoundation.org> References: <20210920163912.603434365@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 2209fd2ff2e3..cad0d2750735 100644 --- a/net/bluetooth/sco.c +++ b/net/bluetooth/sco.c @@ -763,6 +763,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