<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/include/net/bluetooth, branch v6.18</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v6.18</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.18'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2025-11-20T22:01:09Z</updated>
<entry>
<title>Bluetooth: hci_core: lookup hci_conn on RX path on protocol side</title>
<updated>2025-11-20T22:01:09Z</updated>
<author>
<name>Pauli Virtanen</name>
<email>pav@iki.fi</email>
</author>
<published>2025-11-15T16:43:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=79a2d4678ba90bdba577dc3af88cc900d6dcd5ee'/>
<id>urn:sha1:79a2d4678ba90bdba577dc3af88cc900d6dcd5ee</id>
<content type='text'>
The hdev lock/lookup/unlock/use pattern in the packet RX path doesn't
ensure hci_conn* is not concurrently modified/deleted. This locking
appears to be leftover from before conn_hash started using RCU
commit bf4c63252490b ("Bluetooth: convert conn hash to RCU")
and not clear if it had purpose since then.

Currently, there are code paths that delete hci_conn* from elsewhere
than the ordered hdev-&gt;workqueue where the RX work runs in. E.g.
commit 5af1f84ed13a ("Bluetooth: hci_sync: Fix UAF on hci_abort_conn_sync")
introduced some of these, and there probably were a few others before
it.  It's better to do the locking so that even if these run
concurrently no UAF is possible.

Move the lookup of hci_conn and associated socket-specific conn to
protocol recv handlers, and do them within a single critical section
to cover hci_conn* usage and lookup.

syzkaller has reported a crash that appears to be this issue:

    [Task hdev-&gt;workqueue]          [Task 2]
                                    hci_disconnect_all_sync
    l2cap_recv_acldata(hcon)
                                      hci_conn_get(hcon)
                                      hci_abort_conn_sync(hcon)
                                        hci_dev_lock
      hci_dev_lock
                                        hci_conn_del(hcon)
      v-------------------------------- hci_dev_unlock
                                      hci_conn_put(hcon)
      conn = hcon-&gt;l2cap_data (UAF)

Fixes: 5af1f84ed13a ("Bluetooth: hci_sync: Fix UAF on hci_abort_conn_sync")
Reported-by: syzbot+d32d77220b92eddd89ad@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=d32d77220b92eddd89ad
Signed-off-by: Pauli Virtanen &lt;pav@iki.fi&gt;
Signed-off-by: Luiz Augusto von Dentz &lt;luiz.von.dentz@intel.com&gt;
</content>
</entry>
<entry>
<title>Bluetooth: btusb: mediatek: Fix kernel crash when releasing mtk iso interface</title>
<updated>2025-11-20T21:51:14Z</updated>
<author>
<name>Chris Lu</name>
<email>chris.lu@mediatek.com</email>
</author>
<published>2025-11-12T07:53:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4015b979767125cf8a2233a145a3b3af78bfd8fb'/>
<id>urn:sha1:4015b979767125cf8a2233a145a3b3af78bfd8fb</id>
<content type='text'>
When performing reset tests and encountering abnormal card drop issues
that lead to a kernel crash, it is necessary to perform a null check
before releasing resources to avoid attempting to release a null pointer.

