blob: b0f0ddca6c0236dd2d6ca42359d31a9698d73070 [file] [log] [blame]
Sanjeev Kumar5337ebf2018-03-28 15:15:46 +05301/**
Christopher Dombroski1e577702020-02-26 14:03:23 -08002 * Copyright (C) 2020 The Android Open Source Project
Sanjeev Kumar5337ebf2018-03-28 15:15:46 +05303 *
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 */
16package android.security.cts;
17
18import android.platform.test.annotations.SecurityTest;
Christopher Dombroski1e577702020-02-26 14:03:23 -080019import org.junit.Test;
20import org.junit.runner.RunWith;
21import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
Sanjeev Kumar5337ebf2018-03-28 15:15:46 +053022
Christopher Dombroski1e577702020-02-26 14:03:23 -080023import static org.junit.Assert.*;
24
25@RunWith(DeviceJUnit4ClassRunner.class)
Sanjeev Kumar5337ebf2018-03-28 15:15:46 +053026public class Poc16_04 extends SecurityTestCase {
27
28 /**
29 * b/26323455
30 */
Christopher Dombroski1e577702020-02-26 14:03:23 -080031 @Test
Max Spector6962ed72018-11-06 20:41:57 -080032 @SecurityTest(minPatchLevel = "2016-04")
Sanjeev Kumar5337ebf2018-03-28 15:15:46 +053033 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());
akirilovf71f4652018-12-19 11:27:44 -080037 assertNotMatchesMultiLine("IOMX_InfoLeak b26323455", logcat);
Sanjeev Kumar5337ebf2018-03-28 15:15:46 +053038 }
manisha11b1462018-03-20 12:42:52 +053039
40 /**
41 * b/26324307
42 */
Christopher Dombroski1e577702020-02-26 14:03:23 -080043 @Test
Max Spector6962ed72018-11-06 20:41:57 -080044 @SecurityTest(minPatchLevel = "2016-04")
manisha11b1462018-03-20 12:42:52 +053045 public void testPocCVE_2016_0844() throws Exception {
46 AdbUtils.runPoc("CVE-2016-0844", getDevice(), 60);
47 }
Karthick Pandiarajan7631ec32018-08-20 15:42:58 +053048
49 /**
50 * b/26593930
51 */
Christopher Dombroski1e577702020-02-26 14:03:23 -080052 @Test
Max Spector6962ed72018-11-06 20:41:57 -080053 @SecurityTest(minPatchLevel = "2016-04")
Karthick Pandiarajan7631ec32018-08-20 15:42:58 +053054 public void testPocCVE_2016_2412() throws Exception {
Christopher Dombroski0b5e86a2019-07-25 16:48:56 -070055 AdbUtils.runPocAssertNoCrashes("CVE-2016-2412", getDevice(), "system_server");
Karthick Pandiarajan7631ec32018-08-20 15:42:58 +053056 }
Sanjeev Kumar5337ebf2018-03-28 15:15:46 +053057}