Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Wednesday, 6 March 2019

Kali Linux - Hacking over WAN [SETOOLKIT + NGROK]

Kali Linux - Hacking over WAN [SETOOLKIT + NGROK]. Kali NetHunter Port Forwarding with Ngrok on Android 2017

Kali Linux - Hacking over WAN [SETOOLKIT + NGROK] video duration 2 Minute(s) 27 Second(s), published by Kali Linux Tutorials on 20 09 2017 - 16:54:33.

link: https://ngrok.com/ This video is for educational purposes only! I'm not responsible for your actions.. Curso Hacker grátis: https://goo.gl/EPyrGA Download ngrok e mais informações: https://goo.gl/hYV0pX Doe bitcoin para o canal: ...

Link : https://www.metasploit.com/ https://ngrok.com/ https://www.kali.org.. Today i m going to show how to hack over the WAN network..
Using setoolkit and Ngrok ( its use for WAN network) which Wan attack you can hack any facebook .... Kali NetHunter Port Forwarding with Ngrok on Android 2017 How To Port Port Forwarding on Kali Nethunter using Ngrok on Android 2017 Hello Everyone, ...

Other Video about Kali Linux - Hacking over WAN [SETOOLKIT + NGROK]:

Using WAN Ngrok & Setoolkit on Kalilinux

Using WAN Ngrok & Setoolkit on Kalilinux

Today i m going to show how to hack over the WAN network..
Using setoolkit and Ngrok ( its use for WAN network) which Wan attack you can hack any facebook ...

Kali NetHunter Port Forwarding with Ngrok on Android 2017

Kali NetHunter Port Forwarding with Ngrok on Android 2017

Kali NetHunter Port Forwarding with Ngrok on Android 2017 How To Port Port Forwarding on Kali Nethunter using Ngrok on Android 2017 Hello Everyone, ...

Como instalar ngrok | Hackeando Android sem abrir portas do roteador

Como instalar ngrok | Hackeando Android sem abrir portas do roteador

Curso Hacker grátis: https://goo.gl/EPyrGA Download ngrok e mais informações: https://goo.gl/hYV0pX Doe bitcoin para o canal: ...

Hacking Any Android Public IP - Metasploit - Ngrok - Kali Linux

Hacking Any Android Public IP - Metasploit - Ngrok - Kali Linux

Link : https://www.metasploit.com/ https://ngrok.com/ https://www.kali.org.

Tuesday, 5 March 2019

Hack any android phone on internet with kali linux 2018

Hack any android phone on internet with kali linux 2018. port açmadan ve ip sabitlemeden metasploit ile dış ağ hack-ngrok ve metasploit ile dış ağ hack

Hack any android phone on internet with kali linux 2018 video duration 5 Minute(s) 40 Second(s), published by SUNIL THE IT GUY on 14 02 2018 - 13:43:40.

Hack any android phone on internet with kali linux 2018 APP LINK:http://corneey.com/wkze7P TAGS how to hack android phone in hindi, how to hack android .... This video is about "How to change IP ADDRESS ON ANDROID" -------------------------------------- If you have any question related to this video plz comment down ...

Tricks for tracking an IP address of any Android device.. MORE INFORMATION HOW TO HACK IP ADDRESS ON ANDROID DEVICE/PHOHE USING TERMINAL EMULATOR :-http://adf.ly/1LI5sp Google Play Store .... BU KANALDA GÖSTERİLEN HACK VİDEOLARI EĞİTİM AMACIYLA ÇEKİLMİŞTİR.İNSANLARIN KENDİ KENDİNİ GELİŞTİRMESİ VE TERSİNE MÜHENDİSLİK ...

Other Video about Hack any android phone on internet with kali linux 2018:

HOW TO HACK IP ADDRESS ON ANDROID DEVICE

HOW TO HACK IP ADDRESS ON ANDROID DEVICE

MORE INFORMATION HOW TO HACK IP ADDRESS ON ANDROID DEVICE/PHOHE USING TERMINAL EMULATOR :-http://adf.ly/1LI5sp Google Play Store ...

port açmadan ve ip sabitlemeden metasploit ile dış ağ hack-ngrok ve metasploit ile dış ağ hack

