Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4873588pxj; Tue, 25 May 2021 19:39:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymEN8XL9u0uYGQ6bv+0LuASvd+mhF92HRp8au8lW4Br8B0p65HmZhlh8kH1CXnsTFDHfk2 X-Received: by 2002:a17:907:c1c:: with SMTP id ga28mr32549505ejc.320.1621996788998; Tue, 25 May 2021 19:39:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621996788; cv=none; d=google.com; s=arc-20160816; b=qWGIblRichlXdsE1mkMjUjNgEdHXayq8eqtr+/W18zf8EKcw9E+rBCIw68WhTSzmqb 5ADut8YKyHoqI7jdIdAM32T7MRGCOYK9fGoOQz4nhzpp/0sEvV38rBi+XsKgCOVfYYK6 IH7+Qgq7mB+YWZp9NKF/MwttNoGLsbRxrM/HwD3R5Rk7VjS2EEggPglizHifaabGGR9M gTZzbrJqpIwE4nWtt+FP/5BJyhCHJdveCYIYVHG3Pc6uBKTSAhtpvZ1bV3++n5ySNubV 3ONZa7D8i2lGAgfWyFrQuw6GBTimEme4dHJ3mp/P+GhMlgTp+2/k+NLCgFTUSAvSqTbS XoFA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=euYDffDVdPB8dCWXzN8m02siNpTk3Tq5U77xttu5VWo=; b=EQxxRdq43/2xC9FPaBYSzmA3Rs3Hcy7Obupwexhl52h6s56+Nbe2E7v1CYS78Q/hd/ imWjSNmTZ/9LEooZVRFJrUfgKP0jGOiSXYwIFOWULj65eBVlTRb3QiMAYOrrH5QDNA6K /dObG52dGTb4GkPr8oxeaZRQ7xRWgKSJAF7Mq+h2GtCfsiozwn9beTV4QFXKXGySJ90g 0q2L/qDzGMkY6fnRD1L9yRdj0+uhTZz3WVSz1Eg0ajLZSJWSK+e563AGonOAo2PzSpNN SpTBaEh6oIVc0ODpF8852tM9PAR3S7vn2ZGRlFC4xdqT0XzR0ZAkF/Ra/zKKQS1Vez+e A3pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=igEQtdHj; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w17si17575007edq.159.2021.05.25.19.39.26; Tue, 25 May 2021 19:39:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-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=@gmail.com header.s=20161025 header.b=igEQtdHj; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230366AbhEZAaO (ORCPT + 99 others); Tue, 25 May 2021 20:30:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232290AbhEZAaN (ORCPT ); Tue, 25 May 2021 20:30:13 -0400 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12096C061574 for ; Tue, 25 May 2021 17:28:41 -0700 (PDT) Received: by mail-pl1-x633.google.com with SMTP id a7so8547802plh.3 for ; Tue, 25 May 2021 17:28:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=euYDffDVdPB8dCWXzN8m02siNpTk3Tq5U77xttu5VWo=; b=igEQtdHjq2x68jL52jr58nvxbjzFhqLMNft8FrxcSFrlm8qUXDNTcfxIq1OsiIwEzu 8U7S7OXsJv4iM8CdnWtJCDTKMoFv2UJDgn+MC9jCbMwoZ7/wulHWBJXndIGOxtjFdXdj Ex0UAfKQDoplXZFg7BdaVHJfVhWIaKfyW9qlWJUMmk7cPwqEtkByZtEbkUtEYpkX/Evi 5rfKpQk7hdJIZO4L+/Ibh3vHhBNEBHZT9dt5tAISh1i82kKTg1fvvrXtaCteoHSqArow fPYxrGJQuRtbaXeOxaGqTrjEzGIh9+Ks0Rs63zNvbIu4b3J/wnUo8FxKbrsxoHLZEsGK S4Gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=euYDffDVdPB8dCWXzN8m02siNpTk3Tq5U77xttu5VWo=; b=DX/9oZR6ZywlUjfXP8VhNNi3vFhFDuXwRqcZUHETn/RxHM1lBorCw7//ezDU4Jt4Ct jdbvRJbXXTF4yuAzywYoOKfxVtBf+BUwF7u0Icdtvp8hgWfq/dlXc3507L6p2m77TMmT I8sw22l84yphPWtgesV5DIk2OlyFc0ECzI5BwVPTxxbeXGBTvxeNcq3DBQVcSZJ1wzMM 0fFKfi8d8lFjKAh+LAnlKtWQok9lBdmmBSDv/4SX1lI2/LNrxzu/rW1MbCQntVv9rOtk BCPJOm66tRBnBje9JjwJpiKzqSuixhqkA0W65LKhuqsGR2ZusGJgSkL/4ZqWoiSDIn/6 KWYw== X-Gm-Message-State: AOAM530hQBeyKXx0AM7i0Vi6orX19wstYWgN+nD/p7shpvdYRr+U7MHw P3w9lVToMcVQ2HmnhttEQ+OmItjZZ4fAKQ== X-Received: by 2002:a17:90a:8b12:: with SMTP id y18mr32322546pjn.153.1621988920268; Tue, 25 May 2021 17:28:40 -0700 (PDT) Received: from han1-mobl3.hsd1.or.comcast.net ([2601:1c0:6a01:d830::e853]) by smtp.gmail.com with ESMTPSA id n1sm1845486pjv.40.2021.05.25.17.28.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 May 2021 17:28:39 -0700 (PDT) From: Tedd Ho-Jeong An To: linux-bluetooth@vger.kernel.org Cc: Tedd Ho-Jeong An Subject: [PATCH] Bluetooth: Fix get device flags command returns garbage parameter Date: Tue, 25 May 2021 17:28:16 -0700 Message-Id: <20210526002816.413660-1-hj.tedd.an@gmail.com> X-Mailer: git-send-email 2.26.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Tedd Ho-Jeong An This patch memset the response parameter so it doesn't return the garbage value when the Get Device Flags command fails. Signed-off-by: Tedd Ho-Jeong An --- net/bluetooth/mgmt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index b44e19c69c44..91d36c3bf23e 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -4061,6 +4061,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.26.3