blob: aa0007d6ed900e0f1cd41eeb558b87e8d274275d [file] [log] [blame]
/**
* Copyright (C) 2017 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 Poc17_05 extends SecurityTestCase {
/**
* b/34705519
*/
@SecurityTest
public void testPocCve_2017_0595() throws Exception {
AdbUtils.runCommandLine("logcat -c" , getDevice());
AdbUtils.runPocNoOutput("CVE-2017-0595", getDevice(), 60);
String logcatOut = AdbUtils.runCommandLine("logcat -d", getDevice());
assertNotMatches("[\\s\\n\\S]*Fatal signal 11 \\(SIGSEGV\\)" +
"[\\s\\n\\S]*>>> /system/bin/" +
"mediaserver <<<[\\s\\n\\S]*", logcatOut);
}
/**
* b/34749392
*/
@SecurityTest
public void testPocCve_2017_0596() throws Exception {
AdbUtils.runCommandLine("logcat -c" , getDevice());
AdbUtils.runPocNoOutput("CVE-2017-0596", getDevice(), 60);
String logcatOut = AdbUtils.runCommandLine("logcat -d", getDevice());
assertNotMatches("[\\s\\n\\S]*Fatal signal 11 \\(SIGSEGV\\)" +
"[\\s\\n\\S]*>>> /system/bin/" +
"mediaserver <<<[\\s\\n\\S]*", logcatOut);
}
/**
* b/34277115
*/
@SecurityTest
public void testPocCVE_2017_0630() throws Exception {
if (containsDriver(getDevice(), "/sys/kernel/debug/tracing/printk_formats")) {
String commandOutput = AdbUtils.runCommandLine("cat /sys/kernel/debug/tracing" +
"/printk_formats", getDevice());
assertNotMatchesMultiLine(".*0x(?!0){8,16}[0-9a-fA-F]{8,16} : .*", commandOutput);
}
}
}