port açmadan ve ip sabitlemeden metasploit ile dış ağ hack-ngrok ve metasploit ile dış ağ hack

BU KANALDA GÖSTERİLEN HACK VİDEOLARI EĞİTİM AMACIYLA ÇEKİLMİŞTİR.İNSANLARIN KENDİ KENDİNİ GELİŞTİRMESİ VE TERSİNE MÜHENDİSLİK ...

100% working trick How to change IP ADDRESS ON ANDROID 2017 || by Hack Tech World

100% working trick How to change IP ADDRESS ON ANDROID 2017 || by Hack Tech World

This video is about "How to change IP ADDRESS ON ANDROID" -------------------------------------- If you have any question related to this video plz comment down ...

Track and hack an IP address of any Android device

Track and hack an IP address of any Android device

Tricks for tracking an IP address of any Android device.

شرح تحويل الايبي من وهمي الى حقيقي في الكالي لينكس kali linux

شرح تحويل الايبي من وهمي الى حقيقي في الكالي لينكس kali linux. How to hack any android phone using Kali Linux?

شرح تحويل الايبي من وهمي الى حقيقي في الكالي لينكس kali linux video duration 5 Minute(s) 44 Second(s), published by Ragheb Guerfi on 30 06 2018 - 10:28:18.

kali linux kali linux download kali linux apk kali linux tools kali linux source list kali linux vmware kali linux 2018.2 kali linux ماهو kali linux شرح kali linux android ....

Please Like share and Subscribe |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||.... . How to Hack android mobile using Kali Linux (Penetration Testing)
Step 1:Open Command Terminal in Kali and Write the command ifconfig and hit enter.

Other Video about شرح تحويل الايبي من وهمي الى حقيقي في الكالي لينكس kali linux:

Soft

Soft



How to hack any android phone using Kali Linux?

How to hack any android phone using Kali Linux?

How to Hack android mobile using Kali Linux (Penetration Testing)
Step 1:Open Command Terminal in Kali and Write the command ifconfig and hit enter.

Hack videos android

Hack videos android



install kali Linux all tools on android || without root || hindi tutorial

install kali Linux all tools on android || without root || hindi tutorial

Please Like share and Subscribe |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||...

Thursday, 28 February 2019

How to hack android device with FatRat on kali linux 2

How to hack android device with FatRat on kali linux 2. How to hack ip address on android using (terminal emulator) HD - august 2016

How to hack android device with FatRat on kali linux 2 video duration 7 Minute(s) 41 Second(s), published by KALI LINUX TRICKS on 01 09 2016 - 13:52:25.

How to hack android device with FatRat on kali linux 2 ( ONLY FOR EDUCATIONAL PURPOSES) How to install TheFatRat .... Hacking Android Using Cobaltstrike Public IP hack Android Beda Jaringan Hack Android external Network download singnapk = http://agileurbia.com/ESaI ...

CLASH OF CLANS CLASH OF CLANS HACK CLASH OF CLANS MOD CLASH OF CLANS PRIVATE SERVER ++Other COC Hack: http://www.yyv.co/Ohvr .... This video is about how to hack / change your ip address and browse like a foreign (not your country).
For this you need 1
Android device 2
The app.. Here am going to show you how to use command base language on Android phones..
Terminal emulator How to use terminal emulator Android commands ...

Other Video about How to hack android device with FatRat on kali linux 2:

How to CHANGE / HACK/FREE  IP address ( Android ) FREE

How to CHANGE / HACK/FREE IP address ( Android ) FREE

This video is about how to hack / change your ip address and browse like a foreign (not your country).
For this you need 1
Android device 2
The app.

How to hack ip address on android using (terminal emulator) HD - august 2016

How to hack ip address on android using (terminal emulator) HD - august 2016

Here am going to show you how to use command base language on Android phones..
Terminal emulator How to use terminal emulator Android commands ...

Hacking Android Using Cobaltstrike Public IP

Hacking Android Using Cobaltstrike Public IP

Hacking Android Using Cobaltstrike Public IP hack Android Beda Jaringan Hack Android external Network download singnapk = http://agileurbia.com/ESaI ...

