package fuzion24.device.vulnerability.vulnerabilities.kernel;

import android.content.Context;

import fuzion24.device.vulnerability.vulnerabilities.VulnerabilityTest;

/**
 * Created by fuzion24 on 8/24/15.
 */
public class CVE_2015_3636 implements VulnerabilityTest {
    static {
        System.loadLibrary("pingpong");
    }

    /*
       Fix: https://github.com/torvalds/linux/commit/a134f083e79fb4c3d0a925691e732c56911b4326
       Discussion: http://www.openwall.com/lists/oss-security/2015/05/02/11
       implementation: https://github.com/scoty755/libping_unhash_exploit_POC
     */
    @Override
    public String getName() {
        return "CVE-2014-3636/pingpong";
    }

    private native int checkPingPong();

    @Override
    public boolean isVulnerable(Context context) throws Exception {
        int checkVal = checkPingPong();

        if(checkVal == 0) {
            return false;
        }else if(checkVal == 1) {
            return true;
        }else {
            throw new Exception("Error running test. Errno: " + checkVal);
        }
    }
}
@@ -653,17 +653,17 @@
 %22CVE-201
-4
+5
 -3636/pi
@@ -1063,8 +1063,9 @@
 %0A    %7D%0A%7D
+%0A

fix typo