1 /** 2 * Copyright (C) 2016 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package android.security.cts; 18 19 import android.platform.test.annotations.SecurityTest; 20 21 @SecurityTest 22 public class Poc16_10 extends SecurityTestCase { 23 24 /** 25 * b/30904789 26 */ 27 @SecurityTest 28 public void testPocCVE_2016_6730() throws Exception { 29 if(containsDriver(getDevice(), "/dev/dri/renderD129")) { 30 AdbUtils.runPoc("CVE-2016-6730", getDevice(), 60); 31 } 32 } 33 34 /** 35 * b/30906023 36 */ 37 @SecurityTest 38 public void testPocCVE_2016_6731() throws Exception { 39 if(containsDriver(getDevice(), "/dev/dri/renderD129")) { 40 AdbUtils.runPoc("CVE-2016-6731", getDevice(), 60); 41 } 42 } 43 44 /** 45 * b/30906599 46 */ 47 @SecurityTest 48 public void testPocCVE_2016_6732() throws Exception { 49 if(containsDriver(getDevice(), "/dev/dri/renderD129")) { 50 AdbUtils.runPoc("CVE-2016-6732", getDevice(), 60); 51 } 52 } 53 54 /** 55 * b/30906694 56 */ 57 @SecurityTest 58 public void testPocCVE_2016_6733() throws Exception { 59 if(containsDriver(getDevice(), "/dev/dri/renderD129")) { 60 AdbUtils.runPoc("CVE-2016-6733", getDevice(), 60); 61 } 62 } 63 64 /** 65 * b/30907120 66 */ 67 @SecurityTest 68 public void testPocCVE_2016_6734() throws Exception { 69 if(containsDriver(getDevice(), "/dev/dri/renderD129")) { 70 AdbUtils.runPoc("CVE-2016-6734", getDevice(), 60); 71 } 72 } 73 74 /** 75 * b/30907701 76 */ 77 @SecurityTest 78 public void testPocCVE_2016_6735() throws Exception { 79 if(containsDriver(getDevice(), "/dev/dri/renderD129")) { 80 AdbUtils.runPoc("CVE-2016-6735", getDevice(), 60); 81 } 82 } 83 84 /** 85 * b/30953284 86 */ 87 @SecurityTest 88 public void testPocCVE_2016_6736() throws Exception { 89 if(containsDriver(getDevice(), "/dev/dri/renderD129")) { 90 AdbUtils.runPoc("CVE-2016-6736", getDevice(), 60); 91 } 92 } 93 94 /** 95 * b/30741779 96 */ 97 @SecurityTest 98 public void testPocCVE_2016_3916() throws Exception { 99 AdbUtils.installApk("/cve_2016_3916.apk", getDevice()); 100 AdbUtils.runCommandLine("logcat -c" , getDevice()); 101 102 AdbUtils.runCommandLine("am start -n com.trendmicro.wish_wu.camera2/" + 103 "com.trendmicro.wish_wu.camera2.Camera2TestActivity", getDevice()); 104 Thread.sleep(10000); 105 String logcat = AdbUtils.runCommandLine("logcat -d", getDevice()); 106 assertNotMatches("[\\s\\n\\S]*Fatal signal 11 \\(SIGSEGV\\)" + 107 "[\\s\\n\\S]*>>> /system/bin/" + 108 "mediaserver <<<[\\s\\n\\S]*", logcat); 109 } 110 } 111