Failed integer overflow check leads to heap overflow in driver /dev/qce (CVE-2016-3901, CVE-2016-3935)

Release Date: 
October 3, 2016
Advisory ID: 
QCIR-2016-00037-1
Summary: 

The following security vulnerabilities have been identified in QuIC-authored QCE code.

CVE-2016-3901

When processing QCEDEV_IOCTL_ENC_REQ or QCEDEV_IOCTL_DEC_REQ with large length in the QCE device driver, an integer overflow check on 32-bit variables always fails because the result is compared to the 64-bit constant ULONG_MAX. The uncaught integer overflow results in a following buffer overflow.

Access Vector: Local
Security Risk: Medium
Vulnerability: CWE-680 Integer Overflow to Buffer Overflow

Affected versions

All Android releases from CAF using the Linux kernel.

CVE-2016-3935

When processing QCEDEV_IOCTL_SHA_UPDATE_REQ with large length in the QCE device driver, an integer overflow check on 32-bit variables always fails because the result is compared to the 64-bit constant ULONG_MAX. The uncaught integer overflow results in a following buffer overflow.

Access Vector: Local
Security Risk: Medium
Vulnerability: CWE-680 Integer Overflow to Buffer Overflow

Affected versions

All Android releases from CAF using the Linux kernel.

Patch: 

We advise customers to apply the following patches:

Individual Patches
Acknowledgement: 

This issue was reported to Google by Gengjia Chen (@chengjia4574) and pjf (weibo.com/jfpan) of IceSword Lab, Qihoo 360. Qualcomm Innovation Center, Inc. (QuIC) thanks Google for bringing this issue to QuIC's attention.

Revisions: 

Updated revision. Updated acknowledgment section on Dec. 6, 2016. 

Contact: 
security-advisory@quicinc.com