Cloudanix VulnDB

CVE-2022-4382

Medium · 6.4

CVSS

6.4

EPSS

0.5%

Published

Jan 10, 2023

CISA due date

—

Cloudanix analysis

Monitor only SSVC: Track

A flaw in the Linux kernel's handling of certain USB gadget devices could let someone with physical access crash the system or run malicious code by quickly unplugging hardware.

Exploit Available
Exploitation
Physical Access
Attacker needs
Physical Access
Complexity
High
Impact
Full Compromise
Component
OS kernel
Class
Use After Free
Remediation
Upgrade
Effort
Medium
Patch risk
Medium

What it actually does

Use-after-free condition in the gadgetfs Linux kernel driver caused by a race condition among superblock operations, triggered when a device is physically removed while gadgetfs is active.

Why it matters to the business

On Linux systems exposing gadgetfs (typically embedded or USB gadget configurations), an attacker with physical access could achieve kernel-level code execution or denial of service, potentially compromising the device or enabling further attacks; low likelihood given physical and timing requirements and lack of widespread exploitation.

How an attack unfolds

An attacker with physical access to the target device yanks the USB gadget hardware while gadgetfs superblock operations are in progress, winning the race to trigger the use-after-free and gain control of freed kernel memory.

How to fix it

Upgrade to a patched Linux kernel version that resolves the race condition in gadgetfs; if patching is not immediately possible, disable the gadgetfs driver or restrict physical access to affected devices.

How to confirm the fix worked

Verify the running kernel version against upstream fixes for gadgetfs superblock races; test device removal scenarios under load to confirm absence of the flaw; review kernel configuration to ensure gadgetfs is disabled where unnecessary.

Typical attack path

  1. Gain physical access to the Linux device running gadgetfs
  2. Ensure gadgetfs is actively mounted and performing superblock operations
  3. Physically remove or disconnect the gadget device to trigger the race condition
  4. Exploit the resulting use-after-free for memory corruption and code execution

How to detect it

Review kernel logs and dmesg output for gadgetfs-related oops or panic messages around device removal events; correlate with physical access logs; search for evidence of unexpected kernel memory corruption or exploitation attempts via crash dumps.

What your security team should do

  • Prioritize kernel updates on any systems using gadgetfs, especially those with physical access exposure
  • Disable gadgetfs module if the functionality is not required
  • Enforce physical security controls around devices that may use gadget mode
  • Monitor EPSS and exploit availability trends for any increase in risk

The record

A use-after-free flaw caused by a race among the superblock operations in the gadgetfs Linux driver was found. It could be triggered by yanking out a device that is running the gadgetfs side.

Affected packages