&lt;4&gt;[   29.158070] Hardware name: Google Quigon sku196612/196613 board (DT)
&lt;4&gt;[   29.158076] Workqueue: hci0 hci_cmd_sync_work [bluetooth]
&lt;4&gt;[   29.158154] pstate: 20400009 (nzCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
&lt;4&gt;[   29.158162] pc : klist_remove+0x90/0x158
&lt;4&gt;[   29.158174] lr : klist_remove+0x88/0x158
&lt;4&gt;[   29.158180] sp : ffffffc0846b3c00
&lt;4&gt;[   29.158185] pmr_save: 000000e0
&lt;4&gt;[   29.158188] x29: ffffffc0846b3c30 x28: ffffff80cd31f880 x27: ffffff80c1bdc058
&lt;4&gt;[   29.158199] x26: dead000000000100 x25: ffffffdbdc624ea3 x24: ffffff80c1bdc4c0
&lt;4&gt;[   29.158209] x23: ffffffdbdc62a3e6 x22: ffffff80c6c07000 x21: ffffffdbdc829290
&lt;4&gt;[   29.158219] x20: 0000000000000000 x19: ffffff80cd3e0648 x18: 000000031ec97781
&lt;4&gt;[   29.158229] x17: ffffff80c1bdc4a8 x16: ffffffdc10576548 x15: ffffff80c1180428
&lt;4&gt;[   29.158238] x14: 0000000000000000 x13: 000000000000e380 x12: 0000000000000018
&lt;4&gt;[   29.158248] x11: ffffff80c2a7fd10 x10: 0000000000000000 x9 : 0000000100000000
&lt;4&gt;[   29.158257] x8 : 0000000000000000 x7 : 7f7f7f7f7f7f7f7f x6 : 2d7223ff6364626d
&lt;4&gt;[   29.158266] x5 : 0000008000000000 x4 : 0000000000000020 x3 : 2e7325006465636e
&lt;4&gt;[   29.158275] x2 : ffffffdc11afeff8 x1 : 0000000000000000 x0 : ffffffdc11be4d0c
&lt;4&gt;[   29.158285] Call trace:
&lt;4&gt;[   29.158290]  klist_remove+0x90/0x158
&lt;4&gt;[   29.158298]  device_release_driver_internal+0x20c/0x268
&lt;4&gt;[   29.158308]  device_release_driver+0x1c/0x30
&lt;4&gt;[   29.158316]  usb_driver_release_interface+0x70/0x88
&lt;4&gt;[   29.158325]  btusb_mtk_release_iso_intf+0x68/0xd8 [btusb (HASH:e8b6 5)]
&lt;4&gt;[   29.158347]  btusb_mtk_reset+0x5c/0x480 [btusb (HASH:e8b6 5)]
&lt;4&gt;[   29.158361]  hci_cmd_sync_work+0x10c/0x188 [bluetooth (HASH:a4fa 6)]
&lt;4&gt;[   29.158430]  process_scheduled_works+0x258/0x4e8
&lt;4&gt;[   29.158441]  worker_thread+0x300/0x428
&lt;4&gt;[   29.158448]  kthread+0x108/0x1d0
&lt;4&gt;[   29.158455]  ret_from_fork+0x10/0x20
&lt;0&gt;[   29.158467] Code: 91343000 940139d1 f9400268 927ff914 (f9401297)
&lt;4&gt;[   29.158474] ---[ end trace 0000000000000000 ]---
&lt;0&gt;[   29.167129] Kernel panic - not syncing: Oops: Fatal exception
&lt;2&gt;[   29.167144] SMP: stopping secondary CPUs
&lt;4&gt;[   29.167158] ------------[ cut here ]------------

Fixes: ceac1cb0259d ("Bluetooth: btusb: mediatek: add ISO data transmission functions")
Signed-off-by: Chris Lu &lt;chris.lu@mediatek.com&gt;
Signed-off-by: Luiz Augusto von Dentz &lt;luiz.von.dentz@intel.com&gt;
</content>
</entry>
<entry>
<title>Bluetooth: hci_event: Fix not handling PA Sync Lost event</title>
<updated>2025-11-11T13:55:18Z</updated>
<author>
<name>Luiz Augusto von Dentz</name>
<email>luiz.von.dentz@intel.com</email>
</author>
<published>2025-11-06T18:05:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=485e0626e58768f3c53ba61ab9e09d6b60a455f4'/>
<id>urn:sha1:485e0626e58768f3c53ba61ab9e09d6b60a455f4</id>
<content type='text'>
This handles PA Sync Lost event which previously was assumed to be
handled with BIG Sync Lost but their lifetime are not the same thus why
there are 2 different events to inform when each sync is lost.

Fixes: b2a5f2e1c127 ("Bluetooth: hci_event: Add support for handling LE BIG Sync Lost event")
Signed-off-by: Luiz Augusto von Dentz &lt;luiz.von.dentz@intel.com&gt;
</content>
</entry>
<entry>
<title>Bluetooth: MGMT: Fix OOB access in parse_adv_monitor_pattern()</title>
<updated>2025-10-31T16:43:05Z</updated>
<author>
<name>Ilia Gavrilov</name>
<email>Ilia.Gavrilov@infotecs.ru</email>
</author>
<published>2025-10-20T15:12:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8d59fba49362c65332395789fd82771f1028d87e'/>
<id>urn:sha1:8d59fba49362c65332395789fd82771f1028d87e</id>
<content type='text'>
In the parse_adv_monitor_pattern() function, the value of
the 'length' variable is currently limited to HCI_MAX_EXT_AD_LENGTH(251).
The size of the 'value' array in the mgmt_adv_pattern structure is 31.
If the value of 'pattern[i].length' is set in the user space
and exceeds 31, the 'patterns[i].value' array can be accessed
out of bound when copied.

Increasing the size of the 'value' array in
the 'mgmt_adv_pattern' structure will break the userspace.
Considering this, and to avoid OOB access revert the limits for 'offset'
and 'length' back to the value of HCI_MAX_AD_LENGTH.

Found by InfoTeCS on behalf of Linux Verification Center
(linuxtesting.org) with SVACE.

Fixes: db08722fc7d4 ("Bluetooth: hci_core: Fix missing instances using HCI_MAX_AD_LENGTH")
Cc: stable@vger.kernel.org
Signed-off-by: Ilia Gavrilov &lt;Ilia.Gavrilov@infotecs.ru&gt;
Signed-off-by: Luiz Augusto von Dentz &lt;luiz.von.dentz@intel.com&gt;
</content>
</entry>
<entry>
<title>Bluetooth: hci_core: Fix tracking of periodic advertisement</title>
<updated>2025-10-24T14:31:59Z</updated>
<author>
<name>Luiz Augusto von Dentz</name>
<email>luiz.von.dentz@intel.com</email>
</author>
<published>2025-10-22T20:03:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=751463ceefc3397566d03c8b64ef4a77f5fd88ac'/>
<id>urn:sha1:751463ceefc3397566d03c8b64ef4a77f5fd88ac</id>
<content type='text'>
Periodic advertising enabled flag cannot be tracked by the enabled
flag since advertising and periodic advertising each can be
enabled/disabled separately from one another causing the states to be
inconsistent when for example an advertising set is disabled its
enabled flag is set to false which is then used for periodic which has
not being disabled.

Fixes: eca0ae4aea66 ("Bluetooth: Add initial implementation of BIS connections")
Signed-off-by: Luiz Augusto von Dentz &lt;luiz.von.dentz@intel.com&gt;
</content>
</entry>
<entry>
<title>Revert "Bluetooth: L2CAP: convert timeouts to secs_to_jiffies()"</title>
<updated>2025-10-24T14:30:30Z</updated>
<author>
<name>Frédéric Danis</name>
<email>frederic.danis@collabora.com</email>
</author>
<published>2025-10-06T08:35:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=76e20da0bd00c556ed0a1e7250bdb6ac3e808ea8'/>
<id>urn:sha1:76e20da0bd00c556ed0a1e7250bdb6ac3e808ea8</id>
<content type='text'>
This reverts commit c9d84da18d1e0d28a7e16ca6df8e6d47570501d4. It
replaces in L2CAP calls to msecs_to_jiffies() to secs_to_jiffies()
and updates the constants accordingly. But the constants are also
used in LCAP Configure Request and L2CAP Configure Response which
expect values in milliseconds.
This may prevent correct usage of L2CAP channel.

To fix it, keep those constants in milliseconds and so revert this
change.

Fixes: c9d84da18d1e ("Bluetooth: L2CAP: convert timeouts to secs_to_jiffies()")
Signed-off-by: Frédéric Danis &lt;frederic.danis@collabora.com&gt;
Signed-off-by: Luiz Augusto von Dentz &lt;luiz.von.dentz@intel.com&gt;
</content>
</entry>
<entry>
<title>Bluetooth: MGMT: fix crash in set_mesh_sync and set_mesh_complete</title>
<updated>2025-10-24T14:21:37Z</updated>
<author>
<name>Pauli Virtanen</name>
<email>pav@iki.fi</email>
</author>
<published>2025-10-03T19:07:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e8785404de06a69d89dcdd1e9a0b6ea42dc6d327'/>
<id>urn:sha1:e8785404de06a69d89dcdd1e9a0b6ea42dc6d327</id>
<content type='text'>
There is a BUG: KASAN: stack-out-of-bounds in set_mesh_sync due to
memcpy from badly declared on-stack flexible array.

Another crash is in set_mesh_complete() due to double list_del via
mgmt_pending_valid + mgmt_pending_remove.

Use DEFINE_FLEX to declare the flexible array right, and don't memcpy
outside bounds.

As mgmt_pending_valid removes the cmd from list, use mgmt_pending_free,
and also report status on error.

Fixes: 302a1f674c00d ("Bluetooth: MGMT: Fix possible UAFs")
Signed-off-by: Pauli Virtanen &lt;pav@iki.fi&gt;
Reviewed-by: Paul Menzel &lt;pmenzel@molgen.mpg.de&gt;
Signed-off-by: Luiz Augusto von Dentz &lt;luiz.von.dentz@intel.com&gt;
</content>
</entry>
<entry>
<title>Bluetooth: HCI: Fix tracking of advertisement set/instance 0x00</title>
<updated>2025-10-24T14:21:07Z</updated>
<author>
<name>Luiz Augusto von Dentz</name>
<email>luiz.von.dentz@intel.com</email>
</author>
<published>2025-10-01T14:55:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0d92808024b4e9868cef68d16f121d509843e80e'/>
<id>urn:sha1:0d92808024b4e9868cef68d16f121d509843e80e</id>
<content type='text'>
This fixes the state tracking of advertisement set/instance 0x00 which
is considered a legacy instance and is not tracked individually by
adv_instances list, previously it was assumed that hci_dev itself would
track it via HCI_LE_ADV but that is a global state not specifc to
instance 0x00, so to fix it a new flag is introduced that only tracks the
state of instance 0x00.

Fixes: 1488af7b8b5f ("Bluetooth: hci_sync: Fix hci_resume_advertising_sync")
Signed-off-by: Luiz Augusto von Dentz &lt;luiz.von.dentz@intel.com&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Avoid a couple dozen -Wflex-array-member-not-at-end warnings</title>
<updated>2025-09-27T15:37:43Z</updated>
<author>
<name>Gustavo A. R. Silva</name>
<email>gustavoars@kernel.org</email>
</author>
<published>2025-09-09T12:13:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=be812ace0378a9db86344ad637c5ed2a5d11f216'/>
<id>urn:sha1:be812ace0378a9db86344ad637c5ed2a5d11f216</id>
<content type='text'>
-Wflex-array-member-not-at-end was introduced in GCC-14, and we are
getting ready to enable it, globally.

Use the __struct_group() helper to fix 31 instances of the following
type of warnings:

30 net/bluetooth/mgmt_config.c:16:33: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
1 net/bluetooth/mgmt_config.c:22:33: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]

Signed-off-by: Gustavo A. R. Silva &lt;gustavoars@kernel.org&gt;
Reviewed-by: Simon Horman &lt;horms@kernel.org&gt;
Signed-off-by: Luiz Augusto von Dentz &lt;luiz.von.dentz@intel.com&gt;
</content>
</entry>
<entry>
<title>Bluetooth: Add function and line information to bt_dbg</title>
<updated>2025-09-27T15:37:01Z</updated>
<author>
<name>Luiz Augusto von Dentz</name>
<email>luiz.von.dentz@intel.com</email>
</author>
<published>2025-08-18T20:43:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9eb14331885b09adfa7fe69a5a4603e24909c88f'/>
<id>urn:sha1:9eb14331885b09adfa7fe69a5a4603e24909c88f</id>
<content type='text'>
When enabling debug via CONFIG_BT_FEATURE_DEBUG include function and
line information by default otherwise it is hard to make any sense of
which function the logs comes from.

Signed-off-by: Luiz Augusto von Dentz &lt;luiz.von.dentz@intel.com&gt;
</content>
</entry>
</feed>
