Cloudanix VulnDB

CVE-2021-39685

High · 7.8

CVSS

7.8

EPSS

0.5%

Published

Mar 16, 2022

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A mistake in how Android handles certain USB connections lets someone who already has access to the phone take complete control of it without the user noticing.

Exploitation
Local Privilege
Attacker needs
Low Privilege
Complexity
Low
Impact
Full Compromise
Component
OS kernel
Class
Memory Corruption
Remediation
Upgrade
Effort
Medium
Patch risk
Medium

What it actually does

Out-of-bounds write in multiple USB gadget subsystem setup methods caused by an incorrect flag check, enabling arbitrary kernel memory corruption from a local unprivileged process.

Why it matters to the business

Attackers with local access can obtain root privileges on affected Android devices, leading to full device compromise, data theft, persistence, and potential lateral movement within enterprise mobile fleets. High prevalence in the Android ecosystem increases organizational risk for any device fleet using the vulnerable kernel.

How an attack unfolds

An attacker with local code execution on an Android device invokes USB gadget setup functions that skip a required flag validation, performs the out-of-bounds write to corrupt kernel structures, and chains the corruption into a privilege-escalation payload. No user interaction or additional permissions are required.

How to fix it

Apply the upstream kernel commit that corrects the flag check and rebuild the Android kernel for all affected devices. Where vendor patches are available, update devices to the latest security patch level that includes the fix. Disable unnecessary USB gadget functionality via kernel configuration where feasible.

How to confirm the fix worked

Verify that devices are running a kernel containing the corrected flag check (review commit history or patch level). Use kernel version strings and build fingerprints to confirm the update has been applied across the fleet. Reproduce the original setup methods in a test environment to ensure the OOB condition is no longer reachable.

Typical attack path

  1. Obtain local execution context on the target Android device (via malicious app, ADB, or compromised process)
  2. Trigger USB gadget initialization paths that exercise the vulnerable setup methods
  3. Trigger the incorrect flag check to cause the out-of-bounds write
  4. Corrupt kernel memory to achieve arbitrary read/write or control-flow hijacking
  5. Escalate to root and install persistence or exfiltrate data

How to detect it

Inspect kernel logs and audit records for anomalous USB gadget initialization sequences followed by unexpected privilege changes or crashes. Correlate with process creation events showing sudden root-owned processes originating from untrusted applications.

What your security team should do

  • Prioritize kernel updates for all Android devices in the environment
  • Restrict local code execution surfaces (sideloading, ADB debugging) until patches are deployed
  • Monitor endpoint detection tools for post-exploitation artifacts such as unexpected root processes
  • Review mobile device management policies to enforce timely security patch compliance

The record

In various setup methods of the USB gadget subsystem, there is a possible out of bounds write due to an incorrect flag check. This could lead to local escalation of privilege with no additional execution privileges needed. User interaction is not needed for exploitation.Product: AndroidVersions: Android kernelAndroid ID: A-210292376References: Upstream kernel

Affected packages