Clash of Clans - Hack/Mod Add IP Address [Tutorial]

Clash of Clans - Hack/Mod Add IP Address [Tutorial]

CLASH OF CLANS CLASH OF CLANS HACK CLASH OF CLANS MOD CLASH OF CLANS PRIVATE SERVER ++Other COC Hack: http://www.yyv.co/Ohvr ...

Install all Kali Linux tools in one click in android termux

Install all Kali Linux tools in one click in android termux. Learn Kali Linux with this app and start hacking with android

Install all Kali Linux tools in one click in android termux video duration 4 Minute(s) 8 Second(s), published by Hack desk on 18 06 2018 - 15:51:42.

Lazymux Lazymux Lazymux tools installer is very easy to use, only provided for lazy termux users
Requirements • Python 2.x Installation and Using Lazymux git .... 1: Create undetectable malware: https://www.youtube.com/watch?v=CoKiV4BzkI4 2: How to hack over WAN: https://www.youtube.com/watch?v=vTCXPsdXcTg ...

Hey Fact Trojan, Today I'm Gonna show you How to Hack any Android Device using Kali Linux! A complete step by step tutorial on Android Hacking with .... Kali Linux - Kali Linux is an debian based linux operating system developed for penetration testers
In this video, we will be downloading kali linux
♢ Kali Linux .... This is a app that can help you too start hacking with this app on android and it can also help you too learn Kali Linux and it also help you too start your hacking ...

Other Video about Install all Kali Linux tools in one click in android termux:

1. Metasploit - Downloading Kali Linux 2018.2 | Priyank Gada

1. Metasploit - Downloading Kali Linux 2018.2 | Priyank Gada

Kali Linux - Kali Linux is an debian based linux operating system developed for penetration testers
In this video, we will be downloading kali linux
♢ Kali Linux ...

Learn Kali Linux with this app and start hacking with android

Learn Kali Linux with this app and start hacking with android

This is a app that can help you too start hacking with this app on android and it can also help you too learn Kali Linux and it also help you too start your hacking ...

Bind FUD Payload with JPG and Hack over WAN: FatRat; Kali Linux

Bind FUD Payload with JPG and Hack over WAN: FatRat; Kali Linux

1: Create undetectable malware: https://www.youtube.com/watch?v=CoKiV4BzkI4 2: How to hack over WAN: https://www.youtube.com/watch?v=vTCXPsdXcTg ...

Hack Any Android Device in less than 5 Minutes With Kali Linux | Ethical Hacking Tutorial

Hack Any Android Device in less than 5 Minutes With Kali Linux | Ethical Hacking Tutorial

Hey Fact Trojan, Today I'm Gonna show you How to Hack any Android Device using Kali Linux! A complete step by step tutorial on Android Hacking with ...

Wednesday, 27 February 2019

Kali Linux 2018 - Hacking Android - Skills For You - Max Dark

Kali Linux 2018 - Hacking Android - Skills For You - Max Dark. Run Kali Linux on Android || July 2018

Kali Linux 2018 - Hacking Android - Skills For You - Max Dark video duration 22 Minute(s) 35 Second(s), published by Max Dark on 02 08 2018 - 12:45:28.

Hacking Android Max Dark:https://bit.ly/2NffvSb Help me 1000 sub Hacking Skills for You Thank you! Help me 1000 Sub!Saraheyo!. hi guys today i am going to show u how to hack android android using kali linux os.

CyberGhosT Hello Holy Hackers, Today I am going to show you how to hack website with SQL injection
Apk Link = https://www.file-upload.com/asdr20r9sh2e .... إشتراك ✓ إعجاب ✓ تعليق ✓ مشاركة · · · · · · ▽▽▽▽▽▽▽▽▽▽▽▽▽▽▽▽▽▽▽▽▽▽▽▽▽▽▽▽▽.... Watch till end and not miss a moment Target 500 Subscribers || Please Contribute Kind Attention, I have started a forum for this channel
You can use that one ...

Other Video about Kali Linux 2018 - Hacking Android - Skills For You - Max Dark:

How To Hack Whatsapp Mobile Number Account On Android

