* [PATCH] Bluetooth: hci_bcm4377: Fix msgid release
@ 2023-11-14 7:05 Hector Martin
2023-11-14 15:13 ` Neal Gompa
0 siblings, 1 reply; 2+ messages in thread
From: Hector Martin @ 2023-11-14 7:05 UTC (permalink / raw)
To: Sven Peter, Alyssa Rosenzweig, Marcel Holtmann, Johan Hedberg,
Luiz Augusto von Dentz
Cc: Aditya Garg, Luiz Augusto von Dentz, asahi, linux-arm-kernel,
linux-bluetooth, linux-kernel, stable, Hector Martin
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 <gargaditya08@live.com>
Cc: stable@vger.kernel.org
Signed-off-by: Hector Martin <marcan@marcan.st>
---
drivers/bluetooth/hci_bcm4377.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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);
---
base-commit: ffc253263a1375a65fa6c9f62a893e9767fbebfa
change-id: 20231114-bluetooth-msgid-fix-29769be7e45b
Best regards,
--
Hector Martin <marcan@marcan.st>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Bluetooth: hci_bcm4377: Fix msgid release
2023-11-14 7:05 [PATCH] Bluetooth: hci_bcm4377: Fix msgid release Hector Martin
@ 2023-11-14 15:13 ` Neal Gompa
0 siblings, 0 replies; 2+ messages in thread
From: Neal Gompa @ 2023-11-14 15:13 UTC (permalink / raw)
To: Hector Martin
Cc: Sven Peter, Alyssa Rosenzweig, Marcel Holtmann, Johan Hedberg,
Luiz Augusto von Dentz, Aditya Garg, Luiz Augusto von Dentz,
asahi, linux-arm-kernel, linux-bluetooth, linux-kernel, stable
On Tue, Nov 14, 2023 at 2:05 AM Hector Martin <marcan@marcan.st> wrote:
>
> 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 <gargaditya08@live.com>
> Cc: stable@vger.kernel.org
> Signed-off-by: Hector Martin <marcan@marcan.st>
> ---
> drivers/bluetooth/hci_bcm4377.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> 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);
>
> ---
> base-commit: ffc253263a1375a65fa6c9f62a893e9767fbebfa
> change-id: 20231114-bluetooth-msgid-fix-29769be7e45b
>
> Best regards,
> --
> Hector Martin <marcan@marcan.st>
>
>
LGTM.
Reviewed-by: Neal Gompa <neal@gompa.dev>
--
真実はいつも一つ!/ Always, there's only one truth!
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-11-14 15:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-14 7:05 [PATCH] Bluetooth: hci_bcm4377: Fix msgid release Hector Martin
2023-11-14 15:13 ` Neal Gompa
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).