
CVE-2019-2215 poc for Huawei hardened kernel
Temporary root for Huawei hardened kernel via CVE-2019-2215
This code is written for P20 Pro (CLT-AL00), and kernel offset is taken from firmware with build fingerprint: 'HUAWEI/CLT-AL00/HWCLT:8.1.0/HUAWEICLT-AL00/176(C00):user/release-keys'
Like Samsung's KNOX, Huawei added many mechanisms to prevent exploit from hackers and improve 'security'.
kti_offset (like KASLR)KERNEL_DS or USER_DS, changing current_thread_info()->addr_limit will not workcommit_creds()ss_initialized policydb->permissive_map security_hook_headsThese mechanisms make it hard to exploit old Huawei devices even if they are vulnerable to CVE-2019-2215.
First, compile and run patch_system.c, this will nullify selinux by messing selinux mapping and calling avc_ss_reset().
Next, compile and run poc.c to get root shell.
(Optional) Compile su daemon and start it by poc to allow other apps using root (see scripts/termux-boot).
The su daemon is taken and modified from https://github.com/corellium/sud