Android security tags, read closely by Lightrion

CVE-2024-31327 AI-generated analysis

platform/system/libfmq, Fast Message Queue (include/fmq/MessageQueueBase.h header template)

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 (8 corrections). Verify against the commit before relying on it.

Adds consistency checks to MessageQueueBase::availableToReadBytes() and availableToWriteBytes() in libfmq so that inconsistent read/write pointer values (readPtr > writePtr, or available > queue size) yield 0 with an error log instead of an unsigned underflow.

Root cause

availableToReadBytes() returned mWritePtr->load(std::memory_order_acquire) - mReadPtr->load(std::memory_order_acquire) with no check that writePtr >= readPtr. The pointers are std::atomic<uint64_t>* members. If readPtr exceeds writePtr, the unsigned subtraction wraps to a huge value. availableToWriteBytes() computed mDesc->getSize() - availableToReadBytes(), which also wraps when the available count exceeds the queue size.

How the fix works

Completeness

Behavior changes

Per major

Unknowns

Back to June 2024 · Findings