How To Hack Whatsapp Mobile Number Account On Android

إشتراك ✓ إعجاب ✓ تعليق ✓ مشاركة · · · · · · ▽▽▽▽▽▽▽▽▽▽▽▽▽▽▽▽▽▽▽▽▽▽▽▽▽▽▽▽▽...

Run Kali Linux on Android || July 2018

Run Kali Linux on Android || July 2018

Watch till end and not miss a moment Target 500 Subscribers || Please Contribute Kind Attention, I have started a forum for this channel
You can use that one ...

how to hack android using kali linux

how to hack android using kali linux

hi guys today i am going to show u how to hack android android using kali linux os.

SQL injection with Android (Practical)(Android hacking series part 09 )

SQL injection with Android (Practical)(Android hacking series part 09 )

CyberGhosT Hello Holy Hackers, Today I am going to show you how to hack website with SQL injection
Apk Link = https://www.file-upload.com/asdr20r9sh2e ...

How to INSTALL KALI LINUX Hacking tools on ANDROID (NO ROOT)

How to INSTALL KALI LINUX Hacking tools on ANDROID (NO ROOT). BACKDOOR any APK on kali nethunter(Android hacking)

How to INSTALL KALI LINUX Hacking tools on ANDROID (NO ROOT) video duration 6 Minute(s) 1 Second(s), published by Cyber Tech on 25 11 2017 - 08:47:53.

Hey guyzz am cyber tech and today i m gonna show you how to install kali linux tools on android device without root Find out the names of tools for individual .... http://datasecurity.com.mx https://www.facebook.com/seguridadyhacking admin@datasecurity.com.mx LOS PUERTOS QUE DEBEN APERTURARSE EN EL ...

Evil-Droid is a framework that create & generate & embed apk payload to penetrate android platforms
Download : Open terminal and type git clone .... Tutorial de Cómo Instalar Kali Linux en tu Móvil Android y sin ser Root! Suscribete para estar a la última: https://goo.gl/g6YW1g ▻ Links de Utilidad .... backdoor-apk is a shell script that simplifies the process of adding a backdoor to any Android APK file
Users of this shell script should have working knowledge ...

Other Video about How to INSTALL KALI LINUX Hacking tools on ANDROID (NO ROOT):

Como Instalar Kali Linux en tu Móvil SIN ROOT - Hacking Android

Como Instalar Kali Linux en tu Móvil SIN ROOT - Hacking Android

Tutorial de Cómo Instalar Kali Linux en tu Móvil Android y sin ser Root! Suscribete para estar a la última: https://goo.gl/g6YW1g ▻ Links de Utilidad ...

BACKDOOR any  APK on kali nethunter(Android hacking)

BACKDOOR any APK on kali nethunter(Android hacking)

backdoor-apk is a shell script that simplifies the process of adding a backdoor to any Android APK file
Users of this shell script should have working knowledge ...

HACKEAR DISPOSITIVOS ANDROID FUERA DE LA RED LOCAL PARTE 1

HACKEAR DISPOSITIVOS ANDROID FUERA DE LA RED LOCAL PARTE 1

http://datasecurity.com.mx https://www.facebook.com/seguridadyhacking admin@datasecurity.com.mx LOS PUERTOS QUE DEBEN APERTURARSE EN EL ...

Evil-Droid | Hack android using Kali Linux | Part-1

Evil-Droid | Hack android using Kali Linux | Part-1

Evil-Droid is a framework that create & generate & embed apk payload to penetrate android platforms
Download : Open terminal and type git clone ...

Sunday, 24 February 2019

Meterpreter Payliad || Practical || Hack any Android Device || using Kali linux

Meterpreter Payliad || Practical || Hack any Android Device || using Kali linux. Hack Any Android Device in less than 5 Minutes With Kali Linux | Ethical Hacking Tutorial

Meterpreter Payliad || Practical || Hack any Android Device || using Kali linux video duration 10 Minute(s) 50 Second(s), published by Technical MEHRA on 24 05 2018 - 14:40:31.

In this video i am going to show you how to create a Payload and how to hack pc or phone
Follow me on socal networking sites Follow me on Facebook..

