summaryrefslogtreecommitdiff
path: root/msm8998
diff options
context:
space:
mode:
authorAshish Kumar <quic_asku@quicinc.com>2019-03-05 10:33:15 +0530
committerMidas Chien <midaschieh@google.com>2019-12-04 17:54:02 +0800
commit25569094e42379946259ef5998d1c46e1b9b1e78 (patch)
tree036d8bff40c0c325bbe9311e189ae7f5e127b18d /msm8998
parent22cd1cb8bf92e2be02cbae1a6f15bc7c14750462 (diff)
downloaddisplay-25569094e42379946259ef5998d1c46e1b9b1e78.tar.gz
hwc2: Validate bounds check for input parcel.
CRs-Fixed: 2517976 Bug: 139417368 Test: run service_test with invalid input Signed-off-by: Harrison Lingren <hlingren@google.com> Change-Id: Iba254b3579cd2c258c3cf80fe234a0de7d75e599
Diffstat (limited to 'msm8998')
-rw-r--r--msm8998/sdm/libs/hwc2/hwc_session.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/msm8998/sdm/libs/hwc2/hwc_session.cpp b/msm8998/sdm/libs/hwc2/hwc_session.cpp
index 0a8576ce..5c9f9545 100644
--- a/msm8998/sdm/libs/hwc2/hwc_session.cpp
+++ b/msm8998/sdm/libs/hwc2/hwc_session.cpp
@@ -992,7 +992,7 @@ android::status_t HWCSession::HandleSetActiveDisplayConfig(const android::Parcel
int dpy = input_parcel->readInt32();
int error = android::BAD_VALUE;
- if (dpy > HWC_DISPLAY_VIRTUAL) {
+ if (dpy < HWC_DISPLAY_PRIMARY || dpy > HWC_DISPLAY_VIRTUAL) {
return android::BAD_VALUE;
}
@@ -1011,7 +1011,7 @@ android::status_t HWCSession::HandleGetActiveDisplayConfig(const android::Parcel
int dpy = input_parcel->readInt32();
int error = android::BAD_VALUE;
- if (dpy > HWC_DISPLAY_VIRTUAL) {
+ if (dpy < HWC_DISPLAY_PRIMARY || dpy > HWC_DISPLAY_VIRTUAL) {
return android::BAD_VALUE;
}
@@ -1031,7 +1031,7 @@ android::status_t HWCSession::HandleGetDisplayConfigCount(const android::Parcel
int dpy = input_parcel->readInt32();
int error = android::BAD_VALUE;
- if (dpy > HWC_DISPLAY_VIRTUAL) {
+ if (dpy < HWC_DISPLAY_PRIMARY || dpy > HWC_DISPLAY_VIRTUAL) {
return android::BAD_VALUE;
}
@@ -1055,7 +1055,7 @@ android::status_t HWCSession::HandleGetDisplayAttributesForConfig(const android:
int error = android::BAD_VALUE;
DisplayConfigVariableInfo display_attributes;
- if (dpy > HWC_DISPLAY_VIRTUAL) {
+ if (dpy < HWC_DISPLAY_PRIMARY || dpy > HWC_DISPLAY_VIRTUAL) {
return android::BAD_VALUE;
}