In the Linux kernel, the following vulnerability has been resolved:
Bluetooth: hcisync: fix double free in 'hcidiscoveryfilterclear()'
Function 'hcidiscoveryfilter_clear()' frees 'uuids' array and then sets it to NULL. There is a tiny chance of the following race:
'hcicmdsync_work()'
'updatepassivescan_sync()'
'hciupdatepassivescansync()'
'hci_discovery_filter_clear()'
kfree(uuids);
<-------------------------preempted-------------------------------->
'start_service_discovery()'
'hci_discovery_filter_clear()'
kfree(uuids); // DOUBLE FREE
<-------------------------preempted-------------------------------->
uuids = NULL;
To fix it let's add locking around 'kfree()' call and NULL pointer assignment. Otherwise the following backtrace fires:
[ ] ------------[ cut here ]------------ [ ] kernel BUG at mm/slub.c:547! [ ] Internal error: Oops - BUG: 00000000f2000800 [#1] PREEMPT SMP [ ] CPU: 3 UID: 0 PID: 246 Comm: bluetoothd Tainted: G O 6.12.19-kernel #1 [ ] Tainted: [O]=OOTMODULE [ ] pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ ] pc : _slabfree+0xf8/0x348 [ ] lr : _slabfree+0x48/0x348 ... [ ] Call trace: [ ] _slabfree+0xf8/0x348 [ ] kfree+0x164/0x27c [ ] startservicediscovery+0x1d0/0x2c0 [ ] hcisocksendmsg+0x518/0x924 [ ] _socksendmsg+0x54/0x60 [ ] sockwriteiter+0x98/0xf8 [ ] doiterreadvwritev+0xe4/0x1c8 [ ] vfswritev+0x128/0x2b0 [ ] dowritev+0xfc/0x118 [ ] _arm64syswritev+0x20/0x2c [ ] invokesyscall+0x68/0xf0 [ ] el0svccommon.constprop.0+0x40/0xe0 [ ] doel0svc+0x1c/0x28 [ ] el0svc+0x30/0xd0 [ ] el0t64synchandler+0x100/0x12c [ ] el0t64sync+0x194/0x198 [ ] Code: 8b0002e6 eb17031f 54fffbe1 d503201f (d4210000) [ ] ---[ end trace 0000000000000000 ]---
[
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"length": 330.0,
"function_hash": "93694130962416345025383216764141466473"
},
"id": "CVE-2025-38593-1beaf065",
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7ce9bb0b95fc280e9212b8922590c492ca1d9c39",
"target": {
"file": "include/net/bluetooth/hci_core.h",
"function": "discovery_init"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"length": 311.0,
"function_hash": "70164792624287680063049415638276779323"
},
"id": "CVE-2025-38593-22b26d28",
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f8069f34c4c976786ded97498012225af87435d7",
"target": {
"file": "include/net/bluetooth/hci_core.h",
"function": "hci_discovery_filter_clear"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"106196184799633052284294279222813282009",
"137507746770972478020690188195186599844",
"179158559111440456681652012888780488847",
"336602223601819643865623002831849560085",
"288402609372398182959244601030424920701",
"58608795197329610196392084457379958483",
"191768091193348633504240204915862493349",
"24537012180487199675578653648059385854",
"280722216817709682456536746806292995268",
"274784358418834622259812927777561548062",
"320250951743256363868294421652883230882",
"112830652216468703984929394616957276324",
"5447142688823566832274919775148279381",
"69436785049995653181822770054828975028",
"320352585155575261953255549976892908799",
"325314746301075948028628243694706660223",
"66735559967073611636258264517083827118",
"35870565053912206850240756998064753140"
]
},
"id": "CVE-2025-38593-22c0e904",
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f8069f34c4c976786ded97498012225af87435d7",
"target": {
"file": "include/net/bluetooth/hci_core.h"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"length": 330.0,
"function_hash": "93694130962416345025383216764141466473"
},
"id": "CVE-2025-38593-2b8b58db",
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f8069f34c4c976786ded97498012225af87435d7",
"target": {
"file": "include/net/bluetooth/hci_core.h",
"function": "discovery_init"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"106196184799633052284294279222813282009",
"137507746770972478020690188195186599844",
"179158559111440456681652012888780488847",
"285848529591266263571146370120229781580",
"220738285696534653455963074670993793667",
"272675202530970720126984742220271348820",
"335952264248504060594615398977400317963",
"24537012180487199675578653648059385854",
"280722216817709682456536746806292995268",
"274784358418834622259812927777561548062",
"320250951743256363868294421652883230882",
"112830652216468703984929394616957276324",
"5447142688823566832274919775148279381",
"69436785049995653181822770054828975028",
"320352585155575261953255549976892908799",
"299905444808874865277199021696659645943",
"12477221515163718796202644809127455310",
"160785475354256268166271195552878990337"
]
},
"id": "CVE-2025-38593-2e2a5c30",
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7ce9bb0b95fc280e9212b8922590c492ca1d9c39",
"target": {
"file": "include/net/bluetooth/hci_core.h"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"106196184799633052284294279222813282009",
"137507746770972478020690188195186599844",
"179158559111440456681652012888780488847",
"285848529591266263571146370120229781580",
"288402609372398182959244601030424920701",
"58608795197329610196392084457379958483",
"191768091193348633504240204915862493349",
"24537012180487199675578653648059385854",
"280722216817709682456536746806292995268",
"274784358418834622259812927777561548062",
"320250951743256363868294421652883230882",
"112830652216468703984929394616957276324",
"5447142688823566832274919775148279381",
"69436785049995653181822770054828975028",
"320352585155575261953255549976892908799",
"325314746301075948028628243694706660223",
"66735559967073611636258264517083827118",
"35870565053912206850240756998064753140"
]
},
"id": "CVE-2025-38593-2e3fbfff",
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@16852eccbdfaf41a666705e3f8be55cf2864c5ca",
"target": {
"file": "include/net/bluetooth/hci_core.h"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"106196184799633052284294279222813282009",
"137507746770972478020690188195186599844",
"179158559111440456681652012888780488847",
"285848529591266263571146370120229781580",
"288402609372398182959244601030424920701",
"58608795197329610196392084457379958483",
"191768091193348633504240204915862493349",
"24537012180487199675578653648059385854",
"280722216817709682456536746806292995268",
"274784358418834622259812927777561548062",
"320250951743256363868294421652883230882",
"112830652216468703984929394616957276324",
"5447142688823566832274919775148279381",
"69436785049995653181822770054828975028",
"320352585155575261953255549976892908799",
"325314746301075948028628243694706660223",
"66735559967073611636258264517083827118",
"35870565053912206850240756998064753140"
]
},
"id": "CVE-2025-38593-547fc355",
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a351ff6b8ecca4229afaa0d98042bead8de64799",
"target": {
"file": "include/net/bluetooth/hci_core.h"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"106196184799633052284294279222813282009",
"137507746770972478020690188195186599844",
"179158559111440456681652012888780488847",
"336602223601819643865623002831849560085",
"288402609372398182959244601030424920701",
"58608795197329610196392084457379958483",
"191768091193348633504240204915862493349",
"24537012180487199675578653648059385854",
"280722216817709682456536746806292995268",
"274784358418834622259812927777561548062",
"320250951743256363868294421652883230882",
"112830652216468703984929394616957276324",
"5447142688823566832274919775148279381",
"69436785049995653181822770054828975028",
"320352585155575261953255549976892908799",
"325314746301075948028628243694706660223",
"66735559967073611636258264517083827118",
"35870565053912206850240756998064753140"
]
},
"id": "CVE-2025-38593-5b7c2eef",
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2935e556850e9c94d7a00adf14d3cd7fe406ac03",
"target": {
"file": "include/net/bluetooth/hci_core.h"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"length": 311.0,
"function_hash": "70164792624287680063049415638276779323"
},
"id": "CVE-2025-38593-6e40d9ad",
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a351ff6b8ecca4229afaa0d98042bead8de64799",
"target": {
"file": "include/net/bluetooth/hci_core.h",
"function": "hci_discovery_filter_clear"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"length": 330.0,
"function_hash": "93694130962416345025383216764141466473"
},
"id": "CVE-2025-38593-797cc548",
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a351ff6b8ecca4229afaa0d98042bead8de64799",
"target": {
"file": "include/net/bluetooth/hci_core.h",
"function": "discovery_init"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"length": 330.0,
"function_hash": "93694130962416345025383216764141466473"
},
"id": "CVE-2025-38593-86cfa684",
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@16852eccbdfaf41a666705e3f8be55cf2864c5ca",
"target": {
"file": "include/net/bluetooth/hci_core.h",
"function": "discovery_init"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"length": 330.0,
"function_hash": "93694130962416345025383216764141466473"
},
"id": "CVE-2025-38593-89fbb225",
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2935e556850e9c94d7a00adf14d3cd7fe406ac03",
"target": {
"file": "include/net/bluetooth/hci_core.h",
"function": "discovery_init"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"length": 390.0,
"function_hash": "126138325528382203266087275140410874703"
},
"id": "CVE-2025-38593-8e6be57d",
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7ce9bb0b95fc280e9212b8922590c492ca1d9c39",
"target": {
"file": "include/net/bluetooth/hci_core.h",
"function": "hci_discovery_filter_clear"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"length": 311.0,
"function_hash": "70164792624287680063049415638276779323"
},
"id": "CVE-2025-38593-95651657",
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@16852eccbdfaf41a666705e3f8be55cf2864c5ca",
"target": {
"file": "include/net/bluetooth/hci_core.h",
"function": "hci_discovery_filter_clear"
}
},
{
"deprecated": false,
"signature_version": "v1",
"digest": {
"length": 311.0,
"function_hash": "70164792624287680063049415638276779323"
},
"id": "CVE-2025-38593-d2c6f3ac",
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2935e556850e9c94d7a00adf14d3cd7fe406ac03",
"target": {
"file": "include/net/bluetooth/hci_core.h",
"function": "hci_discovery_filter_clear"
}
}
]