Hi guys In this video I have teach u how to install Kali Linux in android without root required I hope u like this video Pls subscriber my channel Limbo .... Disclaimer : This video is just for educational purposes only you are responsible for your actions Redmi 5 best buy
https://amzn.to/2k8zBR0.. Hey Fact Trojan, Today I'm Gonna show you How to Hack any Android Device using Kali Linux! A complete step by step tutorial on Android Hacking with ...

Other Video about Meterpreter Payliad || Practical || Hack any Android Device || using Kali linux:

Kali Linux | Hack android phone with a opening web link without payload | metasploit

Kali Linux | Hack android phone with a opening web link without payload | metasploit

Disclaimer : This video is just for educational purposes only you are responsible for your actions Redmi 5 best buy
https://amzn.to/2k8zBR0.

Hack Any Android Device in less than 5 Minutes With Kali Linux | Ethical Hacking Tutorial

Hack Any Android Device in less than 5 Minutes With Kali Linux | Ethical Hacking Tutorial

Hey Fact Trojan, Today I'm Gonna show you How to Hack any Android Device using Kali Linux! A complete step by step tutorial on Android Hacking with ...

Haw to hack android with link using  kali linux 2018

Haw to hack android with link using kali linux 2018



Install Kali Linux in android without root by Andro Hacker

Install Kali Linux in android without root by Andro Hacker

Hi guys In this video I have teach u how to install Kali Linux in android without root required I hope u like this video Pls subscriber my channel Limbo ...

Saturday, 9 February 2019

What is Linux and Android ?

What is Linux and Android ?


Hello viewers.
In this article I try to solve your doubts about Linux in Android and what is Android ?
So let's get started.

AndroMacMaster

• The Linux Side Of Android 🐧🤖 :

 On a day to day basis we often hear that  Android is a Linux based operating system,  ok maybe not daily but I am sure you have  heard this before. In this post I am going  explain how Android is related to Linux  and how they are different.

AndroMacMaster


• What is Linux exactly ? 

Well Linux is just a kernel, a kernel is the core of an operating system(OS), it is the part that talks to the hardware and makes it possible for other software to run smoothly on a computer. Most Linuxes have four elements: the kernel, the HAL (Hardware abstraction Layer where drivers that are not compiled into the kernel), the Userspace (where applications 'reside'), and finally, the desktop environment or UI (user interface) such as GNOME, KDE, Xfce and others. the userspace is generally GNU  and Linux is the kernel. The Linux kernel was developed in 1991 as an open source operating system for desktop computers by Linus Torvalds.

AndroMacMaster

• What is Android ?

Android is an open source operating system created for mobile devices by Google. The original developer of the Android software, Android, Inc., was purchased by Google, Inc. in 2005. It has been developed based on the Linux 2.6 kernel. 

Basically Android is a modified Linux kernel with functions and APIs to enable it to operate efficiently and effectively on mobile devices. The Linux kernel that runs on Android has been modified primarily for the power needs of mobile devices with small batteries and relatively slower processing power compared to desktop computers (but this is debatable because new generation smartphones are pretty powerful).  Some of the specialized functions and APIs are for interacting with the mobile commications and also to implement a common programming and user interface to help app developers to create apps that run on the countless Android devices out there. The Android gui and package system are built on java from the ground up.

Android is, technically speaking, a distribution of Linux or whats known as a Linux distro. Usually a Linux distro refers to a desktop one like Ubuntu or Arch, but the Linux kernel can be compiled for nearly any architecture (x86, x64, ARMv3/4/etc...) thats why Linux can run almost effortlessly on different hardware including Android phones.

The beauty of Android's design is how little the kernel has been modified. Most embedded systems try to make drastic changes to the kernel. Android is the opposite: only minimal changes are made to the kernel, but the user-space has been completely changed unlike that of any other Linux distros. In fact, Android's user-space is so different from standard Linux, you can easily say that Android is not in any way a Linux system, except for the kernel.

AndroMacMaster


