summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStacie Mashnitskaya <mashnitskaya@google.com>2021-01-30 03:59:21 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-01-30 03:59:21 +0000
commit547b35232aac7576d46928aae8005a5ff858a12b (patch)
tree894eba4826a52a0f10f18c06e0e817fccddf2536
parentfccc0638057b6cf29431db1ae7f3712ae059d1e7 (diff)
parent9d06c3ef54f993d6e05e1167229f2da4ed621a54 (diff)
downloadcts-547b35232aac7576d46928aae8005a5ff858a12b.tar.gz
Revert "STS test update for CVE-2020-0461" am: 445294cc28 am: 9129802a07 am: 9d06c3ef54
Original change: https://googleplex-android-review.googlesource.com/c/platform/cts/+/13438582 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I011f77ff181a207c1450127d30974fd0a35e483b
-rw-r--r--hostsidetests/securitybulletin/src/android/security/cts/CVE_2020_0461.java27
1 files changed, 21 insertions, 6 deletions
diff --git a/hostsidetests/securitybulletin/src/android/security/cts/CVE_2020_0461.java b/hostsidetests/securitybulletin/src/android/security/cts/CVE_2020_0461.java
index 81100e60a4b..92aa6263b4d 100644
--- a/hostsidetests/securitybulletin/src/android/security/cts/CVE_2020_0461.java
+++ b/hostsidetests/securitybulletin/src/android/security/cts/CVE_2020_0461.java
@@ -33,14 +33,29 @@ public class CVE_2020_0461 extends SecurityTestCase {
* b/162741784
*/
@Test
- @SecurityTest(minPatchLevel = "2020-12")
+ @SecurityTest(minPatchLevel = "2020-11")
public void testPocCVE_2020_0461() throws Exception {
+ //conditions
+ String cpu = AdbUtils.runCommandLine("getprop ro.product.cpu.abi", getDevice());
+ assumeThat(cpu, equalTo("arm64-v8a"));
+ assumeTrue(containsDriver(getDevice(), "/proc/config.gz"));
assumeTrue(containsDriver(getDevice(),
- "/sys/devices/system/cpu/vulnerabilities/meltdown"));
+ "/sys/devices/system/cpu/vulnerabilities/meltdown"));
String meltdown = AdbUtils.runCommandLine(
- "cat /sys/devices/system/cpu/vulnerabilities/meltdown", getDevice());
- assertFalse(meltdown.startsWith("Vulnerable"));
- assertTrue(meltdown.startsWith("Not affected") ||
- meltdown.startsWith("Mitigation"));
+ "cat /sys/devices/system/cpu/vulnerabilities/meltdown", getDevice());
+ assumeThat(meltdown, equalTo("Vulnerable"));
+
+ //test
+ AdbUtils.runCommandLine("cp /proc/config.gz /data/local/tmp", getDevice());
+ AdbUtils.runCommandLine("gunzip /data/local/tmp/config.gz", getDevice());
+ String output = AdbUtils.runCommandLine(
+ "grep CONFIG_UNMAP_KERNEL_AT_EL0 /data/local/tmp/config", getDevice());
+ AdbUtils.runCommandLine("rm /data/local/tmp/config", getDevice());
+
+ // This is a bad output
+ // "" - empty output
+ // "CONFIG_UNMAP_KERNEL_AT_EL0 is not set"
+ assertFalse(output.isEmpty());
+ assertNotMatches("is not set", output);
}
}