From patchwork Tue Nov 14 07:05:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hector Martin X-Patchwork-Id: 164740 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp1690917vqg; Mon, 13 Nov 2023 23:06:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IGjZ98+Z7DCYgBZicw4Ys835xB++q958a3qC6hOnHuTZprxpOx/sh03GVNKlqQHpvFpmWcM X-Received: by 2002:a17:903:264a:b0:1cc:5168:688 with SMTP id je10-20020a170903264a00b001cc51680688mr1283120plb.60.1699945580092; Mon, 13 Nov 2023 23:06:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699945580; cv=none; d=google.com; s=arc-20160816; b=ZCjLcsk8NpX8l83h/9aO9dtXJGqfOLQ93UZ94iG6bEwp9Cwc1pmVECX2nuWzW914ZG Xm2IiSezzyTW4O3ZRJPdUwvIQtJm0q2NdfN+7D2fPa6kkTQPM+96fHvSmqljrBvkMayb gHZnrbVdLYHLnjM+SoVPJzA2fMW/Wn0nLVN9uqywz1QF03f3VqV24Rdp5L6ERh2b5JuQ +JfgKtD3lswhRBJzoLk0MENXfWrFnU7JPJSEcoDV5jhxbSvztmOoEswxdlG8hINH3nah 47dFP4xBkr6KMG2GTOw0AYneyGxI9RqkuiMI8j22VCpouNsErpRh2THoR2nqbW+qIqcP XXnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:message-id:content-transfer-encoding :mime-version:subject:date:from:dkim-signature; bh=ooHA65g/ekbstODtX5lpQT8hpKoMOsqYZXc/dEbNFis=; fh=VYkHS6xOYVuNwozCoVYwt7D0MVnx15Iprj2rf97+cPQ=; b=LQAzq+urkfdoQLYSQSm4cHJzPP2kkXvWUfoB0jTRcNrX290tUexR55qPwr2AvkVBJN wgiE+c6BYUgoRAHtcWAuUludnX+3VTJ7GA9MBuA+YBWhpLrxcPeZG+UNR4xetQV7EoMs wgrmwnaIK6hDSBhWMpeyKyG6jc/cVYtI62bIoj5fVTfs71TV93hjMSIqPcavKgrp0DH2 tFEQBNFKqr44UQcRczcFQ7B6Smyw/uGfLneVcyPtHXgXWjqN1YctAJvCul3BA26j31mx cFGG9c0pkvremdkhybfwf+/OFPY7xWOog5Popd6X0vk6nWMjsz+H8NMHeDtKhXDglxf0 0Esg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@marcan.st header.s=default header.b=iPgDBBrf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=marcan.st Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id ju1-20020a170903428100b001ca4ad8635esi6986068plb.240.2023.11.13.23.06.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Nov 2023 23:06:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@marcan.st header.s=default header.b=iPgDBBrf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=marcan.st Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id B4DBC808FBD4; Mon, 13 Nov 2023 23:06:15 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231486AbjKNHFS (ORCPT + 30 others); Tue, 14 Nov 2023 02:05:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229580AbjKNHFR (ORCPT ); Tue, 14 Nov 2023 02:05:17 -0500 X-Greylist: delayed 310 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Mon, 13 Nov 2023 23:05:13 PST Received: from mail.marcansoft.com (marcansoft.com [212.63.210.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6AE2513D; Mon, 13 Nov 2023 23:05:13 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sendonly@marcansoft.com) by mail.marcansoft.com (Postfix) with ESMTPSA id 6CD7542623; Tue, 14 Nov 2023 07:05:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=marcan.st; s=default; t=1699945511; bh=80m1kJxaIPINrUcVygyqLzCx1957gvMScN5A9MDipys=; h=From:Date:Subject:To:Cc; b=iPgDBBrfcNrIJJg8uajAf8QQaoufmxztBlh+2ccuXAdt55utwfM7r4TcCjjXyIxoo 2CCSEspJLP7UV8lQ3e6ceBHalOUtQ4mGq6LWqaKYDsD9/Fw42wA5YGepmhMu0g3DIH qGWY+P+wwlbGsNl7vxqRX8PGlbarBaxVZYxId81x22jrBq5pipJH7TfY7uYdO36jNR wP8M/H/aWpDkYgVK6+n+mTRxF1uTTcytVx3Lmd8cwwiOBT6pqsfB/lD4PNIxxFPLRp qMulXNK488PtGR91wYwK21O9eH3UqEKoA0BqS5QoJb6IAHefXXLGc/8mwzVYKYUdfb UHBfM9xEU3HMw== From: Hector Martin Date: Tue, 14 Nov 2023 16:05:04 +0900 Subject: [PATCH] Bluetooth: hci_bcm4377: Fix msgid release MIME-Version: 1.0 Message-Id: <20231114-bluetooth-msgid-fix-v1-1-1d15394bf342@marcan.st> X-B4-Tracking: v=1; b=H4sIAB8cU2UC/x2M0QpAMBRAf0X32S2bIX5FHozLbmHaRmr5d8vjO XVOBE+OyUOXRXB0s2d7JBB5BpMZj5WQ58QgC1kKIRTq7aJgbTC4+5VnXPhB2TZ1q6khVWlI5ek o6f/aD+/7AZ7rsRRlAAAA To: Sven Peter , Alyssa Rosenzweig , Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz Cc: Aditya Garg , Luiz Augusto von Dentz , asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Hector Martin X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1185; i=marcan@marcan.st; h=from:subject:message-id; bh=80m1kJxaIPINrUcVygyqLzCx1957gvMScN5A9MDipys=; b=owGbwMvMwCUm+yP4NEe/cRLjabUkhtRgGeU93tEGHw3nLDjvFzHlw+pwv1Pcufc5r8+Q3/768 /tdfG8PdJSyMIhxMciKKbI0nug91e05/Zy6asp0mDmsTCBDGLg4BWAi7EqMDLOlrN7ckHKZEK2i +jXquETo4qUr5Bycdbn9eq43n46e+47hf3ywobuqWN6u5ZEH8i9PZz84b/Va6Sl+fi48q2Iv3LW +xwQA X-Developer-Key: i=marcan@marcan.st; a=openpgp; fpr=FC18F00317968B7BE86201CBE22A629A4C515DD5 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 13 Nov 2023 23:06:15 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782522136752405700 X-GMAIL-MSGID: 1782522136752405700 We are releasing a single msgid, so the order argument to bitmap_release_region must be zero. In practice this was probably harmlessly masked to 0 anyway, which is why it worked, but it trips ubsan. Fixes: 8a06127602de ("Bluetooth: hci_bcm4377: Add new driver for BCM4377 PCIe boards") Reported-by: Aditya Garg Cc: stable@vger.kernel.org Signed-off-by: Hector Martin Reviewed-by: Neal Gompa --- drivers/bluetooth/hci_bcm4377.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- base-commit: ffc253263a1375a65fa6c9f62a893e9767fbebfa change-id: 20231114-bluetooth-msgid-fix-29769be7e45b Best regards, diff --git a/drivers/bluetooth/hci_bcm4377.c b/drivers/bluetooth/hci_bcm4377.c index 19ad0e788646..5e9f79235cde 100644 --- a/drivers/bluetooth/hci_bcm4377.c +++ b/drivers/bluetooth/hci_bcm4377.c @@ -715,7 +715,7 @@ static void bcm4377_handle_ack(struct bcm4377_data *bcm4377, ring->events[msgid] = NULL; } - bitmap_release_region(ring->msgids, msgid, ring->n_entries); + bitmap_release_region(ring->msgids, msgid, 0); unlock: spin_unlock_irqrestore(&ring->lock, flags);