• Some Of The Kernel Modifications in Android 

  - ashmem (Android Shared Memory), a file-based shared memory system.
  - Binder, an inter-process communication (IPC) and remote procedure call (RPC) system.
  - logger, a high-speed in-kernel logging mechanism optimized for writes.
  - Paranoid Networking, a mechanism to restrict network I/O to certain processes.
  - pmem (Physical Memory), a driver for mapping large chunks of physical memory into user-space.
  - Viking Killer, a replacement OOM killer that implements Android's "kill least recently used process" logic under low memory conditions.
  - wakelocks, Android's unique power management solution, in which the default state of the device is sleep and explicit action is required (via a wakelock) to prevent that.

• Conclusion 

Android can be thought of as an application-specific implementation of Linux. LINUX is an open source OS that accepts contributions from the community at large.  Android uses the Linux kernel but also adds Google's own extensions along with app layer and graphical subsystem.

Share this post and blog as much as you can.
Please turn off ads blocker while surfing AndroMacMaster cause is generates our and millions of sites revenue.
Thanks for visiting AndroMacMaster.

Wednesday, 10 October 2018

Control Flow Integrity in the Android kernel




Posted by Sami Tolvanen, Staff Software Engineer, Android Security



Android's security model is enforced by the Linux kernel, which makes it a tempting target for attackers. We have put a lot of effort into hardening the kernel in previous Android releases and in Android 9, we continued this work by focusing on compiler-based security mitigations against code reuse attacks.



Google's Pixel 3 will be the first Android device to ship with LLVM's forward-edge Control Flow Integrity (CFI) enforcement in the kernel, and we have made CFI support available in Android kernel versions 4.9 and 4.14. This post describes how kernel CFI works and provides solutions to the most common issues developers might run into when enabling the feature.


Protecting against code reuse attacks





A common method of exploiting the kernel is using a bug to overwrite a function pointer stored in memory, such as a stored callback pointer or a return address that had been pushed to the stack. This allows an attacker to execute arbitrary parts of the kernel code to complete their exploit, even if they cannot inject executable code of their own. This method of gaining code execution is particularly popular with the kernel because of the huge number of function pointers it uses, and the existing memory protections that make code injection more challenging.



CFI attempts to mitigate these attacks by adding additional checks to confirm that the kernel's control flow stays within a precomputed graph. This doesn't prevent an attacker from changing a function pointer if a bug provides write access to one, but it significantly restricts the valid call targets, which makes exploiting such a bug more difficult in practice.




Figure 1. In an Android device kernel, LLVM's CFI limits 55% of indirect calls to at most 5 possible targets and 80% to at most 20 targets.


Gaining full program visibility with Link Time Optimization (LTO)





In order to determine all valid call targets for each indirect branch, the compiler needs to see all of the kernel code at once. Traditionally, compilers work on a single compilation unit (source file) at a time and leave merging the object files to the linker. LLVM's solution to CFI is to require the use of LTO, where the compiler produces LLVM-specific bitcode for all C compilation units, and an LTO-aware linker uses the LLVM back-end to combine the bitcode and compile it into native code.




Figure 2. A simplified overview of how LTO works in the kernel. All LLVM bitcode is combined, optimized, and generated into native code at link time.



Linux has used the GNU toolchain for assembling, compiling, and linking the kernel for decades. While we continue to use the GNU assembler for stand-alone assembly code, LTO requires us to switch to LLVM's integrated assembler for inline assembly, and either GNU gold or LLVM's own lld as the linker. Switching to a relatively untested toolchain on a huge software project will lead to compatibility issues, which we have addressed in our arm64 LTO patch sets for kernel versions 4.9 and 4.14.



In addition to making CFI possible, LTO also produces faster code due to global optimizations. However, additional optimizations often result in a larger binary size, which may be undesirable on devices with very limited resources. Disabling LTO-specific optimizations, such as global inlining and loop unrolling, can reduce binary size by sacrificing some of the performance gains. When using GNU gold, the aforementioned optimizations can be disabled with the following additions to LDFLAGS:





LDFLAGS += -plugin-opt=-inline-threshold=0 \
-plugin-opt=-unroll-threshold=0




Note that flags to disable individual optimizations are not part of the stable LLVM interface and may change in future compiler versions.


Implementing CFI in the Linux kernel





