Android security tags, read closely by Lightrion

CVE-2024-43085 AI-generated analysis

platform/frameworks/base, services/usb (UsbDeviceManager, USB function switching and accessory mode)

AI-generated: written from the bulletin and the fixing diffs by claude-fable-5-1, then checked against the code by claude-opus-5-5 (7 corrections). Verify against the commit before relying on it.

In UsbDeviceManager's USB function-switch timeout handling, when the current function is FUNCTION_ACCESSORY the fix now calls notifyAccessoryModeExit (which sets FUNCTION_NONE, notifies the permission manager of accessory removal and clears mCurrentAccessory) instead of re-enabling the screen-unlocked default USB functions.

Root cause

In services/usb/java/com/android/server/usb/UsbDeviceManager.java, the handler case for the function-switch timeout (the case containing 'operationId = sUsbOperationCount.incrementAndGet(); if (msg.arg1 != 1)') unconditionally called setEnabledFunctions(mScreenUnlockedFunctions, false, operationId), with the comment that the default function may be selected from Developer options. If the timeout occurred while mCurrentFunctions == UsbManager.FUNCTION_ACCESSORY, the device switched to those default functions rather than FUNCTION_NONE, and the accessory-exit bookkeeping in notifyAccessoryModeExit (usbAccessoryRemoved, clearing mCurrentAccessory) was not performed.

How the fix works

Completeness

Behavior changes

Per major

Unknowns

Back to November 2024 · Findings