From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2DC8A8BEB for ; Tue, 28 Mar 2023 14:50:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9BBDCC433EF; Tue, 28 Mar 2023 14:50:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1680015016; bh=UQFD8R+r7pyyQLu/jbUUZOAgGbz+gYUu6CMUJSSLKCE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XXzo7LciFgXusNnn8TNfl7aoCRpQcxG2O6YU2C+xZ5MZ8SjCcpajZvEhS6+2UFi7s W9nzdHNVr/VXJ7+yxw84h8MWq9E8gk6GlxoRkNgx2qLoU18YkBCtlSJOpclFd0DJTA UVsbROJ/RYsh0k7rgzvUltJvlgo+DsHfhzh/vA7Q= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Archie Pusaka , Howard Chung , Luiz Augusto von Dentz , Sasha Levin Subject: [PATCH 6.2 105/240] Bluetooth: mgmt: Fix MGMT add advmon with RSSI command Date: Tue, 28 Mar 2023 16:41:08 +0200 Message-Id: <20230328142624.148883345@linuxfoundation.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230328142619.643313678@linuxfoundation.org> References: <20230328142619.643313678@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Howard Chung [ Upstream commit 1a0291f81529e8044fb29845a0196ba47af894ce ] The MGMT command: MGMT_OP_ADD_ADV_PATTERNS_MONITOR_RSSI uses variable length argument. This causes host not able to register advmon with rssi. This patch has been locally tested by adding monitor with rssi via btmgmt on a kernel 6.1 machine. Reviewed-by: Archie Pusaka Fixes: b338d91703fa ("Bluetooth: Implement support for Mesh") Signed-off-by: Howard Chung Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin --- net/bluetooth/mgmt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 71b65ac6343a0..c4a7627b380da 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -9345,7 +9345,8 @@ static const struct hci_mgmt_handler mgmt_handlers[] = { { add_ext_adv_data, MGMT_ADD_EXT_ADV_DATA_SIZE, HCI_MGMT_VAR_LEN }, { add_adv_patterns_monitor_rssi, - MGMT_ADD_ADV_PATTERNS_MONITOR_RSSI_SIZE }, + MGMT_ADD_ADV_PATTERNS_MONITOR_RSSI_SIZE, + HCI_MGMT_VAR_LEN }, { set_mesh, MGMT_SET_MESH_RECEIVER_SIZE, HCI_MGMT_VAR_LEN }, { mesh_features, MGMT_MESH_READ_FEATURES_SIZE }, -- 2.39.2