Ecosystem Package Introduced Fixed
Chainguard hyperv-daemons 0 0
Chainguard hyperv-daemons-6.12 0 0
Chainguard hyperv-daemons-6.18 0 0
Chainguard hyperv-daemons-generic 0 0
Chainguard linux 0 0
Chainguard linux-aws-6.12 0 6.12.63-r0
Chainguard linux-aws-6.12 0 6.12.65-r0
Chainguard linux-aws-6.12-boot-installed 0 0
Chainguard linux-aws-6.12-fips-boot-installed 0 0
Chainguard linux-aws-6.12-headers 0 0
Chainguard linux-aws-6.12-modules 0 0
Chainguard linux-aws-6.18 0 6.18.4-r0
Chainguard linux-aws-6.18 0 6.18.5-r2
Chainguard linux-aws-6.18-boot-installed 0 0
Chainguard linux-aws-6.18-fips-boot-installed 0 0
Chainguard linux-aws-6.18-headers 0 0
Chainguard linux-aws-6.18-modules 0 0
Chainguard linux-aws-generic 0 6.18.3-r0
Chainguard linux-aws-generic 0 6.18.5-r0
Chainguard linux-aws-generic-boot-configuration 0 0
Chainguard linux-aws-generic-boot-installed 0 0
Chainguard linux-aws-generic-fips-boot-installed 0 0
Chainguard linux-aws-generic-headers 0 0
Chainguard linux-aws-generic-modules 0 0
Chainguard linux-azure-6.12 0 6.12.63-r0
Chainguard linux-azure-6.12 0 6.12.65-r1
Chainguard linux-azure-6.12-boot-installed 0 0
Chainguard linux-azure-6.12-fips-boot-installed 0 0
Chainguard linux-azure-6.12-headers 0 0
Chainguard linux-azure-6.12-modules 0 0
Chainguard linux-azure-6.18 0 0
Chainguard linux-azure-6.18-boot-installed 0 0
Chainguard linux-azure-6.18-fips-boot-installed 0 0
Chainguard linux-azure-6.18-headers 0 0
Chainguard linux-azure-6.18-modules 0 0
Chainguard linux-azure-generic 0 6.18.3-r0
Chainguard linux-azure-generic 0 6.18.5-r0
Chainguard linux-azure-generic-boot-configuration 0 0
Chainguard linux-azure-generic-boot-installed 0 0
Chainguard linux-azure-generic-fips-boot-installed 0 0
Chainguard linux-azure-generic-headers 0 0
Chainguard linux-azure-generic-modules 0 0
Chainguard linux-boot-configuration 0 0
Chainguard linux-boot-installed 0 0
Chainguard linux-gcp-6.12 0 6.12.63-r0
Chainguard linux-gcp-6.12 0 6.12.65-r0
Chainguard linux-gcp-6.12-boot-installed 0 0
Chainguard linux-gcp-6.12-fips-boot-installed 0 0
Chainguard linux-gcp-6.12-headers 0 0
Chainguard linux-gcp-6.12-modules 0 0
Chainguard linux-gcp-6.18 0 6.18.4-r0
Chainguard linux-gcp-6.18 0 6.18.5-r2
Chainguard linux-gcp-6.18-boot-installed 0 0
Chainguard linux-gcp-6.18-fips-boot-installed 0 0
Chainguard linux-gcp-6.18-headers 0 0
Chainguard linux-gcp-6.18-modules 0 0
Chainguard linux-gcp-generic 0 6.18.3-r0
Chainguard linux-gcp-generic 0 6.18.5-r0
Chainguard linux-gcp-generic-boot-installed 0 0
Chainguard linux-gcp-generic-fips-boot-installed 0 0
Chainguard linux-gcp-generic-headers 0 0
Chainguard linux-gcp-generic-modules 0 0
Chainguard linux-modules 0 0
Chainguard linux-qemu-6.12 0 6.12.65-r2
Chainguard linux-qemu-6.12-boot-installed 0 6.12.63-r0
Chainguard linux-qemu-6.12-fips-boot-installed 0 6.12.63-r0
Chainguard linux-qemu-6.12-headers 0 6.12.63-r0
Chainguard linux-qemu-6.12-modules 0 6.12.63-r0
Chainguard linux-qemu-6.18 0 6.18.5-r2
Chainguard linux-qemu-6.18-boot-installed 0 6.18.2-r0
Chainguard linux-qemu-6.18-fips-boot-installed 0 6.18.2-r0
Chainguard linux-qemu-6.18-headers 0 6.18.2-r0
Chainguard linux-qemu-6.18-modules 0 6.18.2-r0
Chainguard linux-qemu-generic 0 6.18.3-r0
Chainguard linux-qemu-generic 0 6.18.5-r0
Chainguard linux-qemu-generic-boot-installed 0 0
Chainguard linux-qemu-generic-bootc-boot-installed 0 6.18.4-r0
Chainguard linux-qemu-generic-bootc-boot-installed 0 6.18.5-r0
Chainguard linux-qemu-generic-fips-boot-installed 0 0
Chainguard linux-qemu-generic-headers 0 0
Chainguard linux-qemu-generic-modules 0 0
Chainguard linux-qemu-rc 0 6.19_rc4-r0
Chainguard linux-qemu-rc 0 6.19_rc5-r0
Chainguard linux-qemu-rc-boot-installed 0 0
Chainguard linux-qemu-rc-fips-boot-installed 0 0
Chainguard linux-qemu-rc-headers 0 0
Chainguard linux-qemu-rc-modules 0 0
Chainguard linux-vmware-6.12 0 6.12.65-r2
Chainguard linux-vmware-6.12-boot-installed 0 6.12.63-r0
Chainguard linux-vmware-6.12-fips-boot-installed 0 6.12.63-r0
Chainguard linux-vmware-6.12-headers 0 6.12.63-r0
Chainguard linux-vmware-6.12-modules 0 6.12.63-r0
Chainguard linux-vmware-6.18 0 6.18.5-r2
Chainguard linux-vmware-6.18-boot-installed 0 6.18.2-r0
Chainguard linux-vmware-6.18-fips-boot-installed 0 6.18.2-r0
Chainguard linux-vmware-6.18-headers 0 6.18.2-r0
Chainguard linux-vmware-6.18-modules 0 6.18.2-r0
Chainguard linux-vmware-generic 0 6.18.3-r0
Chainguard linux-vmware-generic 0 6.18.5-r0
Chainguard linux-vmware-generic-boot-installed 0 0
Chainguard linux-vmware-generic-fips-boot-installed 0 0
Chainguard linux-vmware-generic-headers 0 0
Chainguard linux-vmware-generic-modules 0 0
Debian:11 linux 0 5.10.178-1
Debian:12 linux 0 6.1.8-1
Debian:13 linux 0 6.1.8-1
Mageia:8 kernel 0 5.15.98-1.mga8
Mageia:8 kernel-linus 0 5.15.98-1.mga8
Mageia:8 kmod-virtualbox 0 7.0.6-1.6.mga8
Mageia:8 kmod-xtables-addons 0 3.23-1.8.mga8
SUSE:Linux Enterprise High Availability Extension 15 SP4 kernel-default 0 5.14.21-150400.24.46.1
SUSE:Linux Enterprise High Availability Extension 15 SP4 kernel-default 0 5.14.21-150400.24.133.2
SUSE:Linux Enterprise High Availability Extension 15 SP5 kernel-default 0 5.14.21-150500.55.80.2
SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS kernel-64kb 0 5.14.21-150400.24.133.2
SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS kernel-default 0 5.14.21-150400.24.133.2
SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS kernel-default-base 0 5.14.21-150400.24.133.2.150400.24.64.5
SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS kernel-docs 0 5.14.21-150400.24.133.1
SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS kernel-obs-build 0 5.14.21-150400.24.133.2
SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS kernel-source 0 5.14.21-150400.24.133.2
SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS kernel-syms 0 5.14.21-150400.24.133.1
SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS kernel-64kb 0 5.14.21-150400.24.133.2
SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS kernel-default 0 5.14.21-150400.24.133.2
SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS kernel-default-base 0 5.14.21-150400.24.133.2.150400.24.64.5
SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS kernel-docs 0 5.14.21-150400.24.133.1
SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS kernel-obs-build 0 5.14.21-150400.24.133.2
SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS kernel-source 0 5.14.21-150400.24.133.2
SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS kernel-syms 0 5.14.21-150400.24.133.1
SUSE:Linux Enterprise Live Patching 15 SP4 kernel-default 0 5.14.21-150400.24.46.1
SUSE:Linux Enterprise Live Patching 15 SP4 kernel-default 0 5.14.21-150400.24.133.2
SUSE:Linux Enterprise Live Patching 15 SP4 kernel-livepatch-SLE15-SP4-RT_Update_3 0 1-150400.1.3.1
SUSE:Linux Enterprise Live Patching 15 SP4 kernel-livepatch-SLE15-SP4_Update_31 0 1-150400.9.3.2
SUSE:Linux Enterprise Live Patching 15 SP4 kernel-livepatch-SLE15-SP4_Update_8 0 1-150400.9.3.3
SUSE:Linux Enterprise Live Patching 15 SP5 kernel-default 0 5.14.21-150500.55.80.2
SUSE:Linux Enterprise Live Patching 15 SP5 kernel-livepatch-SLE15-SP5_Update_19 0 1-150500.11.3.2
SUSE:Linux Enterprise Micro 5.3 kernel-default 0 5.14.21-150400.24.46.1
SUSE:Linux Enterprise Micro 5.3 kernel-default 0 5.14.21-150400.24.133.2
SUSE:Linux Enterprise Micro 5.3 kernel-default-base 0 5.14.21-150400.24.46.1.150400.24.17.3
SUSE:Linux Enterprise Micro 5.3 kernel-default-base 0 5.14.21-150400.24.133.2.150400.24.64.5
SUSE:Linux Enterprise Micro 5.3 kernel-rt 0 5.14.21-150400.15.11.1
SUSE:Linux Enterprise Micro 5.4 kernel-default 0 5.14.21-150400.24.133.2
SUSE:Linux Enterprise Micro 5.4 kernel-default-base 0 5.14.21-150400.24.133.2.150400.24.64.5
SUSE:Linux Enterprise Micro 5.5 kernel-default 0 5.14.21-150500.55.80.2
SUSE:Linux Enterprise Micro 5.5 kernel-default-base 0 5.14.21-150500.55.80.2.150500.6.35.6
SUSE:Linux Enterprise Module for Basesystem 15 SP4 kernel-64kb 0 5.14.21-150400.24.46.1
SUSE:Linux Enterprise Module for Basesystem 15 SP4 kernel-default 0 5.14.21-150400.24.46.1
SUSE:Linux Enterprise Module for Basesystem 15 SP4 kernel-default-base 0 5.14.21-150400.24.46.1.150400.24.17.3
SUSE:Linux Enterprise Module for Basesystem 15 SP4 kernel-source 0 5.14.21-150400.24.46.1
SUSE:Linux Enterprise Module for Basesystem 15 SP4 kernel-zfcpdump 0 5.14.21-150400.24.46.1
SUSE:Linux Enterprise Module for Basesystem 15 SP5 kernel-64kb 0 5.14.21-150500.55.80.2
SUSE:Linux Enterprise Module for Basesystem 15 SP5 kernel-default 0 5.14.21-150500.55.80.2
SUSE:Linux Enterprise Module for Basesystem 15 SP5 kernel-default-base 0 5.14.21-150500.55.80.2.150500.6.35.6
SUSE:Linux Enterprise Module for Basesystem 15 SP5 kernel-source 0 5.14.21-150500.55.80.2
SUSE:Linux Enterprise Module for Basesystem 15 SP5 kernel-zfcpdump 0 5.14.21-150500.55.80.2
SUSE:Linux Enterprise Module for Development Tools 15 SP4 kernel-docs 0 5.14.21-150400.24.46.2
SUSE:Linux Enterprise Module for Development Tools 15 SP4 kernel-obs-build 0 5.14.21-150400.24.46.1
SUSE:Linux Enterprise Module for Development Tools 15 SP4 kernel-source 0 5.14.21-150400.24.46.1
SUSE:Linux Enterprise Module for Development Tools 15 SP4 kernel-syms 0 5.14.21-150400.24.46.1
SUSE:Linux Enterprise Module for Development Tools 15 SP5 kernel-docs 0 5.14.21-150500.55.80.2
SUSE:Linux Enterprise Module for Development Tools 15 SP5 kernel-obs-build 0 5.14.21-150500.55.80.1
SUSE:Linux Enterprise Module for Development Tools 15 SP5 kernel-source 0 5.14.21-150500.55.80.2
SUSE:Linux Enterprise Module for Development Tools 15 SP5 kernel-syms 0 5.14.21-150500.55.80.1
SUSE:Linux Enterprise Module for Legacy 15 SP4 kernel-default 0 5.14.21-150400.24.46.1
SUSE:Linux Enterprise Module for Legacy 15 SP5 kernel-default 0 5.14.21-150500.55.80.2
SUSE:Linux Enterprise Module for Public Cloud 15 SP4 kernel-azure 0 5.14.21-150400.14.34.1
SUSE:Linux Enterprise Module for Public Cloud 15 SP4 kernel-source-azure 0 5.14.21-150400.14.34.1
SUSE:Linux Enterprise Module for Public Cloud 15 SP4 kernel-syms-azure 0 5.14.21-150400.14.34.1
SUSE:Linux Enterprise Server 15 SP4-LTSS kernel-64kb 0 5.14.21-150400.24.133.2
SUSE:Linux Enterprise Server 15 SP4-LTSS kernel-default 0 5.14.21-150400.24.133.2
SUSE:Linux Enterprise Server 15 SP4-LTSS kernel-default-base 0 5.14.21-150400.24.133.2.150400.24.64.5
SUSE:Linux Enterprise Server 15 SP4-LTSS kernel-docs 0 5.14.21-150400.24.133.1
SUSE:Linux Enterprise Server 15 SP4-LTSS kernel-obs-build 0 5.14.21-150400.24.133.2
SUSE:Linux Enterprise Server 15 SP4-LTSS kernel-source 0 5.14.21-150400.24.133.2
SUSE:Linux Enterprise Server 15 SP4-LTSS kernel-syms 0 5.14.21-150400.24.133.1
SUSE:Linux Enterprise Server 15 SP4-LTSS kernel-zfcpdump 0 5.14.21-150400.24.133.2
SUSE:Linux Enterprise Server for SAP Applications 15 SP4 kernel-default 0 5.14.21-150400.24.133.2
SUSE:Linux Enterprise Server for SAP Applications 15 SP4 kernel-default-base 0 5.14.21-150400.24.133.2.150400.24.64.5
SUSE:Linux Enterprise Server for SAP Applications 15 SP4 kernel-docs 0 5.14.21-150400.24.133.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP4 kernel-obs-build 0 5.14.21-150400.24.133.2
SUSE:Linux Enterprise Server for SAP Applications 15 SP4 kernel-source 0 5.14.21-150400.24.133.2
SUSE:Linux Enterprise Server for SAP Applications 15 SP4 kernel-syms 0 5.14.21-150400.24.133.1
SUSE:Linux Enterprise Workstation Extension 15 SP4 kernel-default 0 5.14.21-150400.24.46.1
SUSE:Linux Enterprise Workstation Extension 15 SP5 kernel-default 0 5.14.21-150500.55.80.2
SUSE:Manager Proxy 4.3 kernel-default 0 5.14.21-150400.24.133.2
SUSE:Manager Proxy 4.3 kernel-default-base 0 5.14.21-150400.24.133.2.150400.24.64.5
SUSE:Manager Proxy 4.3 kernel-source 0 5.14.21-150400.24.133.2
SUSE:Manager Proxy 4.3 kernel-syms 0 5.14.21-150400.24.133.1
SUSE:Manager Server 4.3 kernel-default 0 5.14.21-150400.24.133.2
SUSE:Manager Server 4.3 kernel-default-base 0 5.14.21-150400.24.133.2.150400.24.64.5
SUSE:Manager Server 4.3 kernel-source 0 5.14.21-150400.24.133.2
SUSE:Manager Server 4.3 kernel-syms 0 5.14.21-150400.24.133.1
SUSE:Manager Server 4.3 kernel-zfcpdump 0 5.14.21-150400.24.133.2
SUSE:Real Time Module 15 SP4 kernel-rt 0 5.14.21-150400.15.11.1
SUSE:Real Time Module 15 SP4 kernel-rt_debug 0 5.14.21-150400.15.11.1
SUSE:Real Time Module 15 SP4 kernel-source-rt 0 5.14.21-150400.15.11.1
SUSE:Real Time Module 15 SP4 kernel-syms-rt 0 5.14.21-150400.15.11.1
Ubuntu:14.04:LTS linux 0 3.11.0-12.19
Ubuntu:14.04:LTS linux-aws 0 4.4.0-1002.2
Ubuntu:14.04:LTS linux-azure 0 4.15.0-1023.24~14.04.1
Ubuntu:14.04:LTS linux-lts-xenial 0 4.4.0-13.29~14.04.1
Ubuntu:16.04:LTS linux 0 4.4.0-2.16

Related vulnerabilities