summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVarun Praveen Goyal <varun.goyal@ittiam.com>2021-03-03 13:10:57 +0530
committerStacie Mashnitskaya <mashnitskaya@google.com>2021-10-07 19:28:47 -0700
commit540c699d631fae02b6b93672cbe7374c65a59760 (patch)
treed6dad4c39d10274a41a9e27ea1c887df51299e44
parenta82d6072bc9bbb543ac7307af8b915d4be5bb6db (diff)
downloadcts-540c699d631fae02b6b93672cbe7374c65a59760.tar.gz
[RESTRICT AUTOMERGE] CTS test for Android Security b/112160868
Bug: 112160868 Bug: 121267261 Test: Ran the new testcase on android-9.0.0_r39 to test with/without patch Change-Id: I6364efd8851284fc3b7b7ed0c6f6eab6aaf10417
-rw-r--r--hostsidetests/securitybulletin/securityPatch/CVE-2018-9549/Android.mk35
-rw-r--r--hostsidetests/securitybulletin/securityPatch/CVE-2018-9549/poc.cpp43
-rw-r--r--hostsidetests/securitybulletin/src/android/security/cts/CVE_2018_9549.java44
3 files changed, 122 insertions, 0 deletions
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2018-9549/Android.mk b/hostsidetests/securitybulletin/securityPatch/CVE-2018-9549/Android.mk
new file mode 100644
index 00000000000..02fa27a931c
--- /dev/null
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2018-9549/Android.mk
@@ -0,0 +1,35 @@
+# Copyright (C) 2021 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE:= CVE-2018-9549
+LOCAL_SRC_FILES := poc.cpp
+LOCAL_MULTILIB := both
+LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
+LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
+LOCAL_C_INCLUDES := external/aac/libSBRdec/src
+LOCAL_C_INCLUDES += external/aac/libSBRdec/include
+LOCAL_C_INCLUDES += external/aac/libFDK/include
+LOCAL_C_INCLUDES += external/aac/libSYS/include
+LOCAL_SHARED_LIBRARIES := libbluetooth
+
+# Tag this module as a cts test artifact
+LOCAL_COMPATIBILITY_SUITE := cts sts vts
+LOCAL_CTS_TEST_PACKAGE := android.security.cts
+
+LOCAL_ARM_MODE := arm
+LOCAL_CFLAGS := -Wall -Werror
+include $(BUILD_CTS_EXECUTABLE)
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2018-9549/poc.cpp b/hostsidetests/securitybulletin/securityPatch/CVE-2018-9549/poc.cpp
new file mode 100644
index 00000000000..11165d29065
--- /dev/null
+++ b/hostsidetests/securitybulletin/securityPatch/CVE-2018-9549/poc.cpp
@@ -0,0 +1,43 @@
+/**
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdlib.h>
+#include "lpp_tran.h"
+
+constexpr uint8_t kDegreeAliasMaxSize = 64;
+
+int main() {
+ FIXP_DBL qmfBufferRealVal = {};
+ FIXP_DBL *qmfBufferReal = &qmfBufferRealVal;
+ FIXP_DBL qmfBufferImagVal = {};
+ FIXP_DBL *qmfBufferImag = &qmfBufferImagVal;
+ QMF_SCALE_FACTOR sbrScaleFactor = {};
+ FIXP_DBL degreeAlias[kDegreeAliasMaxSize] = {};
+
+ SBR_LPP_TRANS hLppTransVal = {};
+ HANDLE_SBR_LPP_TRANS hLppTrans = &hLppTransVal;
+ TRANSPOSER_SETTINGS settings = {};
+ for (int32_t i = 0; i < MAX_NUM_NOISE_VALUES; ++i) {
+ settings.bwBorders[i] = 64;
+ }
+ settings.nCols = 1;
+ hLppTrans->pSettings = &settings;
+
+ lppTransposer(hLppTrans, &sbrScaleFactor, &qmfBufferReal, degreeAlias, &qmfBufferImag, 1, 0, 0,
+ 0, 0, 0, 0, nullptr, nullptr);
+
+ return EXIT_SUCCESS;
+}
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/CVE_2018_9549.java b/hostsidetests/securitybulletin/src/android/security/cts/CVE_2018_9549.java
new file mode 100644
index 00000000000..ea97acfd297
--- /dev/null
+++ b/hostsidetests/securitybulletin/src/android/security/cts/CVE_2018_9549.java
@@ -0,0 +1,44 @@
+/**
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.security.cts;
+
+import android.platform.test.annotations.AsbSecurityTest;
+import com.android.compatibility.common.util.CrashUtils;
+import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
+import org.junit.runner.RunWith;
+import org.junit.Test;
+
+@RunWith(DeviceJUnit4ClassRunner.class)
+public class CVE_2018_9549 extends SecurityTestCase {
+
+ /**
+ * b/112160868
+ * Vulnerability Behaviour: SIGABRT in self
+ */
+ @AsbSecurityTest(cveBugId = 112160868)
+ @Test
+ public void testPocCVE_2018_9549() throws Exception {
+ String binaryName = "CVE-2018-9549";
+ String signals[] = {CrashUtils.SIGABRT};
+ AdbUtils.pocConfig testConfig = new AdbUtils.pocConfig(binaryName, getDevice());
+ testConfig.config = new CrashUtils.Config().setProcessPatterns(binaryName);
+ testConfig.config.setSignals(signals);
+ testConfig.config.setAbortMessageIncludes(
+ AdbUtils.escapeRegexSpecialChars("ubsan: mul-overflow"));
+ AdbUtils.runPocAssertNoCrashesNotVulnerable(testConfig);
+ }
+}