Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp631827pxv; Thu, 15 Jul 2021 12:01:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTZgt0HIy3A3ZeUvi+SF7LkCIiL4JmWFeRinUbyGdl2GVczlI3UzhlU4sPZ+wwek5mYuBL X-Received: by 2002:a17:907:2125:: with SMTP id qo5mr7137631ejb.252.1626375680576; Thu, 15 Jul 2021 12:01:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626375680; cv=none; d=google.com; s=arc-20160816; b=ZM8w418u52oNKVTeLCSNtujTiOYN4xIoq5M4xjP3RV9zSQgfzDA3Na4JHjCHzdIFzh NwhQcmQjhvdZCnalM10Ky5IoKXGFPHkvbnfqrCYQL7WeLHnajNZUzQUXU6xRWwu/17BH ia9zzOC/pMyKaADpRkUckuxXHFoAS8MR41SYIu2vaE04GPPrboQu76wTHufCKEGBTvm1 bQfF5hpWRA7vgaPj5mER2s+kkct+4CxuQqNPMtFb8PXk1dY00bJb/sryE8j97s9YXfyO H0eEwjccvT8Zyr236V4aN4H88I5iTGGIJWUFv0Mor9JVTObN0hwJgf9gD9nmumZGqfx+ HlHQ== 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=8QfRaa9t7OD7DalJlTHBfdBxu0Ha07JUg4SikqmLf9E=; b=vSzu0bmi52M24dnnJ6b9AawKQopgbUJIIWe10cYIm5mNtaFvhpJUMioF7E+97T4uaN fvuKoU6DTEPvvuf4RI2qtsiuwDQkDkmDqd89Xt8d9lJHN/Vkgo+CPrRRhxZbVcJbRt84 49j+VBx36WksbwSZMgS9K2Rn/gawMDs8YBPMxB/D7nnH6ubSJctPWgJu76uD3ZZPQnj8 7oC646gHi6KdMhr+VooKHcqAJY1XUjj/JeQwVivJdFcDGjelYHpBAOp00MFHSfdcmCo3 7qplMMnePd/HiYaZTVeDiVGJi6kB8JdKk8LGNmu/p/NNFvbKudSJt5wYEdaovESbccnT uoTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lj0Uu0Fh; 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 oz13si4286858ejc.690.2021.07.15.12.00.56; Thu, 15 Jul 2021 12:01:20 -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=lj0Uu0Fh; 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 S242841AbhGOTAC (ORCPT + 99 others); Thu, 15 Jul 2021 15:00:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:57294 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240298AbhGOSxM (ORCPT ); Thu, 15 Jul 2021 14:53:12 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 70C6F613E4; Thu, 15 Jul 2021 18:50:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626375017; bh=u0mrxMtT0pAjepPKhzlaRe7yawDwWHyahoAGghvsErs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lj0Uu0FhpFnT+cRPxZJupZJ4jnEnB29V9dtC7P+ICgrstG7gMQCI/iO6gdWfDaBH0 DyGLYEdp3lZsSZv6yp+5voT+jKtS2o/wThgc5rYndRiy1tSKj447ebDEXzakbM8Zzz fmWClvCJ668Isx3cyz/Pd3SVckGBWQBcGTfIvtfI= 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.10 124/215] Bluetooth: mgmt: Fix the command returns garbage parameter value Date: Thu, 15 Jul 2021 20:38:16 +0200 Message-Id: <20210715182621.397724261@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182558.381078833@linuxfoundation.org> References: <20210715182558.381078833@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 7dfb96946220..31a585fe0c7c 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -4038,6 +4038,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