Subject: Re: [rulkc] [PATCH v2] Bluetooth: mgmt: fix 'hdev->discovery.uuids' NULL dereference

From: [email-masked]
Date: Tue, 11 Aug 2026 20:10:21 +0000

Hello:

This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <[email-masked]>:

On Sat, 8 Aug 2026 19:31:11 +0300 you wrote:
> 'uuid_count' member of struct 'discovery_state' is assigned and read
> without any locks, so there is a chance of situation when
> uuid_count != 0, but uuids is NULL and there will be NULL pointer
> dereference.
> 
> Possible race:
> 'hci_update_passive_scan_sync'
>   'hci_discovery_filter_clear'
>     hdev->discovery.uuid_count = 0;
>       <----------------------preempted----------------------------->
>                         'start_service_discovery'
>                           // Set uuid_count to value != 0
>                           hdev->discovery.uuid_count = uuid_count;
>                           hdev->discovery.uuids = kmemdup(...);
>       <----------------------preempted----------------------------->
>     spin_lock(&hdev->discovery.lock);
>     kfree(hdev->discovery.uuids);
>     hdev->discovery.uuids = NULL;
>     spin_unlock(&hdev->discovery.lock);
> 
> [...]

Here is the summary with links:
  - [v2] Bluetooth: mgmt: fix 'hdev->discovery.uuids' NULL dereference
    https://git.kernel.org/bluetooth/bluetooth-next/c/99672791e9c9

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

_______________________________________________
rulkc mailing list
[email-masked]
http://linuxtesting.org/cgi-bin/mailman/listinfo/rulkc