Ecosystem Package Introduced Fixed
Android :linux_kernel: :0 :2022-03-05
Debian:10 linux 0 4.19.232-1
Debian:11 linux 0 5.10.92-1
Debian:12 linux 0 5.15.5-2
Debian:13 linux 0 5.15.5-2
Debian:9 linux 0 4.9.303-1
Debian:9 linux-4.19 0 4.19.232-1~deb9u1
Mageia:8 kernel 0 5.15.10-1.mga8
Mageia:8 kernel-linus 0 5.15.10-1.mga8
Mageia:8 kmod-virtualbox 0 6.1.30-1.5.mga8
Mageia:8 kmod-xtables-addons 0 3.18-1.38.mga8
SUSE:Linux Enterprise High Availability Extension 15 SP3 kernel-default 0 5.3.18-150300.59.49.1
SUSE:Linux Enterprise Live Patching 15 SP3 kernel-default 0 5.3.18-150300.59.49.1
SUSE:Linux Enterprise Live Patching 15 SP3 kernel-livepatch-SLE15-SP3_Update_14 0 1-150300.7.3.1
SUSE:Linux Enterprise Micro 5.1 kernel-default 0 5.3.18-150300.59.49.1
SUSE:Linux Enterprise Micro 5.1 kernel-default-base 0 5.3.18-150300.59.49.1.150300.18.31.1
SUSE:Linux Enterprise Micro 5.1 kernel-rt 0 5.3.18-150300.76.1
SUSE:Linux Enterprise Module for Basesystem 15 SP3 kernel-64kb 0 5.3.18-150300.59.49.1
SUSE:Linux Enterprise Module for Basesystem 15 SP3 kernel-default 0 5.3.18-150300.59.49.1
SUSE:Linux Enterprise Module for Basesystem 15 SP3 kernel-default-base 0 5.3.18-150300.59.49.1.150300.18.31.1
SUSE:Linux Enterprise Module for Basesystem 15 SP3 kernel-preempt 0 5.3.18-150300.59.49.1
SUSE:Linux Enterprise Module for Basesystem 15 SP3 kernel-source 0 5.3.18-150300.59.49.1
SUSE:Linux Enterprise Module for Basesystem 15 SP3 kernel-zfcpdump 0 5.3.18-150300.59.49.1
SUSE:Linux Enterprise Module for Development Tools 15 SP3 kernel-docs 0 5.3.18-150300.59.49.1
SUSE:Linux Enterprise Module for Development Tools 15 SP3 kernel-obs-build 0 5.3.18-150300.59.49.1
SUSE:Linux Enterprise Module for Development Tools 15 SP3 kernel-preempt 0 5.3.18-150300.59.49.1
SUSE:Linux Enterprise Module for Development Tools 15 SP3 kernel-source 0 5.3.18-150300.59.49.1
SUSE:Linux Enterprise Module for Development Tools 15 SP3 kernel-syms 0 5.3.18-150300.59.49.1
SUSE:Linux Enterprise Module for Legacy 15 SP3 kernel-default 0 5.3.18-150300.59.49.1
SUSE:Linux Enterprise Module for Public Cloud 15 SP3 kernel-azure 0 5.3.18-150300.38.40.4
SUSE:Linux Enterprise Module for Public Cloud 15 SP3 kernel-source-azure 0 5.3.18-150300.38.40.4
SUSE:Linux Enterprise Module for Public Cloud 15 SP3 kernel-syms-azure 0 5.3.18-150300.38.40.1
SUSE:Linux Enterprise Workstation Extension 15 SP3 kernel-default 0 5.3.18-150300.59.49.1
SUSE:Linux Enterprise Workstation Extension 15 SP3 kernel-preempt 0 5.3.18-150300.59.49.1
SUSE:Real Time Module 15 SP3 kernel-rt 0 5.3.18-150300.76.1
SUSE:Real Time Module 15 SP3 kernel-rt_debug 0 5.3.18-150300.76.1
SUSE:Real Time Module 15 SP3 kernel-source-rt 0 5.3.18-150300.76.1
SUSE:Real Time Module 15 SP3 kernel-syms-rt 0 5.3.18-150300.76.1
Ubuntu:16.04:LTS linux-hwe-edge 0 No fix
Ubuntu:18.04:LTS linux 0 4.15.0-169.177
Ubuntu:18.04:LTS linux-aws 0 4.15.0-1121.129
Ubuntu:18.04:LTS linux-aws-5.0 0 No fix
Ubuntu:18.04:LTS linux-aws-5.3 0 No fix
Ubuntu:18.04:LTS linux-aws-5.4 0 5.4.0-1066.69~18.04.1
Ubuntu:18.04:LTS linux-azure 0 No fix
Ubuntu:18.04:LTS linux-azure-4.15 0 4.15.0-1131.144
Ubuntu:18.04:LTS linux-azure-5.3 0 No fix
Ubuntu:18.04:LTS linux-azure-5.4 0 5.4.0-1070.73~18.04.1
Ubuntu:18.04:LTS linux-azure-edge 0 No fix
Ubuntu:18.04:LTS linux-dell300x 0 4.15.0-1035.40
Ubuntu:18.04:LTS linux-gcp 0 No fix
Ubuntu:18.04:LTS linux-gcp-4.15 0 4.15.0-1116.130
Ubuntu:18.04:LTS linux-gcp-5.3 0 No fix
Ubuntu:18.04:LTS linux-gcp-5.4 0 5.4.0-1065.69~18.04.1
Ubuntu:18.04:LTS linux-gke-4.15 0 No fix
Ubuntu:18.04:LTS linux-gke-5.4 0 5.4.0-1063.66~18.04.1
Ubuntu:18.04:LTS linux-gkeop-5.4 0 5.4.0-1034.35~18.04.1
Ubuntu:18.04:LTS linux-hwe 0 No fix
Ubuntu:18.04:LTS linux-hwe-5.4 0 5.4.0-100.113~18.04.1
Ubuntu:18.04:LTS linux-hwe-edge 0 No fix
Ubuntu:18.04:LTS linux-ibm-5.4 0 5.4.0-1015.16~18.04.1
Ubuntu:18.04:LTS linux-kvm 0 4.15.0-1107.109
Ubuntu:18.04:LTS linux-oem 0 No fix
Ubuntu:18.04:LTS linux-oracle 0 4.15.0-1087.95
Ubuntu:18.04:LTS linux-oracle-5.0 0 No fix
Ubuntu:18.04:LTS linux-oracle-5.3 0 No fix
Ubuntu:18.04:LTS linux-oracle-5.4 0 5.4.0-1064.68~18.04.1
Ubuntu:18.04:LTS linux-raspi-5.4 0 5.4.0-1053.60~18.04.1
Ubuntu:18.04:LTS linux-raspi2 0 4.15.0-1103.110
Ubuntu:18.04:LTS linux-snapdragon 0 4.15.0-1120.129
Ubuntu:20.04:LTS linux 0 5.4.0-100.113
Ubuntu:20.04:LTS linux-aws 0 5.4.0-1066.69
Ubuntu:20.04:LTS linux-aws-5.11 0 No fix
Ubuntu:20.04:LTS linux-aws-5.13 0 5.13.0-1019.21~20.04.1
Ubuntu:20.04:LTS linux-aws-5.15 0 5.15.0-1014.18~20.04.1
Ubuntu:20.04:LTS linux-aws-5.8 0 No fix
Ubuntu:20.04:LTS linux-azure 0 5.4.0-1070.73
Ubuntu:20.04:LTS linux-azure-5.11 0 No fix
Ubuntu:20.04:LTS linux-azure-5.13 0 5.13.0-1021.24~20.04.1
Ubuntu:20.04:LTS linux-azure-5.15 0 5.15.0-1007.8~20.04.1
Ubuntu:20.04:LTS linux-azure-5.8 0 No fix
Ubuntu:20.04:LTS linux-azure-fde 0 5.4.0-1070.73+cvm1.1
Ubuntu:20.04:LTS linux-azure-fde-5.15 0 5.15.0-1019.24~20.04.1.1
Ubuntu:20.04:LTS linux-bluefield 0 5.4.0-1028.31
Ubuntu:20.04:LTS linux-gcp 0 5.4.0-1065.69
Ubuntu:20.04:LTS linux-gcp-5.11 0 No fix
Ubuntu:20.04:LTS linux-gcp-5.13 0 5.13.0-1021.25~20.04.1
Ubuntu:20.04:LTS linux-gcp-5.15 0 5.15.0-1006.9~20.04.1
Ubuntu:20.04:LTS linux-gcp-5.8 0 No fix
Ubuntu:20.04:LTS linux-gke 0 5.4.0-1063.66
Ubuntu:20.04:LTS linux-gkeop 0 5.4.0-1034.35
Ubuntu:20.04:LTS linux-gkeop-5.15 0 5.15.0-1003.5~20.04.2
Ubuntu:20.04:LTS linux-hwe-5.11 0 No fix
Ubuntu:20.04:LTS linux-hwe-5.13 0 5.13.0-37.42~20.04.1
Ubuntu:20.04:LTS linux-hwe-5.15 0 5.15.0-33.34~20.04.1
Ubuntu:20.04:LTS linux-hwe-5.8 0 No fix
Ubuntu:20.04:LTS linux-ibm 0 5.4.0-1015.16
Ubuntu:20.04:LTS linux-ibm-5.15 0 5.15.0-1033.36~20.04.1
Ubuntu:20.04:LTS linux-intel-5.13 0 No fix
Ubuntu:20.04:LTS linux-intel-iotg-5.15 0 5.15.0-1003.5~20.04.1
Ubuntu:20.04:LTS linux-iot 0 5.4.0-1001.3
Ubuntu:20.04:LTS linux-kvm 0 5.4.0-1056.58
Ubuntu:20.04:LTS linux-lowlatency-hwe-5.15 0 5.15.0-33.34~20.04.1
Ubuntu:20.04:LTS linux-oem-5.10 0 No fix
Ubuntu:20.04:LTS linux-oem-5.13 0 No fix
Ubuntu:20.04:LTS linux-oem-5.14 0 5.14.0-1022.24
Ubuntu:20.04:LTS linux-oem-5.6 0 No fix
Ubuntu:20.04:LTS linux-oracle 0 5.4.0-1064.68
Ubuntu:20.04:LTS linux-oracle-5.11 0 No fix
Ubuntu:20.04:LTS linux-oracle-5.13 0 5.13.0-1025.30~20.04.1
Ubuntu:20.04:LTS linux-oracle-5.15 0 5.15.0-1007.9~20.04.1
Ubuntu:20.04:LTS linux-oracle-5.8 0 No fix
Ubuntu:20.04:LTS linux-raspi 0 5.4.0-1053.60
Ubuntu:20.04:LTS linux-raspi2 0 No fix
Ubuntu:20.04:LTS linux-riscv 0 No fix
Ubuntu:20.04:LTS linux-riscv-5.11 0 No fix
Ubuntu:20.04:LTS linux-riscv-5.15 0 5.15.0-1015.17~20.04.1
Ubuntu:20.04:LTS linux-riscv-5.8 0 No fix
Ubuntu:20.04:LTS linux-xilinx-zynqmp 0 5.4.0-1020.24
Ubuntu:22.04:LTS linux 0 5.15.0-17.17
Ubuntu:22.04:LTS linux-aws 0 5.15.0-1002.4
Ubuntu:22.04:LTS linux-aws-6.5 0 6.5.0-1008.8~22.04.1
Ubuntu:22.04:LTS linux-aws-6.8 0 6.8.0-1009.9~22.04.2
Ubuntu:22.04:LTS linux-azure 0 5.15.0-1001.2
Ubuntu:22.04:LTS linux-azure-6.5 0 6.5.0-1007.7~22.04.1
Ubuntu:22.04:LTS linux-azure-6.8 0 6.8.0-1008.8~22.04.1
Ubuntu:22.04:LTS linux-azure-fde 0 5.15.0-1019.24.1
Ubuntu:22.04:LTS linux-gcp 0 5.15.0-1001.3
Ubuntu:22.04:LTS linux-gcp-6.5 0 6.5.0-1010.10~22.04.3
Ubuntu:22.04:LTS linux-gcp-6.8 0 6.8.0-1010.11~22.04.1
Ubuntu:22.04:LTS linux-gke 0 5.15.0-1002.2
Ubuntu:22.04:LTS linux-gkeop 0 5.15.0-1001.2
Ubuntu:22.04:LTS linux-hwe-6.5 0 6.5.0-14.14~22.04.1
Ubuntu:22.04:LTS linux-hwe-6.8 0 6.8.0-38.38~22.04.1
Ubuntu:22.04:LTS linux-ibm 0 5.15.0-1002.2
Ubuntu:22.04:LTS linux-intel-iot-realtime 0 No fix
Ubuntu:22.04:LTS linux-intel-iot-realtime 0 5.15.0-1021.26
Ubuntu:22.04:LTS linux-intel-iotg 0 5.15.0-1004.6
Ubuntu:22.04:LTS linux-kvm 0 5.15.0-1002.2
Ubuntu:22.04:LTS linux-lowlatency 0 5.15.0-22.22
Ubuntu:22.04:LTS linux-lowlatency-hwe-6.5 0 6.5.0-14.14.1~22.04.1
Ubuntu:22.04:LTS linux-lowlatency-hwe-6.8 0 6.8.0-38.38.1~22.04.2
Ubuntu:22.04:LTS linux-nvidia 0 5.15.0-1005.5
Ubuntu:22.04:LTS linux-nvidia-6.2 0 6.2.0-1003.3~22.04.1
Ubuntu:22.04:LTS linux-nvidia-6.5 0 6.5.0-1004.4
Ubuntu:22.04:LTS linux-nvidia-6.8 0 6.8.0-1008.8~22.04.1
Ubuntu:22.04:LTS linux-oem-5.17 0 5.17.0-1003.3
Ubuntu:22.04:LTS linux-oem-6.0 0 6.0.0-1006.6
Ubuntu:22.04:LTS linux-oem-6.5 0 6.5.0-1003.3
Ubuntu:22.04:LTS linux-oracle 0 5.15.0-1001.3
Ubuntu:22.04:LTS linux-oracle-6.5 0 6.5.0-1013.13~22.04.4
Ubuntu:22.04:LTS linux-oracle-6.8 0 6.8.0-1006.6~22.04.3
Ubuntu:22.04:LTS linux-raspi 0 5.15.0-1002.2
Ubuntu:22.04:LTS linux-realtime 0 No fix
Ubuntu:22.04:LTS linux-riscv 0 5.15.0-1004.4
Ubuntu:22.04:LTS linux-riscv-6.5 0 6.5.0-17.17.1.1~22.04.1
Ubuntu:22.04:LTS linux-riscv-6.8 0 6.8.0-38.38.1~22.04.1
Ubuntu:22.04:LTS linux-starfive-6.5 0 6.5.0-1007.8~22.04.1
Ubuntu:22.04:LTS linux-xilinx-zynqmp 0 5.15.0-1022.26
Ubuntu:22.04:LTS:for:NVIDIA:BlueField linux-bluefield 0 5.15.0-1011.13
Ubuntu:24.04:LTS linux 0 6.5.0-9.9
Ubuntu:24.04:LTS linux-aws 0 6.5.0-1008.8
Ubuntu:24.04:LTS linux-azure 0 6.5.0-1007.7
Ubuntu:24.04:LTS linux-gcp 0 6.5.0-1007.7
Ubuntu:24.04:LTS linux-gke 0 6.8.0-1003.5
Ubuntu:24.04:LTS linux-gkeop 0 6.8.0-1001.3
Ubuntu:24.04:LTS linux-ibm 0 6.5.0-1009.9
Ubuntu:24.04:LTS linux-lowlatency 0 6.5.0-9.9.1
Ubuntu:24.04:LTS linux-nvidia 0 6.8.0-1007.7
Ubuntu:24.04:LTS linux-nvidia-lowlatency 0 6.8.0-1009.9.1
Ubuntu:24.04:LTS linux-oem-6.11 0 6.11.0-1007.7
Ubuntu:24.04:LTS linux-oem-6.8 0 6.8.0-1003.3
Ubuntu:24.04:LTS linux-oracle 0 6.5.0-1010.10
Ubuntu:24.04:LTS linux-raspi 0 6.5.0-1005.7
Ubuntu:24.04:LTS linux-raspi-realtime 0 No fix
Ubuntu:24.04:LTS linux-raspi-realtime 0 6.7.0-2001.1
Ubuntu:24.04:LTS linux-realtime 0 6.8.0-1008.19
Ubuntu:24.04:LTS linux-riscv 0 6.5.0-9.9.1
Ubuntu:24.10 linux 0 6.8.0-31.31
Ubuntu:24.10 linux-aws 0 6.8.0-1008.8
Ubuntu:24.10 linux-azure 0 6.8.0-1007.7
Ubuntu:24.10 linux-gcp 0 6.8.0-1007.7
Ubuntu:24.10 linux-lowlatency 0 6.8.0-31.31.1
Ubuntu:24.10 linux-oracle 0 6.8.0-1005.5
Ubuntu:24.10 linux-raspi 0 6.8.0-1004.4
Ubuntu:24.10 linux-realtime 0 6.11.0-1001.1
Ubuntu:24.10 linux-riscv 0 6.8.0-31.31.1
Ubuntu:Pro:14.04:LTS linux 0 No fix
Ubuntu:Pro:14.04:LTS linux-aws 0 4.4.0-1109.115
Ubuntu:Pro:14.04:LTS linux-azure 0 4.15.0-1131.144~14.04.1
Ubuntu:Pro:14.04:LTS linux-lts-xenial 0 4.4.0-229.263~14.04.1
Ubuntu:Pro:16.04:LTS linux 0 4.4.0-229.263
Ubuntu:Pro:16.04:LTS linux-aws 0 4.4.0-1145.160
Ubuntu:Pro:16.04:LTS linux-aws-hwe 0 4.15.0-1120.128~16.04.1
Ubuntu:Pro:16.04:LTS linux-azure 0 4.15.0-1131.144~16.04.1
Ubuntu:Pro:16.04:LTS linux-gcp 0 4.15.0-1116.130~16.04.1
Ubuntu:Pro:16.04:LTS linux-hwe 0 4.15.0-169.177~16.04.1
Ubuntu:Pro:16.04:LTS linux-hwe-edge 0 No fix
Ubuntu:Pro:16.04:LTS linux-kvm 0 4.4.0-1110.120
Ubuntu:Pro:16.04:LTS linux-oracle 0 4.15.0-1087.95~16.04.1

Related vulnerabilities