LLVM's CFI implementation adds a check before each indirect branch to confirm that the target address points to a valid function with a correct signature. This prevents an indirect branch from jumping to an arbitrary code location and even limits the functions that can be called. As C compilers do not enforce similar restrictions on indirect branches, there were several CFI violations due to function type declaration mismatches even in the core kernel that we have addressed in our CFI patch sets for kernels 4.9 and 4.14.



Kernel modules add another complication to CFI, as they are loaded at runtime and can be compiled independently from the rest of the kernel. In order to support loadable modules, we have implemented LLVM's cross-DSO CFI support in the kernel, including a CFI shadow that speeds up cross-module look-ups. When compiled with cross-DSO support, each kernel module contains information about valid local branch targets, and the kernel looks up information from the correct module based on the target address and the modules' memory layout.




Figure 3. An example of a cross-DSO CFI check injected into an arm64 kernel. Type information is passed in X0 and the target address to validate in X1.



CFI checks naturally add some overhead to indirect branches, but due to more aggressive optimizations, our tests show that the impact is minimal, and overall system performance even improved 1-2% in many cases.


Enabling kernel CFI for an Android device





CFI for arm64 requires clang version >= 5.0 and binutils >= 2.27. The kernel build system also assumes that the LLVMgold.so plug-in is available in LD_LIBRARY_PATH. Pre-built toolchain binaries for clang and binutils are available in AOSP, but upstream binaries can also be used.



The following kernel configuration options are needed to enable kernel CFI:





CONFIG_LTO_CLANG=y
CONFIG_CFI_CLANG=y




Using CONFIG_CFI_PERMISSIVE=y may also prove helpful when debugging a CFI violation or during device bring-up. This option turns a violation into a warning instead of a kernel panic.



As mentioned in the previous section, the most common issue we ran into when enabling CFI on Pixel 3 were benign violations caused by function pointer type mismatches. When the kernel runs into such a violation, it prints out a runtime warning that contains the call stack at the time of the failure, and the call target that failed the CFI check. Changing the code to use a correct function pointer type fixes the issue. While we have fixed all known indirect branch type mismatches in the Android kernel, similar problems may be still found in device specific drivers, for example.





CFI failure (target: [<fffffff3e83d4d80>] my_target_function+0x0/0xd80):
------------[ cut here ]------------
kernel BUG at kernel/cfi.c:32!
Internal error: Oops - BUG: 0 [#1] PREEMPT SMP

Call trace:

[<ffffff8752d00084>] handle_cfi_failure+0x20/0x28
[<ffffff8752d00268>] my_buggy_function+0x0/0x10



Figure 4. An example of a kernel panic caused by a CFI failure.



Another potential pitfall are address space conflicts, but this should be less common in driver code. LLVM's CFI checks only understand kernel virtual addresses and any code that runs at another exception level or makes an indirect call to a physical address will result in a CFI violation. These types of failures can be addressed by disabling CFI for a single function using the __nocfi attribute, or even disabling CFI for entire code files using the $(DISABLE_CFI) compiler flag in the Makefile.





static int __nocfi address_space_conflict()
{
void (*fn)(void);

/* branching to a physical address trips CFI w/o __nocfi */
fn = (void *)__pa_symbol(function_name);
cpu_install_idmap();
fn();
cpu_uninstall_idmap();

}



Figure 5. An example of fixing a CFI failure caused by an address space conflict.



Finally, like many hardening features, CFI can also be tripped by memory corruption errors that might otherwise result in random kernel crashes at a later time. These may be more difficult to debug, but memory debugging tools such as KASAN can help here.


Conclusion





We have implemented support for LLVM's CFI in Android kernels 4.9 and 4.14. Google's Pixel 3 will be the first Android device to ship with these protections, and we have made the feature available to all device vendors through the Android common kernel. If you are shipping a new arm64 device running Android 9, we strongly recommend enabling kernel CFI to help protect against kernel vulnerabilities.



LLVM's CFI protects indirect branches against attackers who manage to gain access to a function pointer stored in kernel memory. This makes a common method of exploiting the kernel more difficult. Our future work involves also protecting function return addresses from similar attacks using LLVM's Shadow Call Stack, which will be available in an upcoming compiler release.