Removing Testcase from CTS test for Android Security b/72507701 b/27364029

Moved into STS domain.
Test: successful build with removed CTS test case.
Bug: 72507701
Bug: 27364029

Change-Id: If8697b808ed4d263f0cd1365aec2445c3c3f3b45
Signed-off-by: Mikhail Maryakhin <mmaryakhin@google.com>
diff --git a/hostsidetests/securitybulletin/AndroidTest.xml b/hostsidetests/securitybulletin/AndroidTest.xml
index fc008c6..70e471a 100644
--- a/hostsidetests/securitybulletin/AndroidTest.xml
+++ b/hostsidetests/securitybulletin/AndroidTest.xml
@@ -56,7 +56,6 @@
         <!--__________________-->
         <!-- Bulletin 2016-06 -->
         <!-- Please add tests solely from this bulletin below to avoid merge conflict -->
-        <option name="push" value="CVE-2016-2062->/data/local/tmp/CVE-2016-2062" />
 
         <!--__________________-->
         <!-- Bulletin 2016-07 -->
diff --git a/hostsidetests/securitybulletin/securityPatch/CVE-2016-2062/Android.mk b/hostsidetests/securitybulletin/securityPatch/CVE-2016-2062/Android.mk
deleted file mode 100755
index 5e53ee5..0000000
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2016-2062/Android.mk
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright (C) 2018 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-2016-2062
-LOCAL_SRC_FILES := poc.c
-LOCAL_MULTILIB := both
-LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
-LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
-
-LOCAL_SHARED_LIBRARIES := liblog
-
-# 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-2016-2062/poc.c b/hostsidetests/securitybulletin/securityPatch/CVE-2016-2062/poc.c
deleted file mode 100644
index d8bdbdb..0000000
--- a/hostsidetests/securitybulletin/securityPatch/CVE-2016-2062/poc.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/**
- * Copyright (C) 2018 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.
- */
-
-#define _GNU_SOURCE
-
-#define LOG_TAG "CVE-2016-2062"
-
-#include <errno.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <cutils/log.h>
-
-struct kgsl_perfcounter_query {
-  unsigned int groupid;
-  /* Array to return the current countable for up to size counters */
-  unsigned int *countables;
-  unsigned int count;
-  unsigned int max_counters;
-  /* private: reserved for future use */
-  unsigned int __pad[2]; /* For future binary compatibility */
-};
-
-/* ioctls
- * Refer msm_kgsl.h
- */
-#define KGSL_IOC_TYPE 0x09
-#define IOCTL_KGSL_PERFCOUNTER_QUERY                                           \
-  _IOWR(KGSL_IOC_TYPE, 0x3A, struct kgsl_perfcounter_query)
-
-int main() {
-  int fd, ret;
-  struct kgsl_perfcounter_query perf_query;
-
-  fd = open("/dev/kgsl-3d0", O_RDWR);
-  if (fd < 0) {
-    ALOGE("Unable to open /dev/kgsl-3d0 - Errno %d (%s)\n", errno,
-           strerror(errno));
-    exit(EXIT_FAILURE);
-  }
-
-  memset(&perf_query, 0, sizeof(struct kgsl_perfcounter_query));
-
-  /* setup sane params to pass a few checks
-   * set count=0 and countables=NULL to get max_counters
-   * value to allocate memory for countables
-   */
-  perf_query.groupid = 1;
-  perf_query.count = 0;
-  perf_query.countables = NULL;
-
-  ret = ioctl(fd, IOCTL_KGSL_PERFCOUNTER_QUERY, &perf_query);
-  if (ret < 0) {
-    ALOGE("Error ioctl failed %d (%s)\n", errno,
-           strerror(errno));
-  } else {
-    // Make sure the max_counters within the limit [1:1000]
-    if(perf_query.max_counters > 0 &&
-        perf_query.max_counters < 1000) {
-      perf_query.countables = (unsigned int*) malloc(
-            perf_query.max_counters * sizeof(unsigned int));
-      if(perf_query.countables == NULL) {
-        ALOGE("malloc failed\n");
-      } else {
-        /* bad data creates out of memory issue
-         * Errno 12 (out of memory)
-         */
-        perf_query.count = 0x80000001;
-
-        ret = ioctl(fd, IOCTL_KGSL_PERFCOUNTER_QUERY, &perf_query);
-        if (ret < 0 && errno == 12) { //ENOMEM(12) error
-          ALOGE("CVE-2016-2062 failed\n");
-        } else {
-          ALOGE("CVE-2016-2062 passed\n");
-        }
-      }
-    }
-  }
-
-  if(NULL != perf_query.countables) {
-    free(perf_query.countables);
-    perf_query.countables = NULL;
-  }
-
-  if (fd > -1)
-    close(fd);
-
-  return EXIT_SUCCESS;
-}
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/Poc16_06.java b/hostsidetests/securitybulletin/src/android/security/cts/Poc16_06.java
deleted file mode 100644
index 8c22dfb..0000000
--- a/hostsidetests/securitybulletin/src/android/security/cts/Poc16_06.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- * Copyright (C) 2018 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.SecurityTest;
-
-@SecurityTest
-public class Poc16_06 extends SecurityTestCase {
-
-    /**
-     * b/27364029
-     */
-    @SecurityTest
-    public void testPocCVE_2016_2062() throws Exception {
-        if (containsDriver(getDevice(), "/dev/kgsl-3d0")) {
-            AdbUtils.runCommandLine("logcat -c" , getDevice());
-            AdbUtils.runPoc("CVE-2016-2062", getDevice(), 60);
-            String logcat = AdbUtils.runCommandLine("logcat -d", getDevice());
-            assertMatches("[\\s\\n\\S]*CVE-2016-2062 passed[\\s\\n\\S]*", logcat);
-        }
-    }
-}