CVE-2021-3640
Linux Kernel vulnerability analysis and mitigation

Overview

CVE-2021-3640 is a use-after-free vulnerability discovered in the Linux kernel's Bluetooth HCI subsystem, specifically in the sco_sock_sendmsg() function. The vulnerability was found in the way user calls ioct UFFDIO_REGISTER or other way triggers race condition of the call sco_conn_del() together with the call sco_sock_sendmsg() with the expected controllable faulting memory page (Ubuntu Security, NVD).

Technical details

The vulnerability stems from a race condition in the Bluetooth SCO implementation that can lead to a use-after-free condition. The issue occurs between lock pairs in sco_conn_del(), where sco_chan_del() is called to delete the channel associated with the socket. The conn object is then released by kfree(), but another thread controlled by an attacker can wait for this kfree() and subsequently race to cause a use-after-free condition. The vulnerability exists in the sco_send_frame function which is protected by lock_sock() and release_sock(), but these don't block sco_conn_del() from releasing the conn object (OpenWall).

Impact

A privileged local user could exploit this vulnerability to cause a denial of service (memory corruption or system crash) or potentially escalate their privileges on the system. The vulnerability is particularly concerning as the sco_conn struct contains two previous data pointers inside, making it relatively easy for attackers with CAP_NET_ADMIN privilege to spray kmalloc-32 objects with malicious payload (Ubuntu Security, OpenWall).

Mitigation and workarounds

The vulnerability has been fixed in various Linux distributions through security updates. For example, Ubuntu has fixed this in versions 5.13.0-28.31 for 21.10, 5.4.0-97.110 for 20.04 LTS, and 4.15.0-167.175 for 18.04 LTS. Debian has addressed this in version 4.19.232-1 for the oldstable distribution (buster) (Ubuntu Security, Debian Security).

Additional resources


SourceThis report was generated using AI

Related Linux Kernel vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-71142N/AN/A
  • Linux KernelLinux Kernel
  • kernel-64k-debug-devel-matched
NoNoJan 14, 2026
CVE-2025-71137N/AN/A
  • Linux KernelLinux Kernel
  • linux-gcp
NoYesJan 14, 2026
CVE-2025-71135N/AN/A
  • Linux KernelLinux Kernel
  • kernel-debug-core
NoNoJan 14, 2026
CVE-2025-71134N/AN/A
  • Linux KernelLinux Kernel
  • kernel-uki-virt
NoNoJan 14, 2026
CVE-2025-71133N/AN/A
  • Linux KernelLinux Kernel
  • kernel-modules-extra
NoYesJan 14, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management