Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp710608pxv; Thu, 15 Jul 2021 14:08:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwd8AIN9LCRFaWL92G4mtXzmtHKIbOjlpk2skyVLkI8mJ2d45tuhjawrlOfT1377gLH8Ek3 X-Received: by 2002:a17:906:3616:: with SMTP id q22mr7470585ejb.276.1626383285636; Thu, 15 Jul 2021 14:08:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626383285; cv=none; d=google.com; s=arc-20160816; b=XUDZLJMHUbgte22oQzYukgXTAmwRtieKtJpVf9YQ2ijeK+nrveuy32y+Z4qqWslcZy v6HkgX6XBD+LgZDqRRn5Mj+i1UlescIFFA54YIKh/H1yftJt1hz/Fv54Wzh6SQiy0XNl +jMzLlNRlZHD0wJOrvi/t/fuUcNYbfdhVlhQg6b45R2lJ0OilmGqB8rYiPzfSSHNg7Hl DMCvL/NONrE1nDZ7VLUF5vpkoD7IJJLO9kzvie66TUOCnaPy3mF0nktQmH7gBAsoS2aO eL53W+u/EFROVPRkR+yJ1vjR1T3IeM+itCmm+CEiAExYVfh5bBynv0o7BJ4ppqT/AcSK tZuQ== 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=gDy6+i92S2xvaaqVbyieq+fcOuPpLXQVPOo7FPoVW+o=; b=xJH1oHq1NhrfSrmk9mslq0edJK/HrlD9EuzT6Rt1sGIdl4s5iV+YkZLHkauqoVqsaT FQzwAlf4czrelDzWNXyC3pBS31WYtqr809IUBuFtP0KDd+zQ+lNW0Nbac0giH6mBqdbe XJEYZ6g552gG3SsaaF7PKHpXBGqFtzERR7LwI8gmzTQfvdlfvLOryr3EqDBcQBSNoJjP f0LyNsDePu8dT8sXgaWhZu+NCBX6Lbyxb39I2Imhv0yCcBZWs6b5AgQKwmakQx9FzhQd RK7nIFe5Y3BzGR7rYmV8w/1CWvT2A/tUs1FYEX9HqVhlBC2c7D30cfW6o3dtc1TNNkoB Li4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=z8Z6Tptg; 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 qh5si8404200ejb.72.2021.07.15.14.07.42; Thu, 15 Jul 2021 14:08:05 -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=z8Z6Tptg; 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 S244847AbhGOTSf (ORCPT + 99 others); Thu, 15 Jul 2021 15:18:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:38160 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242356AbhGOTDi (ORCPT ); Thu, 15 Jul 2021 15:03:38 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C3B3261406; Thu, 15 Jul 2021 18:59:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626375572; bh=7u9XNPOxI8rNQ621yv6IIIKnWaV8nYyvd7/1i3zXoNQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=z8Z6TptgfD1n4TE75cE/ed9Dm6qKuCF4lADvWR5j+5MHkKCMF+UveRn9wTXgO0Pyo B5hABqgY+++m4I8f4DLOJVEAtxZRuw9IvrM8oYg5F3wGV+HAUh52Kk9cHnFn+hz8xW kEqtWOCXQ7lD3hIq2PKnVojKG/p1lFgYHHlBotuE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tedd Ho-Jeong An , Marcel Holtmann , Sasha Levin Subject: [PATCH 5.12 143/242] Bluetooth: mgmt: Fix the command returns garbage parameter value Date: Thu, 15 Jul 2021 20:38:25 +0200 Message-Id: <20210715182618.306931062@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182551.731989182@linuxfoundation.org> References: <20210715182551.731989182@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: Tedd Ho-Jeong An [ Upstream commit 02ce2c2c24024aade65a8d91d6a596651eaf2d0a ] When the Get Device Flags command fails, it returns the error status with the parameters filled with the garbage values. Although the parameters are not used, it is better to fill with zero than the random values. Signed-off-by: Tedd Ho-Jeong An Signed-off-by: Marcel Holtmann Signed-off-by: Sasha Levin --- net/bluetooth/mgmt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 06e24b5e164d..b4f6773b1a5b 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -4056,6 +4056,8 @@ static int get_device_flags(struct sock *sk, struct hci_dev *hdev, void *data, hci_dev_lock(hdev); + memset(&rp, 0, sizeof(rp)); + if (cp->addr.type == BDADDR_BREDR) { br_params = hci_bdaddr_list_lookup_with_flags(&hdev->whitelist, &cp->addr.bdaddr, -- 2.30.2