CVE-2026-58975 AI-generated analysis
platform/frameworks/av, media OMX HIDL wrapper (LWOmxNode in media/libmedia/omx/1.0 and media/libstagefright/omx/1.0)
Bounds the std::copy in LWOmxNode::getParameter and LWOmxNode::getConfig (in both the libmedia and libstagefright copies of WOmxNode.cpp) to min(outParams.size(), size), so the byte vector returned by the HIDL callee can no longer overflow the caller's params buffer or be over-read.
Root cause
LWOmxNode holds a HIDL IOmxNode (mBase) and forwards getParameter/getConfig to it. In getParameter(index, params, size), the result lambda copied outParams.size() bytes from the hidl_vec returned by the callee into params, a buffer the caller sized to `size`. The lambda did not capture `size` at all, so a callee that returned a vector larger than `size` wrote past the end of the caller's buffer. The commit title calls this a stack buffer overflow. In getConfig, the lambda copied exactly `size` bytes from outParams without checking outParams.size(), so a callee that returned a shorter vector caused a read past the end of the hidl_vec. The same code exists in two files: media/libmedia/omx/1.0/WOmxNode.cpp (namespace utils) and media/libstagefright/omx/1.0/WOmxNode.cpp (namespace implementation).
How the fix works
- media/libmedia/omx/1.0/WOmxNode.cpp:LWOmxNode::getParameter and media/libstagefright/omx/1.0/WOmxNode.cpp:LWOmxNode::getParameter: the lambda capture list changes from [&fnStatus, params] to [&fnStatus, params, size], and the std::copy end iterator changes from outParams.data() + outParams.size() to outParams.data() + std::min(outParams.size(), size). The copy into params is now bounded by the buffer size the caller provided.
- media/libmedia/omx/1.0/WOmxNode.cpp:LWOmxNode::getConfig and media/libstagefright/omx/1.0/WOmxNode.cpp:LWOmxNode::getConfig: the std::copy end iterator changes from outParams.data() + size to outParams.data() + std::min(outParams.size(), size), so the read can no longer go past the end of the returned hidl_vec. The lambda already captured size.
- This is a single commit with 6 insertions and 6 deletions and no header or interface changes. std::min needs <algorithm>, which the libmedia file already includes (line 17).
Completeness
- The fix covers both the write overflow in getParameter and the over-read in getConfig, in both duplicate copies of WOmxNode.cpp.
- On a size mismatch the fix silently truncates. It does not report an error (fnStatus/transStatus are unchanged) and does not check that the callee returned the expected struct size. If outParams is shorter than size in getParameter, the tail of params keeps its previous contents.
- The material does not show the other LWOmxNode methods, so the diff does not tell us whether any other path copies results the same way.
Behavior changes
- getParameter now copies at most `size` bytes into params instead of the full returned vector.
- getConfig now copies at most outParams.size() bytes instead of always copying `size` bytes.
- There are no new error codes. A size mismatch between request and response is truncated rather than rejected.
Per major
- Android 14: same fix: platform/frameworks/av ccd19b19e9a3 in android-security-14.0.0_r31, identical diff to both files.
- Android 15: same fix: platform/frameworks/av 9f72474cf232 in android-security-15.0.0_r19, identical diff to both files. The code context at that tag shows the size capture and the bounded copy in place.
- Android 16: same fix: platform/frameworks/av b3a390cb3235 in android-security-16.0.0_r10, identical diff.
- Android 17: same fix: platform/frameworks/av 16ebcba6aa2d in android-security-17.0.0_r3, identical diff.
Unknowns
- The material does not show which IOmxNode implementation or which caller of LWOmxNode::getParameter was involved in the reported issue. It also does not show whether the overflowed params buffer is always on the stack (the commit title says stack buffer overflow).
- The material does not explain why the per-major check reports 7/8 patched lines present at every latest security tag. The diffs themselves show the full change applied.
- The bulletin also lists 16-qpr2 and 17-qpr2-next as affected. The material does not show which fix commits apply to those branches.