Sanjeev Kumar | 5337ebf | 2018-03-28 15:15:46 +0530 | [diff] [blame] | 1 | /** |
Christopher Dombroski | 1e57770 | 2020-02-26 14:03:23 -0800 | [diff] [blame] | 2 | * Copyright (C) 2020 The Android Open Source Project |
Sanjeev Kumar | 5337ebf | 2018-03-28 15:15:46 +0530 | [diff] [blame] | 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 | package android.security.cts; |
| 17 | |
| 18 | import android.platform.test.annotations.SecurityTest; |
Christopher Dombroski | 1e57770 | 2020-02-26 14:03:23 -0800 | [diff] [blame] | 19 | import org.junit.Test; |
| 20 | import org.junit.runner.RunWith; |
| 21 | import com.android.tradefed.testtype.DeviceJUnit4ClassRunner; |
Sanjeev Kumar | 5337ebf | 2018-03-28 15:15:46 +0530 | [diff] [blame] | 22 | |
Christopher Dombroski | 1e57770 | 2020-02-26 14:03:23 -0800 | [diff] [blame] | 23 | import static org.junit.Assert.*; |
| 24 | |
| 25 | @RunWith(DeviceJUnit4ClassRunner.class) |
Sanjeev Kumar | 5337ebf | 2018-03-28 15:15:46 +0530 | [diff] [blame] | 26 | public class Poc16_04 extends SecurityTestCase { |
| 27 | |
| 28 | /** |
| 29 | * b/26323455 |
| 30 | */ |
Christopher Dombroski | 1e57770 | 2020-02-26 14:03:23 -0800 | [diff] [blame] | 31 | @Test |
Max Spector | 6962ed7 | 2018-11-06 20:41:57 -0800 | [diff] [blame] | 32 | @SecurityTest(minPatchLevel = "2016-04") |
Sanjeev Kumar | 5337ebf | 2018-03-28 15:15:46 +0530 | [diff] [blame] | 33 | public void testPocCVE_2016_2419() throws Exception { |
| 34 | AdbUtils.runCommandLine("logcat -c" , getDevice()); |
| 35 | AdbUtils.runPoc("CVE-2016-2419", getDevice(), 60); |
| 36 | String logcat = AdbUtils.runCommandLine("logcat -d", getDevice()); |
akirilov | f71f465 | 2018-12-19 11:27:44 -0800 | [diff] [blame] | 37 | assertNotMatchesMultiLine("IOMX_InfoLeak b26323455", logcat); |
Sanjeev Kumar | 5337ebf | 2018-03-28 15:15:46 +0530 | [diff] [blame] | 38 | } |
manish | a11b146 | 2018-03-20 12:42:52 +0530 | [diff] [blame] | 39 | |
| 40 | /** |
| 41 | * b/26324307 |
| 42 | */ |
Christopher Dombroski | 1e57770 | 2020-02-26 14:03:23 -0800 | [diff] [blame] | 43 | @Test |
Max Spector | 6962ed7 | 2018-11-06 20:41:57 -0800 | [diff] [blame] | 44 | @SecurityTest(minPatchLevel = "2016-04") |
manish | a11b146 | 2018-03-20 12:42:52 +0530 | [diff] [blame] | 45 | public void testPocCVE_2016_0844() throws Exception { |
| 46 | AdbUtils.runPoc("CVE-2016-0844", getDevice(), 60); |
| 47 | } |
Karthick Pandiarajan | 7631ec3 | 2018-08-20 15:42:58 +0530 | [diff] [blame] | 48 | |
| 49 | /** |
| 50 | * b/26593930 |
| 51 | */ |
Christopher Dombroski | 1e57770 | 2020-02-26 14:03:23 -0800 | [diff] [blame] | 52 | @Test |
Max Spector | 6962ed7 | 2018-11-06 20:41:57 -0800 | [diff] [blame] | 53 | @SecurityTest(minPatchLevel = "2016-04") |
Karthick Pandiarajan | 7631ec3 | 2018-08-20 15:42:58 +0530 | [diff] [blame] | 54 | public void testPocCVE_2016_2412() throws Exception { |
Christopher Dombroski | 0b5e86a | 2019-07-25 16:48:56 -0700 | [diff] [blame] | 55 | AdbUtils.runPocAssertNoCrashes("CVE-2016-2412", getDevice(), "system_server"); |
Karthick Pandiarajan | 7631ec3 | 2018-08-20 15:42:58 +0530 | [diff] [blame] | 56 | } |
Sanjeev Kumar | 5337ebf | 2018-03-28 15:15:46 +0530 | [diff] [blame] | 57 | } |