CVE-2026-58871 AI-generated analysis
platform/external/wpa_supplicant_8, wpa_supplicant AIDL STA interface (wpa_supplicant/aidl/sta_iface.cpp), QoS policy / SCS classifier conversion
Changes the os_memcpy length in set_type4_frame_classifier (wpa_supplicant AIDL STA interface) from sizeof(qos_policy_data.classifierParams.flowLabelIpv6), the size of the container object, to sizeof(param->ip_params.v6.flow_label) so that exactly 3 bytes of the IPv6 flow label are copied from the AIDL QoS policy classifier params.
Root cause
In set_type4_frame_classifier, when the FLOW_LABEL bit is set in the classifier params mask, the code checked that qos_policy_data.classifierParams.flowLabelIpv6.size() equals sizeof(param->ip_params.v6.flow_label) (3 bytes), but then called os_memcpy with length sizeof(qos_policy_data.classifierParams.flowLabelIpv6). That expression is the size of the container object itself (not its 3-byte contents), so the copy wrote more bytes than the 3-byte flow_label field holds and read beyond the 3-byte data. The size check was correct; the copy length was wrong.
How the fix works
- wpa_supplicant/aidl/sta_iface.cpp:set_type4_frame_classifier: the os_memcpy length argument is changed from sizeof(qos_policy_data.classifierParams.flowLabelIpv6) to sizeof(param->ip_params.v6.flow_label), which is the destination field size (3 bytes) and is already guaranteed equal to flowLabelIpv6.size() by the preceding check.
- A comment is added stating the flow label is expected to be 3 bytes. The existing size check (size() != sizeof(param->ip_params.v6.flow_label) -> MSG_ERROR 'Invalid flow label', return -1) is unchanged.
- Two unrelated trailing-whitespace cleanups in StaIface::generateDppBootstrapInfoForResponder and generateDppBootstrapInfoForResponderInternal are included in the 14/15/17 commits; they have no functional effect.
Completeness
- Covers the FLOW_LABEL branch of set_type4_frame_classifier: after the fix the copy length equals the destination size and, by the preceding check, the source size.
- Other classifier fields converted in the same function (e.g. addresses, ports, DSCP) are not in the diff; the material does not show their copy code, so whether they use the same sizeof pattern is unknown from this material.
- No change to the AIDL-side definitions or to the framework caller is part of the fix.
Behavior changes
- None observable for valid input: a 3-byte flow label is still copied, and non-3-byte labels are still rejected with 'Invalid flow label' and return -1. Only the number of bytes copied changes (3 instead of the container object size).
Per major
- Android 14: same fix: commit 2192c6ec22f9 in android-security-14.0.0_r31, identical diff (memcpy length change plus two whitespace hunks) in wpa_supplicant/aidl/sta_iface.cpp; 8/8 patched lines present.
- Android 15: same fix: commit e65278ba9881 in android-security-15.0.0_r19, wpa_supplicant/aidl/sta_iface.cpp; 8/8 patched lines present.
- Android 16: adapted fix: commit c1c7c48be1ee in android-security-16.0.0_r10 applies only the set_type4_frame_classifier hunk, in wpa_supplicant/aidl/vendor/sta_iface.cpp (whitespace hunks not included); 6/8 lines of the patched region present at that tag.
- Android 17: same fix: commit 02510b794885 in android-security-17.0.0_r3, wpa_supplicant/aidl/sta_iface.cpp at different line offsets; 8/8 patched lines present.
Unknowns
- The AIDL method that leads to set_type4_frame_classifier and the full definition of param->ip_params.v6 (what fields follow flow_label) are not shown in the material.
- Whether sibling classifier field copies in the same function use a similar sizeof pattern is not shown.
- Why only 6/8 lines of the patched region are reported present at android-security-16.0.0_r10 is not explained by the material.