{"api_version":"1","generated_at":"2026-11-30T18:22:12+00:00","cve":"CVE-2026-139379","urls":{"html":"https://cve.report/CVE-2026-139379","api":"https://cve.report/api/cve/CVE-2026-139379.json","docs":"https://cve.report/api","cve_org":"https://www.cve.org/CVERecord?id=CVE-2026-139379","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-139379"},"summary":{"title":"Bluetooth: hci_core: Keep RCU protection through LTK filtering","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nBluetooth: hci_core: Keep RCU protection through LTK filtering\n\nThe LTK selected by hci_find_ltk() must remain allocated while its\nvalue is checked against the blocked-key list. The finder releases RCU\nbefore passing k->val to hci_is_blocked_key(). The helper's own RCU\nsection protects the blocked-key list, but the selected LTK may already\nhave been reclaimed before that section starts.\n\nAn LE ATT socket security request can reach smp_ltk_encrypt() without\nholding hdev->lock. With a matching stored LTK and an LTK-type\nblocked-key entry present, a concurrent MGMT_OP_LOAD_LONG_TERM_KEYS can\nremove the selected LTK in the following order:\n\n  Socket security                 Management / RCU reclamation\n  hci_find_ltk()\n    rcu_read_lock()\n    select k\n    rcu_read_unlock()\n                                  load_long_term_keys()\n                                    hci_dev_lock(hdev)\n                                    hci_smp_ltks_clear(hdev)\n                                      list_del_rcu(&k->list)\n                                      kfree_rcu(k, rcu)\n                                  grace period ends; k is freed\n    hci_is_blocked_key(..., k->val)\n      memcmp(b->val, val, ...)\n\nThe final comparison reads freed LTK bytes. Entering a new RCU section\nin hci_is_blocked_key() cannot protect a pointer obtained before the\ncompleted grace period.\n\nKeep the finder's RCU read-side section active through the blocked-key\ncomparison and the warning that reads k->bdaddr. Release it before\nreturning on either matched-key path. This delays reclamation until the\nfinder has finished using the selected record, following the existing\nIRK lookup pattern.\n\nKFENCE report as below:\n\n    ==================================================================\n    BUG: KFENCE: use-after-free read in hci_is_blocked_key+0xdf/0x240\n\n    Use-after-free read at 0x00000000b9ee38e4 (in kfence-#249):\n     hci_is_blocked_key+0xdf/0x240\n     blocked_key_wrapper+0xc5/0x140 [pmbd_ltk_probe]\n     hci_find_ltk+0x1aa/0x3e0\n     smp_ltk_encrypt.isra.0+0xad/0x340\n     smp_conn_security+0x3b8/0x8c0\n     l2cap_sock_setsockopt+0x1c4b/0x2270\n     do_sock_setsockopt+0x1fb/0x430\n     __sys_setsockopt+0x106/0x180\n     __x64_sys_setsockopt+0xc2/0x160\n     do_syscall_64+0x115/0x6a0\n     entry_SYSCALL_64_after_hwframe+0x77/0x7f\n\n    kfence-#249: 0x00000000121f2ad9-0x000000005b5bfb3d, size=72, cache=kmalloc-96\n\n    allocated by task 495 on cpu 0 at 36.722380s (2.603973s ago):\n     hci_add_ltk+0x1f5/0x3a0\n     load_long_term_keys+0x6d0/0x860\n     hci_sock_sendmsg+0x128b/0x22e0\n     __sys_sendto+0x425/0x470\n     __x64_sys_sendto+0xe5/0x1c0\n     do_syscall_64+0x115/0x6a0\n     entry_SYSCALL_64_after_hwframe+0x77/0x7f\n\n    freed by task 533 on cpu 0 at 36.993097s (2.339769s ago):\n     __rcu_free_sheaf_prepare+0x261/0x2a0\n     rcu_free_sheaf+0x1f/0xe0\n     rcu_core+0x661/0x1d10\n     handle_softirqs+0x201/0x930\n     __irq_exit_rcu+0x110/0x1e0\n     irq_exit_rcu+0xe/0x20\n     sysvec_apic_timer_interrupt+0x6c/0x80\n     asm_sysvec_apic_timer_interrupt+0x1a/0x20\n     srso_alias_return_thunk+0x0/0xfbef5\n     __asan_memcpy+0x23/0x60\n     create_monitor_ctrl_event+0x1a2/0x460\n     mgmt_cmd_complete+0x2da/0x580\n     load_long_term_keys+0x741/0x860\n     hci_sock_sendmsg+0x128b/0x22e0\n     __sys_sendto+0x425/0x470\n     __x64_sys_sendto+0xe5/0x1c0\n     do_syscall_64+0x115/0x6a0\n     entry_SYSCALL_64_after_hwframe+0x77/0x7f\n\n    CPU: 1 UID: 0 PID: 495 Comm: python3 Tainted: G           O        7.2.0-rc6-pmb-bt-functional-v1+ #1 PREEMPT(lazy)\n    Tainted: [O]=OOT_MODULE\n    Hardware name: QEMU Ubuntu 24.04 PC v2 (i440FX + PIIX, arch_caps fix, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014\n    ==================================================================","state":"PUBLISHED","assigner":"Linux","published_at":"2026-11-30 14:19:05","updated_at":"2026-11-30 14:19:05"},"problem_types":[],"metrics":[],"references":[{"url":"https://git.kernel.org/stable/c/5d136e6db3c671a205594945981a916ca7062ae9","name":"https://git.kernel.org/stable/c/5d136e6db3c671a205594945981a916ca7062ae9","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/817cbcab91fe870e5b69c835cbd708242c9f8c8e","name":"https://git.kernel.org/stable/c/817cbcab91fe870e5b69c835cbd708242c9f8c8e","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/d68a59469c5aca486c0c4588c3da02e5a89a655c","name":"https://git.kernel.org/stable/c/d68a59469c5aca486c0c4588c3da02e5a89a655c","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/221fa7cb8df8a8352d342879986d43f9fb51feba","name":"https://git.kernel.org/stable/c/221fa7cb8df8a8352d342879986d43f9fb51feba","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/1ddd195e76a110c7e5a15dc353430a94537a370b","name":"https://git.kernel.org/stable/c/1ddd195e76a110c7e5a15dc353430a94537a370b","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/c012398a21b54a7c06b4ed388b7abb95c3c90c1b","name":"https://git.kernel.org/stable/c/c012398a21b54a7c06b4ed388b7abb95c3c90c1b","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/6f83c171cfbd182a1e898adbd5cd8cb632d11f15","name":"https://git.kernel.org/stable/c/6f83c171cfbd182a1e898adbd5cd8cb632d11f15","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/06901a982fa1160b05ca38b5c12c25c5531fb84c","name":"https://git.kernel.org/stable/c/06901a982fa1160b05ca38b5c12c25c5531fb84c","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-139379","name":"CVE Program record","refsource":"CVE.ORG","tags":["canonical"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-139379","name":"NVD vulnerability detail","refsource":"NVD","tags":["canonical","analysis"]}],"affected":[{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 600a87490ff9823d065fc15e86c709e707033ecc c012398a21b54a7c06b4ed388b7abb95c3c90c1b git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 600a87490ff9823d065fc15e86c709e707033ecc 1ddd195e76a110c7e5a15dc353430a94537a370b git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 600a87490ff9823d065fc15e86c709e707033ecc d68a59469c5aca486c0c4588c3da02e5a89a655c git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 600a87490ff9823d065fc15e86c709e707033ecc 06901a982fa1160b05ca38b5c12c25c5531fb84c git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 600a87490ff9823d065fc15e86c709e707033ecc 6f83c171cfbd182a1e898adbd5cd8cb632d11f15 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 600a87490ff9823d065fc15e86c709e707033ecc 5d136e6db3c671a205594945981a916ca7062ae9 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 600a87490ff9823d065fc15e86c709e707033ecc 221fa7cb8df8a8352d342879986d43f9fb51feba git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 600a87490ff9823d065fc15e86c709e707033ecc 817cbcab91fe870e5b69c835cbd708242c9f8c8e git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 5.6","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 5.6 semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 5.10.275 5.10.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 5.15.226 5.15.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.1.193 6.1.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.6.163 6.6.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.12.119 6.12.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.18.65 6.18.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.3.6 7.3.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.4-rc1 * original_commit_for_fix","platforms":[]}],"timeline":[],"solutions":[],"workarounds":[],"exploits":[],"credits":[],"nvd_cpes":[],"vendor_comments":[],"enrichments":{"kev":null,"epss":null,"legacy_qids":[]},"source_records":{"cve_program":{"containers":{"cna":{"affected":[{"defaultStatus":"unaffected","product":"Linux","programFiles":["net/bluetooth/hci_core.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"lessThan":"c012398a21b54a7c06b4ed388b7abb95c3c90c1b","status":"affected","version":"600a87490ff9823d065fc15e86c709e707033ecc","versionType":"git"},{"lessThan":"1ddd195e76a110c7e5a15dc353430a94537a370b","status":"affected","version":"600a87490ff9823d065fc15e86c709e707033ecc","versionType":"git"},{"lessThan":"d68a59469c5aca486c0c4588c3da02e5a89a655c","status":"affected","version":"600a87490ff9823d065fc15e86c709e707033ecc","versionType":"git"},{"lessThan":"06901a982fa1160b05ca38b5c12c25c5531fb84c","status":"affected","version":"600a87490ff9823d065fc15e86c709e707033ecc","versionType":"git"},{"lessThan":"6f83c171cfbd182a1e898adbd5cd8cb632d11f15","status":"affected","version":"600a87490ff9823d065fc15e86c709e707033ecc","versionType":"git"},{"lessThan":"5d136e6db3c671a205594945981a916ca7062ae9","status":"affected","version":"600a87490ff9823d065fc15e86c709e707033ecc","versionType":"git"},{"lessThan":"221fa7cb8df8a8352d342879986d43f9fb51feba","status":"affected","version":"600a87490ff9823d065fc15e86c709e707033ecc","versionType":"git"},{"lessThan":"817cbcab91fe870e5b69c835cbd708242c9f8c8e","status":"affected","version":"600a87490ff9823d065fc15e86c709e707033ecc","versionType":"git"}]},{"defaultStatus":"affected","product":"Linux","programFiles":["net/bluetooth/hci_core.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"status":"affected","version":"5.6"},{"lessThan":"5.6","status":"unaffected","version":"0","versionType":"semver"},{"lessThanOrEqual":"5.10.*","status":"unaffected","version":"5.10.275","versionType":"semver"},{"lessThanOrEqual":"5.15.*","status":"unaffected","version":"5.15.226","versionType":"semver"},{"lessThanOrEqual":"6.1.*","status":"unaffected","version":"6.1.193","versionType":"semver"},{"lessThanOrEqual":"6.6.*","status":"unaffected","version":"6.6.163","versionType":"semver"},{"lessThanOrEqual":"6.12.*","status":"unaffected","version":"6.12.119","versionType":"semver"},{"lessThanOrEqual":"6.18.*","status":"unaffected","version":"6.18.65","versionType":"semver"},{"lessThanOrEqual":"7.3.*","status":"unaffected","version":"7.3.6","versionType":"semver"},{"lessThanOrEqual":"*","status":"unaffected","version":"7.4-rc1","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"5.10.275","versionStartIncluding":"5.6","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"5.15.226","versionStartIncluding":"5.6","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.1.193","versionStartIncluding":"5.6","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.6.163","versionStartIncluding":"5.6","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.12.119","versionStartIncluding":"5.6","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.18.65","versionStartIncluding":"5.6","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.3.6","versionStartIncluding":"5.6","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.4-rc1","versionStartIncluding":"5.6","vulnerable":true}],"negate":false,"operator":"OR"}]}],"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nBluetooth: hci_core: Keep RCU protection through LTK filtering\n\nThe LTK selected by hci_find_ltk() must remain allocated while its\nvalue is checked against the blocked-key list. The finder releases RCU\nbefore passing k->val to hci_is_blocked_key(). The helper's own RCU\nsection protects the blocked-key list, but the selected LTK may already\nhave been reclaimed before that section starts.\n\nAn LE ATT socket security request can reach smp_ltk_encrypt() without\nholding hdev->lock. With a matching stored LTK and an LTK-type\nblocked-key entry present, a concurrent MGMT_OP_LOAD_LONG_TERM_KEYS can\nremove the selected LTK in the following order:\n\n  Socket security                 Management / RCU reclamation\n  hci_find_ltk()\n    rcu_read_lock()\n    select k\n    rcu_read_unlock()\n                                  load_long_term_keys()\n                                    hci_dev_lock(hdev)\n                                    hci_smp_ltks_clear(hdev)\n                                      list_del_rcu(&k->list)\n                                      kfree_rcu(k, rcu)\n                                  grace period ends; k is freed\n    hci_is_blocked_key(..., k->val)\n      memcmp(b->val, val, ...)\n\nThe final comparison reads freed LTK bytes. Entering a new RCU section\nin hci_is_blocked_key() cannot protect a pointer obtained before the\ncompleted grace period.\n\nKeep the finder's RCU read-side section active through the blocked-key\ncomparison and the warning that reads k->bdaddr. Release it before\nreturning on either matched-key path. This delays reclamation until the\nfinder has finished using the selected record, following the existing\nIRK lookup pattern.\n\nKFENCE report as below:\n\n    ==================================================================\n    BUG: KFENCE: use-after-free read in hci_is_blocked_key+0xdf/0x240\n\n    Use-after-free read at 0x00000000b9ee38e4 (in kfence-#249):\n     hci_is_blocked_key+0xdf/0x240\n     blocked_key_wrapper+0xc5/0x140 [pmbd_ltk_probe]\n     hci_find_ltk+0x1aa/0x3e0\n     smp_ltk_encrypt.isra.0+0xad/0x340\n     smp_conn_security+0x3b8/0x8c0\n     l2cap_sock_setsockopt+0x1c4b/0x2270\n     do_sock_setsockopt+0x1fb/0x430\n     __sys_setsockopt+0x106/0x180\n     __x64_sys_setsockopt+0xc2/0x160\n     do_syscall_64+0x115/0x6a0\n     entry_SYSCALL_64_after_hwframe+0x77/0x7f\n\n    kfence-#249: 0x00000000121f2ad9-0x000000005b5bfb3d, size=72, cache=kmalloc-96\n\n    allocated by task 495 on cpu 0 at 36.722380s (2.603973s ago):\n     hci_add_ltk+0x1f5/0x3a0\n     load_long_term_keys+0x6d0/0x860\n     hci_sock_sendmsg+0x128b/0x22e0\n     __sys_sendto+0x425/0x470\n     __x64_sys_sendto+0xe5/0x1c0\n     do_syscall_64+0x115/0x6a0\n     entry_SYSCALL_64_after_hwframe+0x77/0x7f\n\n    freed by task 533 on cpu 0 at 36.993097s (2.339769s ago):\n     __rcu_free_sheaf_prepare+0x261/0x2a0\n     rcu_free_sheaf+0x1f/0xe0\n     rcu_core+0x661/0x1d10\n     handle_softirqs+0x201/0x930\n     __irq_exit_rcu+0x110/0x1e0\n     irq_exit_rcu+0xe/0x20\n     sysvec_apic_timer_interrupt+0x6c/0x80\n     asm_sysvec_apic_timer_interrupt+0x1a/0x20\n     srso_alias_return_thunk+0x0/0xfbef5\n     __asan_memcpy+0x23/0x60\n     create_monitor_ctrl_event+0x1a2/0x460\n     mgmt_cmd_complete+0x2da/0x580\n     load_long_term_keys+0x741/0x860\n     hci_sock_sendmsg+0x128b/0x22e0\n     __sys_sendto+0x425/0x470\n     __x64_sys_sendto+0xe5/0x1c0\n     do_syscall_64+0x115/0x6a0\n     entry_SYSCALL_64_after_hwframe+0x77/0x7f\n\n    CPU: 1 UID: 0 PID: 495 Comm: python3 Tainted: G           O        7.2.0-rc6-pmb-bt-functional-v1+ #1 PREEMPT(lazy)\n    Tainted: [O]=OOT_MODULE\n    Hardware name: QEMU Ubuntu 24.04 PC v2 (i440FX + PIIX, arch_caps fix, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014\n    =================================================================="}],"providerMetadata":{"dateUpdated":"2026-11-30T13:34:12.748Z","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux"},"references":[{"url":"https://git.kernel.org/stable/c/c012398a21b54a7c06b4ed388b7abb95c3c90c1b"},{"url":"https://git.kernel.org/stable/c/1ddd195e76a110c7e5a15dc353430a94537a370b"},{"url":"https://git.kernel.org/stable/c/d68a59469c5aca486c0c4588c3da02e5a89a655c"},{"url":"https://git.kernel.org/stable/c/06901a982fa1160b05ca38b5c12c25c5531fb84c"},{"url":"https://git.kernel.org/stable/c/6f83c171cfbd182a1e898adbd5cd8cb632d11f15"},{"url":"https://git.kernel.org/stable/c/5d136e6db3c671a205594945981a916ca7062ae9"},{"url":"https://git.kernel.org/stable/c/221fa7cb8df8a8352d342879986d43f9fb51feba"},{"url":"https://git.kernel.org/stable/c/817cbcab91fe870e5b69c835cbd708242c9f8c8e"}],"title":"Bluetooth: hci_core: Keep RCU protection through LTK filtering","x_generator":{"engine":"bippy-1.2.0"}}},"cveMetadata":{"assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","assignerShortName":"Linux","cveId":"CVE-2026-139379","datePublished":"2026-11-30T13:34:12.748Z","dateReserved":"2026-11-30T13:22:15.930Z","dateUpdated":"2026-11-30T13:34:12.748Z","state":"PUBLISHED"},"dataType":"CVE_RECORD","dataVersion":"5.2"},"nvd":{"publishedDate":"2026-11-30 14:19:05","lastModifiedDate":"2026-11-30 14:19:05","problem_types":[],"metrics":[],"configurations":[]},"legacy_mitre":{"record":{"CveYear":"2026","CveId":"139379","Ordinal":"1","Title":"Bluetooth: hci_core: Keep RCU protection through LTK filtering","CVE":"CVE-2026-139379","Year":"2026"},"notes":[{"CveYear":"2026","CveId":"139379","Ordinal":"1","NoteData":"In the Linux kernel, the following vulnerability has been resolved:\n\nBluetooth: hci_core: Keep RCU protection through LTK filtering\n\nThe LTK selected by hci_find_ltk() must remain allocated while its\nvalue is checked against the blocked-key list. The finder releases RCU\nbefore passing k->val to hci_is_blocked_key(). The helper's own RCU\nsection protects the blocked-key list, but the selected LTK may already\nhave been reclaimed before that section starts.\n\nAn LE ATT socket security request can reach smp_ltk_encrypt() without\nholding hdev->lock. With a matching stored LTK and an LTK-type\nblocked-key entry present, a concurrent MGMT_OP_LOAD_LONG_TERM_KEYS can\nremove the selected LTK in the following order:\n\n  Socket security                 Management / RCU reclamation\n  hci_find_ltk()\n    rcu_read_lock()\n    select k\n    rcu_read_unlock()\n                                  load_long_term_keys()\n                                    hci_dev_lock(hdev)\n                                    hci_smp_ltks_clear(hdev)\n                                      list_del_rcu(&k->list)\n                                      kfree_rcu(k, rcu)\n                                  grace period ends; k is freed\n    hci_is_blocked_key(..., k->val)\n      memcmp(b->val, val, ...)\n\nThe final comparison reads freed LTK bytes. Entering a new RCU section\nin hci_is_blocked_key() cannot protect a pointer obtained before the\ncompleted grace period.\n\nKeep the finder's RCU read-side section active through the blocked-key\ncomparison and the warning that reads k->bdaddr. Release it before\nreturning on either matched-key path. This delays reclamation until the\nfinder has finished using the selected record, following the existing\nIRK lookup pattern.\n\nKFENCE report as below:\n\n    ==================================================================\n    BUG: KFENCE: use-after-free read in hci_is_blocked_key+0xdf/0x240\n\n    Use-after-free read at 0x00000000b9ee38e4 (in kfence-#249):\n     hci_is_blocked_key+0xdf/0x240\n     blocked_key_wrapper+0xc5/0x140 [pmbd_ltk_probe]\n     hci_find_ltk+0x1aa/0x3e0\n     smp_ltk_encrypt.isra.0+0xad/0x340\n     smp_conn_security+0x3b8/0x8c0\n     l2cap_sock_setsockopt+0x1c4b/0x2270\n     do_sock_setsockopt+0x1fb/0x430\n     __sys_setsockopt+0x106/0x180\n     __x64_sys_setsockopt+0xc2/0x160\n     do_syscall_64+0x115/0x6a0\n     entry_SYSCALL_64_after_hwframe+0x77/0x7f\n\n    kfence-#249: 0x00000000121f2ad9-0x000000005b5bfb3d, size=72, cache=kmalloc-96\n\n    allocated by task 495 on cpu 0 at 36.722380s (2.603973s ago):\n     hci_add_ltk+0x1f5/0x3a0\n     load_long_term_keys+0x6d0/0x860\n     hci_sock_sendmsg+0x128b/0x22e0\n     __sys_sendto+0x425/0x470\n     __x64_sys_sendto+0xe5/0x1c0\n     do_syscall_64+0x115/0x6a0\n     entry_SYSCALL_64_after_hwframe+0x77/0x7f\n\n    freed by task 533 on cpu 0 at 36.993097s (2.339769s ago):\n     __rcu_free_sheaf_prepare+0x261/0x2a0\n     rcu_free_sheaf+0x1f/0xe0\n     rcu_core+0x661/0x1d10\n     handle_softirqs+0x201/0x930\n     __irq_exit_rcu+0x110/0x1e0\n     irq_exit_rcu+0xe/0x20\n     sysvec_apic_timer_interrupt+0x6c/0x80\n     asm_sysvec_apic_timer_interrupt+0x1a/0x20\n     srso_alias_return_thunk+0x0/0xfbef5\n     __asan_memcpy+0x23/0x60\n     create_monitor_ctrl_event+0x1a2/0x460\n     mgmt_cmd_complete+0x2da/0x580\n     load_long_term_keys+0x741/0x860\n     hci_sock_sendmsg+0x128b/0x22e0\n     __sys_sendto+0x425/0x470\n     __x64_sys_sendto+0xe5/0x1c0\n     do_syscall_64+0x115/0x6a0\n     entry_SYSCALL_64_after_hwframe+0x77/0x7f\n\n    CPU: 1 UID: 0 PID: 495 Comm: python3 Tainted: G           O        7.2.0-rc6-pmb-bt-functional-v1+ #1 PREEMPT(lazy)\n    Tainted: [O]=OOT_MODULE\n    Hardware name: QEMU Ubuntu 24.04 PC v2 (i440FX + PIIX, arch_caps fix, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014\n    ==================================================================","Type":"Description","Title":"Bluetooth: hci_core: Keep RCU protection through LTK filtering"}]}}}