Hypervisor Necromancy - Reanimating Kernel Protectors

Whitepaper called Hypervisor Necromancy - Reanimating Kernel Protectors.

MD5 | fed9693bce3cb6739d0226ae3503c6da

|=----------------------=[ Hypervisor Necromancy; ]=---------------------=|
|=----------------=[ Reanimating Kernel Protectors, or ]=----------------=|
|=--------=[ On emulating hypervisors; a Samsung RKP case study ]=-------=|
|=---------------------------=[ Aris Thallas ]=--------------------------=|
|=--------------------=[ [email protected] ]=--------------------=|

--[ Table of Contents

0 - Introduction
1 - Overview
1.1 - ARM Architecture & Virtualization Extensions
1.2 - Samsung Hypervisor
1.3 - Workspace Environment
2 - Framework Implementation & RKP Analysis
2.1 - System Bootstrap
2.1.1 - EL1
2.2 - EL2 Bootstrap
2.2.1 - Stage 2 translation & Concatenated tables
2.2.2 - EL2 bootstrap termination and EL1 physical address
2.3 - RKP Initialization Functions
2.3.1 - RKP Exception Handlers
2.3.2 - RKP Initialization
2.3.3 - RKP Deferred Initialization
2.3.4 - Miscellaneous Initializations
2.4 - Final Notes
3 - Fuzzing
3.1 - Dummy fuzzer
3.1.1 - Handling Aborts
3.1.2 - Handling Hangs
3.2 - AFL with QEMU full system emulation
3.2.1 - Introduction
3.2.2 - Implementation - QEMU patches - Framework support - Handling parent translations - Handling hangs and aborts - Demonstration
3.4 - Final Comments
4 - Conclusions
5 - Thanks
6 - References
7 - Source code

--[ 0 - Introduction

Until recently, to compromise an entire system during runtime attackers
found and exploited kernel vulnerabilities. This allowed them to perform a
variety of actions; executing malicious code in the context of the kernel,
modify kernel data structures to elevate privileges, access protected data,
etc. Various mitigations have been introduced to protect against such
actions and hypervisors have also been utilized, appart from their
traditional usage for virtualization support, towards this goal. In the
Android ecosystem this has been facilitated by ARM virtualization
extensions, which allowed vendors/OEMs to implement their own protection

On the other hand, Android devices have been universally a major PITA to
debug due to the large diversity of OEMs and vendors that introduced
endless customizations, the lack of public tools, debug interfaces etc. To
the author's understanding, setting up a proper debug environment is
usually one of the most important and time consuming tasks and can make a
world of difference in understanding the under examination system or
application in depth (especially true if no source code is available),
identifying 0day vulnerabilities and exploiting them.

In this (rather long) article we will be investigating methods to emulate
proprietary hypervisors under QEMU, which will allow researchers to
interact with them in a controlled manner and debug them. Specifically, we
will be presenting a minimal framework developed to bootstrap Samsung S8+
proprietary hypervisor as a demonstration, providing details and insights
on key concepts on ARM low level development and virtualization extensions
for interested readers to create their own frameworks and Actually Compile
And Boot them ;). Finally, we will be investigating fuzzing implementations
under this setup.

The article is organized as follows. The first section provides background
information on ARM, Samsung hypervisors and QEMU to properly define our
development setup. Next, we will elaborate on the framework implementation
while dealing with the various ARM virtualization and Samsung
implementation nuances. We will continue by demonstrating how to implement
custom dummy fuzzers under this setup and finally for more intelligent
fuzzing incorporate AFL a.k.a. "NFL or something by some chap called
Cameltuft" :p

On a final note, any code snippets, memory offsets or other information
presented throughout this article refer to Samsung version G955FXXU4CRJ5,
QEMU version 4.1.0 and AFL version 2.56b.

--[ 1 - Overview

----[ 1.1 - ARM Architecture & Virtualization Extensions

As stated in "Arm Architecture Reference Manual Armv8, for Armv8-A
architecture profile - Issue E.a" (AARM), Armv8 defines a set of Exception
Levels (EL, also referred to as Execution Levels) EL0 to EL3 and two
security states Secure and Non-secure aka Normal World. The higher the
exception level, the higher the software execution privilege. EL3
represents the highest execution/privilege level and provides support for
switching between the two security states and can access all system
resources for all ELs in both security states. EL2 provides support for
virtualization and in the latest version Armv8.5 support for Secure World
EL2 was introduced. EL1 is the Operating System kernel EL typically
described as _privileged_ and EL0 is the EL of userland applications called

| Secure Monitor (EL3) |
| Hypervisor (EL2)* | Sec Hypervisor (sEL2) |
| OS (EL1) | Trusted OS (sEL1) |
| Userland App (EL0) | Secure App (sEL0) |
Normal World Secure World

Switching between ELs is only allowed via taking an exception or returning
from one. Taking an exception leads to a higher or the same EL while
returning from one (via `eret`) to lower or the same EL. To invoke EL1,
`svc` (SuperVisor Call) command is used which triggers a synchronous
exception which is then handled by the corresponding OS kernel exception
vector entry. Similarly, EL2 is invoked via the `hvc` (HyperVisor Call)
command and EL3 via the `smc` (Secure Monitor Call) command. Switching
between security states is only done by EL3.

When a hypervisor is present in the system it can control various aspects
of EL1 behavior, such as trapping certain operations traditionally handled
by EL1 to the hypervisor allowing the latter to decide how to handle the
operation. Hypervisor Configuration Register (HCR_EL2) is the system
register the allows hypervisors to define which of these behaviors they
would like to enable.

Last but not least, a core feature of the virtualization extensions is the
Stage 2 (S2) translation. As depicted below, this feature splits the
standard translation process into two steps. First, using the EL1
translation tables (stored at Translation Table Base Register TTBRn_EL1)
which are controlled by EL1, the Virtual Address (VA) is translated to an
Intermediate Physical Address (IPA), instead of a Physical Address (PA) of
the standard process. The IPA is then translated to a PA by the hypervisor
using the Stage 2 translation table (stored at Virtual Translation Table
Base Register VTTBR_EL2) which is fully controlled by EL2 and not
accessible by EL1. Note that once S2 translation is enabled, EL1 does not
access physical memory immediately and every IPA must always be translated
via S2 tables for the actual PA access.

Of course, EL2 and EL3 maintain their own Stage 1 translation tables for
their code and data VAs, which perform the traditional VA to PA mapping.

Virtual Memory Map Guest Physical
Guest OS Memory Map
+----------------+ +-------------+
| +------------+ | | +---------+ |
| | OS (EL 1) | | +--------------------+ | | Flash | |
| +------------+ | | Guest OS | | +---------+ |
| +-->+ Translation Tables +-->+ |
| +------------+ | | TTBRn_EL1 | | +---------+ |
| | APP (EL 0) | | +--------------------+ | | RAM | |
| +------------+ | | +---------+ |
+----------------+ +-------------+
| +-------------+
v Real Physical | +---------+ |
+------+-------------+ Memory Map | | Flash | |
| Translation tables | | +---------+ |
| VTTBR_EL2 +----------------------->+ |
+--------------------+ | +---------+ |
+------------->+ | RAM | |
| | +---------+ |
+----------------+ +---------+----------+ +-------------+
| +------------+ | | Hypervisor |
| | Hyp (EL 2) | +-->+ Translation Tables |
| +------------+ | | TTBR0_EL2 |
+----------------+ +--------------------+

In this article we will be focusing on Normal World, implementing the EL3
and EL1 framework to bootstrap a proprietary EL2 implementation.

----[ 1.2 - Samsung Hypervisor

As part of its ecosystem Samsung implements a security platform named
Samsung Knox [01] which among others comprises a hypervisor implementation
called Real-Time Kernel Protection (RKP). RKP aims to achieve various
security features [02], such as the prevention of unauthorized privileged
code execution, the protection of critical kernel data (i.e. process
credentials) etc.

Previous versions of the Samsung hypervisor have been targeted before, with
[03] being the most notable exemplar. There, Samsung S7 hypervisor was
analyzed in great detail and the article provided valuable information.
Moreover, Samsung S8+ hypervisor is stripped and strings are obfuscated
whereas S7 is not, providing a valuable resource for binary diffing and
string comparison. Finally, the under examination S8+ hypervisor shares
many similarities regarding the system architecture which have slowly begun
disappearing in the latest models such as Samsung S10.

One of the most obvious differences is the location of the binary and the
bootstrap process. In sum, for S8+ the hypervisor binary is embedded in the
kernel image and the precompiled binary can be found in the kernel source
tree under init/vmm.elf (the kernel sources are available at [04]). The
kernel is also responsible for bootstrapping and initializing RKP. On the
other hand, the S10+ hypervisor binary resides in a separate partition, is
bootstrapped by the bootloader and then initialized by the kernel. We will
provide more details in the corresponding sections that follow.

All these reasons contributed to the selection of the S8 hypervisor as the
target binary, as they ease the analysis process, remove undesired
complexity from secondary features/functionalities and allow focusing on
the core required knowledge for our demonstration. Ultimately, though, it
was an arbitrary decision and other hypervisors could have been selected.

----[ 1.3 - Workspace Environment

As aforementioned the targeted Samsung version is G955FXXU4CRJ5 and QEMU
version is 4.1.0. Both the hypervisor and our framework are 64-bit ARM
binaries. QEMU was configured to only support AArch64 targets and built
with gcc version 7.4.0, while the framework was built with
aarch64-linux-gnu-gcc version 8.3.0. For debugging purposes we used
aarch64-eabi-linux-gdb version 7.11.

$ git clone git://git.qemu-project.org/qemu.git
$ cd qemu
$ git checkout v4.1.0
$ ./configure --target-list=aarch64-softmmu --enable-debug
$ make -j8

AFL version is 2.56b and is also compiled with gcc version 7.4.0.

$ git clone https://github.com/google/afl
$ cd afl
$ git checkout v2.56b
$ make

--[ 2 - Framework Implementation & RKP Analysis

The first important thing to mention regarding the framework is that it is
compiled as an ELF AArch64 executable and treated as a kernel image, since
QEMU allows to boot directly from ELF kernel images in EL3 and handles the
image loading process. This greatly simplifies the boot process as we are
not required to implement separate firmware binary to handle image loading.
Function `_reset()` found in framework/boot64.S is the starting execution
function and its physical address is 0x80000000 (as specified in the linker
script framework/kernel.ld) instead of the default value of 0x40000000 for
our QEMU setup (the reasoning behind this is explained later when the
framework physical memory layout is discussed).

We are now ready to start executing and debugging the framework which is
contained in the compilation output kernel.elf. We use the virt platform,
cortex-a57 cpu with a single core, 3GB of RAM (the reason for this size is
clarified during the memory layout discussion later), with Secure mode
(EL3) and virtualization mode (EL2) enabled and wait for gdb to attach.

$ qemu-system-aarch64 \
-machine virt \
-cpu cortex-a57 \
-smp 1 \
-m 3G \
-kernel kernel.elf \
-machine gic-version=3 \
-machine secure=true \
-machine virtualization=true \
-nographic \
-S -s

$ aarch64-eabi-linux-gdb kernel.elf -q
Reading symbols from kernel.elf...done.
(gdb) target remote :1234
Remote debugging using :1234
_Reset () at boot64.S:15
15 ldr x30, =stack_top_el3
(gdb) disassemble
Dump of assembler code for function _Reset:
=> 0x0000000080000000 <+0>: ldr x30, 0x80040000
0x0000000080000004 <+4>: mov sp, x30

The framework boot sequence is presented below. We will explain the
individual steps in the following sections. Note that we will not be
following the graph in a linear manner.

+-------+ +-------+ +-------+
| EL3 | | EL2 | | EL1 |
+-------+ +-------+ +-------+
| . .
_reset . .
| . .
copy_vmm . .
| . .
eret -------------------------------------------> start_el1
| . |
| . __enable_mmu
| . |
handle_interrupt_el3 <--------------------------- smc(CINT_VMM_INIT)
| . |
_vmm_init_el3 . |
| . |
eret(0xb0101000) ----------> start |
| | |
| | |
handle_interrupt_el3 <--- smc(0xc2000401) |
| | |
_reset_and_drop_el1_main | |
| | |
eret --------------------------------------------> _el1_main
| | |
| | el1_main
| | |
| | rkp_init
| | |
| | rkp_call
| | |
| vmm_dispatch <---------- hvc(RKP_INIT)
| | |
| vmm_synchronous_handler |
| | |
| rkp_main |
| | |
| my_handle_cmd_init |
| | |
| various init functions... |
| | |
| rkp_paging_init |
| | |
| process el1 page tables |
| | |
| eret -----------------> el1_main
| | |
| | +---+
| | | |
| | |<--+

----[ 2.1 - System Bootstrap

The first thing to do after a reset is to define the stack pointers and
exception vectors. Since EL2 system register values are handled by RKP
during its initialization, we will be skipping EL2 registers to avoid
affecting RKP configurations, except for any required reserved values as
dictated by AARM. Moreover, various available oracles which will be
discussed later can be examined to verify the validity of the system
configuration after initializations are complete.

Stack pointers (SP_ELn) are set to predefined regions, arbitrarily sized
8kB each. Vector tables in AArch64 comprise 16 entries of 0x80 bytes each,
must be 2kB aligned and are set in VBAR_ELx system configuration registers
where x denotes the EL (for details refer to AARM section "D1.10 Exception
entry" and "Bare-metal Boot Code for ARMv8-A Processors").

| Exception taken from EL | Synchronous | IRQ | FIQ | SError |
| Current EL (SP_EL0) | 0x000 | 0x080 | 0x100 | 0x180 |
| Current EL (SP_ELx, x>0) | 0x200 | 0x280 | 0x300 | 0x380 |
| Lower EL AArch64 | 0x400 | 0x480 | 0x500 | 0x580 |
| Lower EL AArch32 | 0x600 | 0x680 | 0x700 | 0x780 |

In our minimal implementation we will not be enabling IRQs or FIQs.
Moreover, we will not be implementing any EL0 applications or performing
`svc` calls from our kernel and as a result all VBAR_EL1 entries are set to
lead to system hangs (infinite loops). Similarly, for EL3 we only expect
synchronous exceptions from lower level AArch64 modes. As a result only the
corresponding `vectors_el3` entry (+0x400) is set and all others lead to
system hang as with EL1 vectors. The exception handler saves the current
processor state (general purpose and state registers) and invokes the
second stage handler. We follow the `smc` calling convention [05], storing
the function identifier in W0 register and arguments in registers X1-X6
(even though we only use one argument). If the function identifier is
unknown, then the system hangs, a decision of importance in the fuzzing

// framework/vectors.S

.align 11
.global vectors
* Current EL with SP0
.align 7
b . /* Synchronous */
.align 7
b . /* IRQ/vIRQ */

.align 11
.global vectors_el3

* Lower EL, aarch64
.align 7
b el3_synch_low_64


bl handle_interrupt_el3

cmp x0, #0
b.eq 1f
b .

Processors enter EL3 after reset and in order to drop to a lower ELs we
must initialize the execution state of the desired EL and control registers
and construct a fake state in the desired EL to return to via `eret`. Even
though we will be dropping from EL3 directly to EL1 to allow the
proprietary EL2 implementation to define its own state, we still have to
set some EL2 state registers values to initialize EL1 execution state.
Failure to comply with the minimal configuration results in `eret`
invocation to have no effect on the executing exception level (at least in
QEMU), in other words we can not drop to lower ELs.

In detail, to drop from EL3 to EL2 we have to define EL2 state in Secure
Configuration Register (SCR_EL3). We set SCR_EL3.NS (bit 0) to specify that
we are in Normal World, SCR_EL3.RW (bit 10) to specify that EL2 is AArch64
and any required reserved bits. Additionally, we set SCR_EL3.HCE (bit 8) to
enable the `hvc` instruction here, although this could also be performed at
later steps. Next, to be able to drop to EL1 we modify Hypervisor
Configuration Register (HCR_EL2) to set HCR_EL2.RW (bit 31) and specify
that EL1 is AArch64 and any other required reserved bits. To be as close as
possible to the original setup we set some more bits here, such as
HCR_EL2.SWIO (bit 1) which dictates the cache invalidation behavior. These
additional values are available to us via the aforementioned oracles which
will be presented later in the article.

// framework/boot64.S

.global _reset
// setup EL3 stack
ldr x30, =stack_top_el3
mov sp, x30

// setup EL1 stack
ldr x30, =stack_top_el1
msr sp_el1, x30


// Setup exception vectors for EL1 and EL3 (EL2 is setup by vmm)
ldr x1, = vectors
msr vbar_el1, x1
ldr x1, = vectors_el3
msr vbar_el3, x1


// Initialize EL3 register values
msr scr_el3, x0

// Initialize required EL2 register values
mov x0, #( AARCH64_HCR_EL2_RW )
orr x0, x0,#( AARCH64_HCR_EL2_SWIO )
msr hcr_el2, x0


msr spsr_el3, x0

// drop to function start_el1
adr x0, start_el1
msr elr_el3, x0

For the fake lower level state, Exception Link Register (ELR_EL3) holds the
exception return address, therefore we set it to the desired function
(`start_el1()`). Saved Process Status Register (SPSR_EL3) holds the
processor state (PSTATE) value before the exception, so we set its values
so that the fake exception came from EL1 (SPSR_EL3.M bits[3:0]), using
SP_EL1 (SPSR_EL3.M bit 0) and executing in AArch64 mode (SPSR_EL3.M bit 4).
`eret` takes us to `start_el1()` in EL1. The final register related to
exceptions is Exception Syndrome Register (ESR_ELx) which holds information
regarding the nature of the exception (syndrome information) and as such it
has no value to the returning EL and can be ignored.

------[ 2.1.1 - EL1

As aforementioned our goal is to provide a minimal setup. Considering this,
there is also the need to be as close as possible to the original setup.
Our EL1 configuration is defined with those requirements in mind and to
achieve this we used system configuration register values from both the
kernel source and the EL2 oracles that will be presented in the following
sections, but for now we can safely assume these are arbitrarily chosen
values. We will be presenting details regarding some critical system
register values but for detailed descriptions please refer to AARM section
"D13.2 General system control registers".

// initialize EL1 required register values

msr tcr_el1, x0

msr sctlr_el1, x0

#define AARCH64_TCR_EL1_BOOT_VAL ( \

As Translation Control Register (TCR_EL1) values suggest, we use a 40-bit
1TB sized Intermediate Physical Address space (TCR_EL1.IPS bits[34:32]),
for both TTBR0_EL1 and TTBR1_EL1 4kB Translation Granule size (TCR_EL1.TG1
bits [31:30] and TCR_EL1.TG0 [15:14] respectively) and 25 size offset which
means that there is a 64-25=39 bit or 512GB region of input VAs for each
TTBRn_EL1 (TCR_EL1.T1SZ bits[21:16] and TCR_EL1.T0SZ bits[5:0]).

By using 4kB Granularity each translation table size is 4kB and each entry
is a 64-bit descriptor, hence 512 entries per table. So at Level 3 we have
512 entries each pointing to a 4kB page or in other words we can map a 2MB
space. Similarly, Level 2 has 512 entries each pointing to a 2MB space
summing up to a 1GB address space and Level 1 entries point to 1GB spaces
summing up to a 512GB address space. In this setup where there are 39bit
input VAs we do not require a Level 0 table as shown from the translation
graph. For more details refer to AARM section "D5.2 The VMSAv8-64 address
translation system".

| [38:30] | [29:21] | [20:12] | [11:0] | VA segmentation with
| | | | | 4kB Translation Granule
| Level 1 | Level 2 | Level 3 | Block off | 512GB input address space

Physical Address
VA Translation | [39:12] | [11:0] |
demonstration with +-------------------------+-----------+
4kB Granule, ^ ^
512GB Input VA Space | |
1TB IPS | +----------+
+-------------------------+ |
| |
Level 1 tlb Level 2 tlb Level 3 tlb | |
+--------> +-----------+ +--->+-----------+ +-->+-----------+ | |
| | | | | | | | | | |
| +-----------+ | +-----------+ | | | | |
| | 1GB block | | | 2MB block | | | | | |
| | entry | | | entry | | | | | |
| +-----------+ | +-----------+ | | | | |
| | | | | | | | | | |
| +-----------+ | | | | | | | |
| +-->+ Tbl entry +---+ | | | | | | |
+---+---+ | +-----------+ +-----------+ | | | | |
| TTBRn | | | | +-->+ Tbl entry +--+ +-----------+ | |
+---+---+ | | | | +-----------+ +->+ Pg entry +--+ |
^ | | | | | | | +-----------+ |
| | | | | | | | | | |
+--+ | +-----------+ | +-----------+ | +-----------+ |
| | +------+ | |
| +----+ Index +----+ | +--+ +-----------+
| | | | |
| | | | Level 0 | Level 1 | Level 2 | Level 3 | PA offset | VA
[55] [47:39] [38:30] [29:21] [20:12] [11:0]
TTBRn Select

For Levels 1 and 2 every entry can either point to the next translation
table level (table entry) or to the actual physical address (block entry)
effectively ending translation. The entry type is defined in bits[1:0],
where bit 0 identifies whether the descriptor is valid (1 denotes a valid
descriptor) and bit 1 identifies the type, value 0 being used for block
entries and 1 for table entries. As a result entry type value 3 identifies
table entries and value 1 block entries. Level 1 block entries point to 1GB
memory regions with VA bits[29:0] being used as the PA offset and Level 2
block entries point to 2MB regions with bits[20:0] used as the offset. Last
but not least, Level 3 translation tables can only have page entries
(similar to block entries but with descriptor type value 3, as previous
level table entries).

61 51 11 2 1:0
+------------+-----------------------------+----------+------+ Block Entry
| Upper Attr | ... | Low Attr | Type | Stage 1
+------------+-----------------------------+----------+------+ Translation

| bits | Attr | Description |
| 4:2 | AttrIndex | MAIR_EL1 index |
| 7:6 | AP | Access permissions |
| 53 | PXN | Privileged execute never |
| 54 | (U)XN | (Unprivileged) execute never |
Block entry attributes
| AP | EL0 Access | EL1/2/3 Access | for Stage 1 translation
| 00 | None | Read Write |
| 01 | Read Write | Read Write |
| 10 | None | Read Only |
| 11 | Read Only | Read Only |

61 59 2 1:0
+--------+--------------------------------------------+------+ Table Entry
| Attr | ... | Type | Stage 1
+--------+--------------------------------------------+------+ Translation

| bits | Attr | Description |
| 59 | PXN | Privileged execute never |
| 60 | U/XN | Unprivileged execute never |
| 62:61 | AP | Access permissions |
Table entry attributes
| AP | Effect in subsequent lookup levels | for Stage 1 translation
| 00 | No effect |
| 01 | EL0 access not permitted |
| 10 | Write disabled |
| 11 | Write disabled, EL0 Read disabled |

In our setup we use 2MB regions to map the kernel and create two mappings.
Firstly, an identity mapping (VAs are equal to the PAs they are mapped to)
set to TTBR0_EL1 and used mainly when the system transitions from not using
the MMU to enabling it. Secondly, the TTBR1_EL1 mapping where PAs are
mapped to VA_OFFSET + PA, which means that getting the PA from a TTBR1_EL1
VA or vice versa is simply done by subtracting or adding the VA_OFFSET
correspondingly. This will be of importance during the RKP initialization.

#define VA_OFFSET 0xffffff8000000000

#define __pa(x) ((uint64_t)x - VA_OFFSET)
#define __va(x) ((uint64_t)x + VA_OFFSET)

The code to create the page tables and enable the MMU borrows heavily from
the Linux kernel implementation. We use one Level 1 entry and the required
amount of Level 2 block entries with the two tables residing in contiguous
preallocated (defined in the linker script) physical pages. The Level 1
entry is evaluated by macro `create_table_entry`. First, the entry index is
extracted from VA bits[38:30]. The entry value is the next Level table PA
ORed with the valid table entry value. This also implicitly defines the
table entry attributes, where (U)XN is disabled, Access Permissions (AP)
have no effect in subsequent levels of lookup. For additional details
regarding the memory attributes and their hierarchical control over memory
accesses refer to AARM section "D5.3.3 Memory attribute fields in the
VMSAv8-64 translation table format descriptors".

A similar process is followed for Level 2 but in a loop to map all required
VAs in macro `create_block_map`. The entry value is the PA we want to map
ORed with block entry attribute values defined by AARCH64_BLOCK_DEF_FLAGS.
The flag value used denotes a non-secure memory region, (U/P)XN disabled,
Normal memory as defined in Memory Attribute Indirection Register
(MAIR_EL1) and Access Permissions (AP) that allow Read/Write to EL1 and no
access to EL0. As with table entries, for detailed description refer to
AARM section "D5.3.3". Finally, MAIR_ELx serves as a table holding
information/attributes of memory regions and readers may refer to AARM
section "B2.7 Memory types and attributes" for more information.

// framework/aarch64.h

* Block default flags for initial MMU setup
* block entry
* attr index 4
* NS = 0
* AP = 0 (EL0 no access, EL1 rw)
* (U/P)XN disabled

// framework/mmu.S


bl __create_page_tables

mrs x0, sctlr_el1
orr x0, x0, #(AARCH64_SCTLR_EL1_M)
msr sctlr_el1, x0



// x25 = swapper_pg_dir
u/ x20 = VA_OFFSET
mov x0, x25
adrp x1, _text
add x1, x1, x20
create_table_entry x0, x1, #(LEVEL1_4K_INDEX_SHIFT), \
#(PGTBL_ENTRIES), x4, x5

adrp x1, _text
add x2, x20, x1
adrp x3, _etext
add x3, x3, x20
create_block_map x0, x7, x1, x2, x3

.macro create_table_entry, tbl, virt, shift, ptrs, tmp1, tmp2
lsr \tmp1, \virt, \shift
and \tmp1, \tmp1, \ptrs - 1 // table entry index
add \tmp2, \tbl, #PAGE_SIZE // next page table PA
orr \tmp2, \tmp2, #AARCH64_PGTBL_TBL_ENTRY // valid table entry
str \tmp2, [\tbl, \tmp1, lsl #3] // store new entry
add \tbl, \tbl, #PAGE_SIZE // next level table page

.macro create_block_map, tbl, flags, phys, start, end
lsr \phys, \phys, #LEVEL2_4K_INDEX_SHIFT
lsr \start, \start, #LEVEL2_4K_INDEX_SHIFT
and \start, \start, #LEVEL_4K_INDEX_MASK // table index
orr \phys, \flags, \phys, lsl #LEVEL2_4K_INDEX_SHIFT // table entry
lsr \end, \end, #LEVEL2_4K_INDEX_SHIFT // block entries counter
and \end, \end, #LEVEL_4K_INDEX_MASK // table end index
1: str \phys, [\tbl, \start, lsl #3] // store the entry
add \start, \start, #1 // next entry
add \phys, \phys, #LEVEL2_4K_BLK_SIZE // next block
cmp \start, \end
b.ls 1b


As a demonstration we perform a manual table walk for VA 0xffffff8080000000
which should be the TTBR1_EL1 VA of function `_reset()`. The Level 1 table
index (1) is 2 and the entry value is 0x8008a003 which denotes a valid
table descriptor at PA 0x8008a000. The Level 2 entry index (2) is 0 and
value of the entry is 0x80000711 which denotes a block entry at physical
address 0x80000000. The remaining VA bits setting the PA offset are zero
and examining the resulting PA is of course the start of function
`_reset()`. Note that since we have not yet enabled the MMU (as shown in
the disassembly this is performed in the next instructions), all memory
accesses with gdb refer to PAs that is why we can directly examine the page
tables and resulting PA. In our setup that would be true even with MMU
enabled due to the identity mapping, however, this should not be assumed to
apply to every system.

(gdb) disas
Dump of assembler code for function __enable_mmu:
0x00000000800401a0 <+0>: mov x28, x30
0x00000000800401a4 <+4>: adrp x25, 0x80089000 // TTBR1_EL1
0x00000000800401a8 <+8>: adrp x26, 0x8008c000
0x00000000800401ac <+12>: bl 0x80040058 <__create_page_tables>
=> 0x00000000800401b0 <+16>: isb
0x00000000800401b4 <+20>: mrs x0, sctlr_el1
0x00000000800401b8 <+24>: orr x0, x0, #0x1
End of assembler dump.

(gdb) p/x ((0xffffff8000000000 + 0x80000000) >> 30) & 0x1ff /* (1) */
$19 = 0x2

(gdb) x/gx ($TTBR1_EL1 + 2*8)
0x80089010: 0x000000008008a003

(gdb) p/x ((0xffffff8000000000 + 0x80000000) >> 21) & 0x1ff /* (2) */
$20 = 0x0

(gdb) x/gx 0x000000008008a000
0x8008a000: 0x0000000080000711

(gdb) x/10i 0x0000000080000000
0x80000000 <_reset>: ldr x30, 0x80040000
0x80000004 <_reset+4>: mov sp, x30
0x80000008 <_reset+8>: mrs x0, currentel

Finally, with the MMU enabled we are ready to enable RKP. Since the EL2
exception vector tables are not set, the only way to do that is to drop to
EL2 from EL3 as we did for EL1. We invoke `smc` with function identifier
CINT_VMM_INIT which the EL3 interrupt handler redirects to function

----[ 2.2 - EL2 Bootstrap

RKP binary is embedded in our kernel image using the `incbin` assembler
directive as shown below and before dropping to EL2 we must place the
binary in its expected physical address. Since RKP is an ELF file, we can
easily obtain the PA and entry point which for this specific RKP version
are 0xb0100000 and 0xb0101000 respectively. `copy_vmm()` function copies
the binary from its kernel position to the expected PA during the system
initialization in function `_reset()`.

// framework/boot64.S

.global _svmm
.incbin "vmm-G955FXXU4CRJ5.elf"
.global _evmm

$ readelf -l vmm-G955FXXU4CRJ5.elf

Elf file type is EXEC (Executable file)
Entry point 0xb0101000
There are 2 program headers, starting at offset 64

Program Headers:
Type Offset VirtAddr PhysAddr
FileSiz MemSiz Flags Align
LOAD 0x0000000000000000 0x00000000b0100000 0x00000000b0100000
0x000000000003e2e0 0x000000000003e6c0 RWE 0x10000

At long last we are ready to drop to EL2. Similarly to dropping to EL1, we
set ELR_EL3 to the RKP entry point and SPSR_EL3 so that the fake exception
came from EL2 executing in AArch64 mode. We additionally set X0 and X1 to
to RKP start PA and reserved size. These values are dictated by the Samsung
kernel implementation and the oracles and required by the EL2
implementation which will be explained shortly. Readers interested in the
Samsung kernel implementation can refer to kernel function `vmm_init()` at
kernel/init/vmm.c which is called during the kernel initialization in
function `start_kernel()`.

// framework/boot64.S

.global _vmm_init_el3
.align 2
// return to vmm.elf entry (RKP_VMM_START + 0x1000)
mov x0, #RKP_VMM_START
add x0, x0, #0x1000
msr elr_el3, x0
msr spsr_el3, x0

// these are required for the correct hypervisor setup
mov x0, #RKP_VMM_START
mov x1, #RKP_VMM_SIZE
.inst 0xdeadc0de //crash for sure

One valuable source of information at this point is the Linux kernel procfs
entry /proc/sec_log as it provides information about the aforementioned
values during Samsung kernel `vmm_init()` invocation. This procfs entry is
part of the Exynos-SnapShot debugging framework and more information can be
found in the kernel source at kernel/drivers/trace/exynos-ss.c. A sample
output with RKP related values is displayed below. Apart from the RKP
related values we can see the kernel memory layout which will be helpful in
creating our framework memory layout to satisfy the plethora of criteria
introduced by RKP which will be presented later.

RKP: rkp_reserve_mem, base:0xaf400000, size:0x600000
RKP: rkp_reserve_mem, base:0xafc00000, size:0x500000
RKP: rkp_reserve_mem, base:0xb0100000, size:0x100000
RKP: rkp_reserve_mem, base:0xb0200000, size:0x40000
RKP: rkp_reserve_mem, base:0xb0400000, size:0x7000
RKP: rkp_reserve_mem, base:0xb0407000, size:0x1000
RKP: rkp_reserve_mem, base:0xb0408000, size:0x7f8000
software IO TLB [mem 0x8f9680000-0x8f9a80000] (4MB) mapped at
[ffffffc879680000-ffffffc879a7ffff] Memory: 3343540K/4136960K available
(11496K kernel code, 3529K rwdata, 7424K rodata, 6360K init, 8406K bss,
637772K reserved, 155648K cma-reserved)
Virtual kernel memory layout:
modules : 0xffffff8000000000 - 0xffffff8008000000 ( 128 MB)
vmalloc : 0xffffff8008000000 - 0xffffffbdbfff0000 ( 246 GB)
.init : 0xffffff8009373000 - 0xffffff80099a9000 ( 6360 KB)
.text : 0xffffff80080f4000 - 0xffffff8008c2f000 ( 11500 KB)
.rodata : 0xffffff8008c2f000 - 0xffffff8009373000 ( 7440 KB)
.data : 0xffffff80099a9000 - 0xffffff8009d1b5d8 ( 3530 KB)
vmemmap : 0xffffffbdc0000000 - 0xffffffbfc0000000 ( 8 GB maximum)
0xffffffbdc0000000 - 0xffffffbde2000000 ( 544 MB actual)
SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=8, Nodes=1
RKP: vmm_reserved
.base=ffffffc030100000 .size=1048576
.bss=ffffffc03013e2e0 .bss_size=992
.text_head=ffffffc030101000 .text_head_size=192
RKP: vmm_kimage
.base=ffffff8009375a10 .size=255184
RKP: vmm_start=b0100000, vmm_size=1048576
RKP: entry point=00000000b0101000
RKP: status=0
in rkp_init, swapper_pg_dir : ffffff800a554000

The entry point eventually leads to RKP function `vmm_main()` (0xb0101818).
The function initially checks whether RKP has already been initialized (3)
and if true it returns, or else proceeds with the initialization and sets
the initialization flag. Immediately after this, `memory_init()` function
(0xb0101f24) is called where a flag is set indicating that memory is active
and a 0x1f000 sized buffer at 0xb0220000 is initialized to zero.

// vmm-G955FXXU4CRJ5.elf

int64_t vmm_main(int64_t hyp_base_arg, int64_t hyp_size_arg, char **stacks)

if ( !initialized_ptr ) /* (3) */
initialized_ptr = 1;

log_message("RKP_cdb5900c %sRKP_b826bc5a %s\n",
"Jul 11 2018", "11:19:43");

/* various log messages and misc initializations */

heap_init(base, size);
stacks = memalign(8, 0x10000) + 0x2000;


if (hyp_base_arg != 0xB0100000)
return -1;



return result;

This buffer is the RKP log and along with RKP debug log at 0xb0200000,
which will be presented later, they comprise the EL2 oracles. Both of them
are made available via procfs entry /proc/rkp_log and interested readers
can check kernel/drivers/rkp/rkp_debug_log.c for more information from the
kernel perspective. RKP log is written to by `log_message()` function
(0xb0102e94) among others and an edited sample output from `vmm_main()`
with deobfuscated strings as comments with the help of S7 hypervisor binary
as mentioned before.

RKP_1f22e931 0xb0100000 RKP_dd15365a 40880 // file base: %p size %s
RKP_be7bb431 0xb0100000 RKP_dd15365a 100000 // region base: %p size %s
RKP_2db69dc3 0xb0220000 RKP_dd15365a 1f000 // memory log base: %p size %s
RKP_2c60d5a7 0xb0141000 RKP_dd15365a bf000 // heap base: %p size %s

During the initialization the heap is initialized and memory is allocated
for the stack which has been temporarily set to a reserved region during
compilation. Next, in `vmm_init()` (0xb0109758) two critical actions are
performed. First, the EL2 exception vector table (0xb010b800) is set in
VBAR_EL2 enabling us to invoke RKP from EL1 via `hvc`. Finally, HCR_EL2.TVM
(bit 26) is set trapping EL1 writes to virtual memory control registers
(SCTLR_EL1, TTBRnRL1, TCR_EL1, etc) to EL2 with Syndrome Exception Class
(ESR_EL2.EC bits [31:26]) value 0x18 (more on this while discussing the EL2
synchronous exception handler).

At this point we clarify one the aforementioned constrains; that of the RKP
bootstrap arguments. The RKP PA is compared at this point with hardcoded
value 0xb0100000 and if there's a mismatch the bootstrap process terminates
and -1 is returned denoting failure. Furthermore, the PA is stored and used
later during the paging initialization, also discussed later.

If the RKP PA check is satisfied, the final bootstrap steps comprise the
MMU and memory translations enabling. First, EL2 Stage 1 translations are
enabled. TTBR0_EL2 is set to predefined static tables at 0xb011a000 and
`s1_enable()` (0xb0103dcc) function is called. First, MAIR_EL2 is set to
define two memory attributes (one for normal memory and one for device
memory). Next, TCR_EL2 is ORed with 0x23518 which defines a 40 bits or 1TB
Physical Address Size (TCR_EL2.PS bits[18:16]), a 4kB Granule size
(TCR_EL2.TG0 bits[15:14]) and 24 size offset (TCR_EL2.T0SZ bits[5:0]) which
corresponds to a 64-24=40 bit or 1TB input address space for TTBR0_EL2. To
conclude `s1_enable()` SCTLR_EL2 is set with the important values being
SCTLR_EL2.WNX (bit 19) which enables the behavior where write permission
implies XN and SCTLR_EL2.M (bit 0) which enables the MMU.

Last but not least, Stage 2 translation is enabled. VTTBR_EL2 which holds
the Stage 2 translation tables is set to the predefined static tables at
0xb012a000. Next, Virtual Translation Control Register (VTCR_EL2) is set
which as the name dictates, controls the Stage 2 translation process
similarly to TCR_ELx for Stage 1 translations. Its value defines a 40 bits
or 1TB Physical Address Size (VTCR_EL2.PS bits[18:16]), a 4kB Granule size
(TCR_EL2.TG0 bits[15:14]), and 24 size offset (TCR_EL2.T0SZ bits[5:0])
which corresponds to a 64-24=40 bit or 1TB input address space for
VTTBR0_EL2. Moreover, Starting Level of Stage 2 translation controlled by
VTCR_EL2.SL0 (bits[7:6]) is set to 1 and since TCR_EL2.TG0 is set to 4kB
Stage 2 translations start at Level 1 with concatenated tables which will
be explained in detail next. Finally, HCR_EL2.VM (bit 0) is set to enable
Stage 2 translation.

------[ 2.2.1 - Stage 2 translation & Concatenated tables

As AARM states "for a Stage 2 translation, up to 16 translation tables can
be concatenated at the initial lookup level. For certain input address
sizes, concatenating tables in this way means that the lookup starts at a
lower level than would otherwise be the case". We are going to demonstrate
this in our current setup but for more details refer to section "D5.2.6
Overview of the VMSAv8-64 address translation stages" of AARM.

Since we have a 40 bit input address range only bit 39 of the input VA
is used to index translation table at Level 0 and as a result only two
Level 1 tables exist. Instead of the default setup, ARM allows to
concatenate the two tables in contiguous physical pages and start
translation in Level 1. To index the Level 1 tables, IPA bits[39:30] are
used instead of the traditional bits[38:30].

+---------+---------+---------+---------+-----------+ Default approach
| 39 | [38:30] | [29:21] | [20:12] | [11:0] | Stage 2 translation
| | | | | | IPA segmentation
| Level 0 | Level 1 | Level 2 | Level 3 | Block off | 4kB Granule
+---------+---------+---------+---------+-----------+ 40-bit IPS

+-------------+---------+---------+-----------+ Concatenated Tables
| [39:30] | [29:21] | [20:12] | [11:0] | IPA segmentation
| | | | | 4kB Granule
| Level 1 | Level 2 | Level 3 | Block off | 40-bit IPS
+-------------+---------+---------+-----------+ VTCR_EL2.SL0 = 1

We have included a gdb script to dump the Stage 2 translation tables based
on tools from [03] and [06]. The script reads the table PA from VTTBR_EL2
and is configured for our setup only and not the generic approach.
Moreover, it needs to be called from EL2 or EL3, for which `switchel <#>`
command can be used. Finally, our analysis indicates that there is a 1:1
mapping between IPAs and PAs.

(gdb) switchel
$cpsr = 0x5 (EL1)

(gdb) switchel 2
Moving to EL2
$cpsr = 0x9

(gdb) pagewalk

# Dump Second Stage Translation Tables #
PA Size: 40-bits
Starting Level: 1
IPA range: 0x000000ffffffffff
Page Size: 4KB

Third level: 0x1c07d000-0x1c07e000: S2AP=11, XN=10
Third level: 0x1c07e000-0x1c07f000: S2AP=11, XN=10
second level block: 0xbfc00000-0xbfe00000: S2AP=11, XN=0
second level block: 0xbfe00000-0xc0000000: S2AP=11, XN=0
first level block: 0xc0000000-0x100000000: S2AP=11, XN=0
first level block: 0x880000000-0x8c0000000: S2AP=11, XN=0

(gdb) switchel 1
Moving to EL1
$cpsr = 0x5 (EL1)

------[ 2.2.2 - EL2 bootstrap termination and EL1 physical address

Now that the hypervisor is setup we can resume with the framework setup.
The bootstrap process terminates via an `smc` command thus returning to
EL3. X0 holds the special value 0xc2000401 and X1 the return value of the
operation (zero denoting success). If the bootstrap process fails,
`handle_interrupt_el3()` fails (5) and the system hangs (4).

// framework/vectors.S


bl handle_interrupt_el3

cmp x0, #0 /* (4) */
b.eq 1f
b .

// framework/interrupt-handler.c

int handle_interrupt_el3(uint64_t value, uint64_t status)
int ret = 0;
switch (value) {
case 0xc2000401: // special return value from vmm initialization
if (status == 0) {
} else {
ret = -1; /* (5) */

Careful readers might have noticed that the EL2 `smc` invocation causes a
new exception frame to be stored in EL3 and in order to return to EL1 we
must properly restore the state. Well, due to the framework minimal nature
no information needs to be saved before or after EL2 bootstrap. As a result
we simply reset the state (i.e. stack pointers) and drop to EL1 function
`_el1_main()` which in turn leads to `el1_main()`.

// framework/boot64.S


* We have initialized vmm. Jump to EL1 main since HVC is now enabled,
* and EL1 does not require EL3 to interact with hypervisor
// setup EL3 stack
ldr x30, =stack_top_el3
mov sp, x30

// setup EL1 stack
ldr x30, =stack_top_el1
msr sp_el1, x30

msr spsr_el3, x0

// drop to function _el1_main
adr x0, _el1_main
msr elr_el3, x0
eret /* (6) */

mov x20, #-1
lsl x20, x20, #VA_BITS
adr x0, el1_main
add x0, x0, x20

blr x0

Here we explain another system constrain. Our framework was arbitrarily
placed at PA 0x80000000. The reason should by now be obvious. After
enabling Stage 2 translation, every EL1 IPA is translated through Stage 2
tables to find the PA. Examining the hypervisor static maps reveals region
starting at 0x80000000 to satisfy the criteria required for lower level
execution. Specifically, eXecute Never (XN) field is unset and there is no
write permissions. Should the kernel be placed in an unmapped or non
executable for Stage 2 translation region during framework initialization,
then returning from EL3 to EL1 (6) results in a translation error.

(gdb) pagewalk

# Dump Second Stage Translation Tables #
Third level: 0x1c07e000-0x1c07f000: S2AP=11, XN=10
Third level: 0x1c07f000-0x1c080000: S2AP=11, XN=10
Third level: 0x80000000-0x80001000: S2AP=1, XN=0
Third level: 0x80001000-0x80002000: S2AP=1, XN=0

54 51 10 2 1:0
+------------+-----------------------------+----------+------+ Block Entry
| Upper Attr | .... | Low Attr | Type | Stage 2
+------------+-----------------------------+----------+------+ Translation

| bits | Attr | Description |
| 5:2 | AttrIndex | MAIR_EL2 index |
| 7:6 | S2AP | Access permissions |
| 53:54 | XN | Execute never |
Block entry attributes
| S2AP | EL1/EL0 Access | | XN | Allow Exec | for Stage 2 translation
------------------------- --------------------
| 00 | None | | 00 | EL0/EL1 |
| 01 | Read Only | | 01 | EL0 not EL1 |
| 10 | Write Only | | 10 | None |
| 11 | Read Write | | 11 | EL1 not EL0 |

----[ 2.3 - RKP Initialization Functions

The first thing performed in `el1_main()` is to initialize RKP. There are
numerous steps that comprise RKP initialization and we will present them in
the following sections. Before explaining the initialization process though
we will describe the RKP exception handlers.

------[ 2.3.1 - RKP Synchronous Handler

As explained during the EL2 bootstrap VBAR_EL2 is set at 0xb010b800 where
each handler first creates the exception frame storing all generic
registers and then calls function `vmm_dispatch()` (0x0b010aa44) with the
three arguments being the offset indicating the EL from which the exception
was taken, the exception type and the exception frame address respectively.
`vmm_dispatch()` is designed to only handle synchronous exceptions and
simply returns otherwise. Function `vmm_synchronous_handler()` (0xb010a678)
handles as the name suggests the synchronous exceptions and only the
exception frame (third) argument is of importance.

stp X1, X0, [SP,#exception_frame]!
mov X0, #0x400 // Lower AArch64
mov X1, #0 // Synchronous Exception
mov X2, SP // Exception frame, holding args from EL1

bl vmm_dispatch
ldp X1, X0, [SP+0x10+exception_frame],#0x10

As shown from the following snippet the handler first evaluates ESR_EL2.EC.
Data and Instruction Aborts from the current EL (ECs 0x21 and 0x25) are not
recoverable and the handler calls `vmm_panic()` function (0xb010a4cc) which
leads to system hang. Data and Instruction Aborts from lower EL (ECs 0x20
and 0x24) are handled directly by the handler. Furthermore, as mentioned
before, by setting HCR_EL2.TVM during the RKP bootstrap, EL1 writes to
virtual memory control registers are trapped to EL2 with EC 0x18 and here
handled by function `other_msr_mrs_system()` (0xb010a24c). `hvc` commands
either from AArch32 or AArch64 (ECs 0x12 and 0x16) are our main focus and
will be explained shortly. Finally, any other ECs return -1 which leads
`vmm_dispatch()` to `vmm_panic()`.

// vmm-G955FXXU4CRJ5.elf

int64_t vmm_synchronous_handler(int64_t from_el_offset,
int64_t exception_type, exception_frame *exception_frame) {

esr_el2 = get_esr_el2();

switch ( esr_el2 >> 26 ) /* Exception Class */
case 0x12: /* HVC from AArch32 */
case 0x16: /* HVC from AArch64 */

if ((exception_frame->x0 & 0xFFF00000) == 0x83800000) /* (7) */
rkp_main(exception_frame->x0, exception_frame);
return 0;

case 0x18: /* Trapped MSR, MRS or System instruction execution */
v7 = other_msr_mrs_system(exception_frame);

case 0x20: /* Instruction Abort from a lower Exception level */

case 0x21: /* Instruction Abort Current Exception Level */
vmm_panic(from_el_offset, exception_type, ...);

case 0x24: /* Data Abort from a lower Exception level */

case 0x25: /* Data Abort Current Exception Level */
vmm_panic(from_el_offset, exception_type, ...);

return -1;

Before moving to `hvc` we will be briefly introducing `msr`/`mrs` handling
(for details regarding the values of ESR_EL2 discussed here refer to AARM
section "D13.2.37"). First, the operation direction is checked via the
ESR_EL2.ISS bit 0. As mentioned only writes are supposed to be trapped
(direction bit value must be 0) and if somehow a read was trapped, handler
ends up in `vmm_panic()`. The general purpose register used for the
transfer is discovered from the value of ESR_EL2.ISS.Rt (bits [9:5]). The
rest of ESR_EL2.ISS values are used to identify the system register
accessed by `msr` and in RKP each system register is handled differently.
For example SCTLR_EL1 handler does not allow to disable the MMU or change
endianess and TCR_EL1 handler does not allow modification of the Granule
size. We will not be examining every case in this (already long) article,
but interested readers should by now have more than enough information to
start investigating function `other_msr_mrs_system()`.

RKP `hvc` invocation's first argument (X0) is the function identifier and
as shown in (7) must abide by a specific format for function `rkp_main()`
(0xb010d000) which is the `hvc` handler to be invoked. Specifically, each
command is expected to have a prefix value of 0x83800000. Furthermore, to
form the command, command indices are shifted by 12 and then ORed with the
prefix (readers may also refer to kernel/include/linux/rkp.h). This format
is also expected by `rkp_main()` as explained next.

// vmm-G955FXXU4CRJ5.elf

void rkp_main(unsigned int64_t command, exception_frame *exception_frame)

hvc_cmd = (command >> 12) & 0xFF; /* (8) */

if ( hvc_cmd && !is_rkp_activated ) /* (9) */

switch ( hvc_cmd )
case 0:

if ( is_rkp_activated ) /* (10) */
rkp_policy_violation(2, 0, 0, 0);



void my_check_hvc_command(unsigned int64_t cmd_index)
if ( cmd_index > 0x9F )
rkp_policy_violation(3, cmd_index, 0, 0);

prev_counter = my_cmd_counter[cmd_index];

if ( prev_counter != 0xFF )
cur_counter = (prev_counter - 1);

if ( cur_counter > 1 )
rkp_policy_violation(3, cmd_index, prev_counter, 0);

my_cmd_counter[cmd_index] = cur_counter;

`rkp_main()` first extracts the command index (8) and then calls function
`my_check_hvc_command()` (0xb0113510). Two things are happening there.
First, the index must be smaller than 0x9f. Second, RKP maintains an array
with command counters. The counter for RKP initialization command is 1
during the array definition and is set again along with all other values at
runtime in function `my_initialize_hvc_cmd_counter()` (0xb011342c) during
the initialization. If any of these checks fails, `rkp_policy_violation()`
(0xb010dba4) is called which can be considered as an assertion error and
leads to system hang. Finally, before allowing any command invocation
except for the initialization, a global flag indicating whether RKP is
initialized is checked (9). This flag is obviously set after a successful
initialization as explained in the following section.

Before continuing with the initialization process we will present some
commands as examples to better demonstrate their usage. The first
initialization function (presented next) is `rkp_init()` with command id 0
which corresponds to command 0x83800000. During definition, as mentioned
above, its counter is set to 1 so that it can be called once before
invoking `my_initialize_hvc_cmd_counter()`. Similarly, command id 1
corresponds to deferred initialization function (also presented next), can
be reached with command 0x83801000 and since its counter is set to 1 which
means it can only be called once. Commands with counter value -1 as the
ones shown in the table below for handling page tables (commands 0x21 and
0x22 for level 1 and 2 correspondingly) can be called arbitrary number of

| Function | ID | Command | Counter |
| rkp_init | 0x0 | 0x83800000 | 0 |
| rkp_def_init | 0x1 | 0x83801000 | 1 |
| rkp_pgd_set | 0x21 | 0x83821000 | -1 |
| rkp_pmd_set | 0x22 | 0x83822000 | -1 |

------[ 2.3.2 - RKP Initialization

With this information, we are now ready to initialize RKP. In the snippet
below we demonstrate the framework process to initialize the RKP (with RKP
command id 0). We also show the `rkp_init_t` struct values used in the
framework during the invocation and we will be elaborating more on them
while examining the RKP initialization function `rkp_init()` (0xb0112f40).
Interested readers can also study and compare `framework_rkp_init()`
function with Samsung kernel function `rkp_init()` in kernel/init/main.c
and the initialization values presented here against some of the values
from the sample sec_log output above.

// framework/main.c

void el1_main(void) {

// framework/vmm.h

#define RKP_PREFIX (0x83800000)
#define RKP_CMDID(CMD_ID) (((CMD_ID) << 12 ) | RKP_PREFIX)

#define RKP_INIT RKP_CMDID(0x0)

// framework/vmm.c

void framework_rkp_init(void)
struct rkp_init_t init;
init.magic = RKP_INIT_MAGIC;
init._text = (uint64_t)__va(&_text);
init._etext = (uint64_t)__va(&_etext);
init.rkp_pgt_bitmap = (uint64_t)&rkp_pgt_bitmap;
init.rkp_dbl_bitmap = (uint64_t)&rkp_map_bitmap;
init.rkp_bitmap_size = 0x20000;

init.vmalloc_start = (uint64_t)__va(&_text);
init.vmalloc_end = (uint64_t)__va(&_etext+0x1000);
init.init_mm_pgd = (uint64_t)&swapper_pg_dir;
init.id_map_pgd = (uint64_t)&id_pg_dir;
init.zero_pg_addr = (uint64_t)&zero_page;
init.extra_memory_addr = RKP_EXTRA_MEM_START;
init.extra_memory_size = RKP_EXTRA_MEM_SIZE;
init._srodata = (uint64_t)__va(&_srodata);
init._erodata = (uint64_t)__va(&_erodata);

rkp_call(RKP_INIT, &init, (uint64_t)VA_OFFSET, 0, 0, 0);

// framework/util.S

hvc #0

magic : 0x000000005afe0001
vmalloc_start : 0xffffff8080000000
vmalloc_end : 0xffffff8080086000
init_mm_pgd : 0x0000000080088000
id_map_pgd : 0x000000008008b000
zero_pg_addr : 0x000000008008e000
rkp_pgt_bitmap : 0x0000000080044000
rkp_dbl_bitmap : 0x0000000080064000
rkp_bitmap_size : 0x0000000000020000
_text : 0xffffff8080000000
_etext : 0xffffff8080085000
extra_mem_addr : 0x00000000af400000
extra_mem_size : 0x0000000000600000
physmap_addr : 0x0000000000000000
_srodata : 0xffffff8080085000
_erodata : 0xffffff8080086000
large_memory : 0x0000000000000000
fimc_phys_addr : 0x00000008fa080000
fimc_size : 0x0000000000780000
tramp_pgd : 0x0000000000000000

Before everything else, the debug log at 0xb0200000 is initialized (11).
This is the second EL2 oracle and we will be discussing it shortly as it
will provide valuable information to help create correct memory mapping for
the initialization to be successful.

Evidently, there are two modes of RKP operation which are decided upon
during the initialization; normal and test mode. Test mode disables some of
the aforementioned `hvc` command invocation counters and enables some
command indices/functions. As the name suggests these are used for testing
purposes and while these may assist and ease the reversing process, we will
not be analyzing them in depth, because the are not encountered in real
world setups. The mode is selected by the struct magic field, whose value
can either be 0x5afe0001 (normal mode) or 0x5afe0002 (test mode).

It would be possible to change to test mode via a second `rkp_init()`
invocation while hoping not to break any other configurations, however this
is not possible via normal system interaction. As shown in (12) after a
successful initialization, global flag `is_rkp_activated` is set. This flag
is then checked (10) before calling `rkp_init()` in `rkp_main()` function
as demonstrated in the previously presented snippet.

// vmm-G955FXXU4CRJ5.elf

void rkp_init(exception_frame *exception_frame)

rkp_init_values = maybe_rkp_get_pa(exception_frame->x1);

rkp_debug_log_init(); /* (11) */

if ( rkp_init_values->magic - 0x5AFE0001 <= 1 ){

if ( rkp_init_values->magic == 0x5AFE0002 )
/* enable test mode */

/* store all rkp_init_t struct values */



if ( rkp_bitmap_init() )
/* misc initializations and debug logs */

rkp_debug_log("RKP_6398d0cb", hcr_el2,
sctlr_el2, rkp_init_values->magic);

/* more debug logs */

if ( rkp_paging_init() )
is_rkp_activated = 1; /* (12) */


RKP maintains a struct storing all required information. During
initialization in RKP function `rkp_init()`, values passed via `rkp_init_t`
struct along with the VA_OFFSET are stored there to be used later. Next,
various memory regions such as physmap and bitmaps are initialized. We are
not going to be expanding on those regions since they are implementation
specific, but due to their heavy usage by RKP (especially physmap) we are
going to briefly explain them. Physmap contains information about physical
regions, such as whether this is an EL2 or EL1 region etc., is set to a
predefined EL2 only accessible region as explained next and RKP uses this
information to decide if certain actions are allowed on specific regions.

Two bitmaps exist in this specific RKP implementation; rkp_pgt_bitmap and
rkp_dbl_bitmap and their physical regions are provided by EL1 kernel. They
are both written to by RKP. rkp_pgt_bitmap provides information to EL1 on
whether addresses are protected by S2 mappings and as such accesses should
be handled by RKP. rkp_dbl_bitmap is used to track and prevent unauthorized
mappings from being used for page tables. The `rkp_bitmap_init()` success
requires only the pointers to not be zero, however additional restrictions
are defined during `rkp_paging_init()` function (0xb010e4c4) later.

Next, we see the RKP debug log being used, dumping system registers thus
providing important information regarding the system state/configuration,
which has helped us understand the system and configure the framework.
Below a (processed) sample output is displayed with the various registers
annotated. Finally, Samsung allows OEM unlock for the under examination
device model, which allows us to patch vmm.elf, build and boot the kernel
with the patched RKP and retrieve additional information. The final snippet
line contains the debug log from a separate execution, where MAIR_ELn
registers were replaced with SCTLR_EL1 and VTCR_EL2 respectively. How to
build a custom kernel and boot a Samsung device with it is left as exercise
to the reader.

0000000000000000 neoswbuilder-DeskTop RKP64_01aa4702
0000000000000000 Jul 11 2018
0000000000000000 11:19:42

/* hcr_el2 */ /* sctlr_el2 */
84000003 30cd1835 5afe0001 RKP_6398d0cb

/* tcr_el2 */ /* tcr_el1 */
80823518 32b5593519 5afe0001 RKP_64996474

/* mair_el2 */ /* mair_el1 */
21432b2f914000ff 0000bbff440c0400 5afe0001 RKP_bd1f621f

/* sctlr_el1 */ /* vtcr_el2 */
34d5591d 80023f58 5afe0001 RKP_patched

Finally, one of the most important functions in RKP initialization follows;
`rkp_paging_init()`. Numerous checks are performed in this function and the
system memory layout must satisfy them all for RKP to by initialized
successfully. Furthermore, physmap, bitmaps and EL2 Stage 1 and 2 tables
are set or processed. We will be explaining some key points but will not go
over every trivial check. Finally, we must ensure that any RKP required
regions are reserved. The physical memory layout used in the framework
aiming to satisfy the minimum requirements to achieve proper RKP
initialization is shown below. Obviously, more complex layouts can be used
to implement more feature rich frameworks.

The graph also explains the previously presented size selection of 3GBs for
the emulation system RAM. This size ensures that the framework has a
sufficiently large PA space to position executables in their expected PAs.

+---------+ 0x80000000 text, vmalloc
| |
| |
| |
| |
+---------+ 0x80044000 rkp_pgt_bitmap
| |
| |
+---------+ 0x80064000 rkp_map_bitmap
| |
| |
+---------+ 0x80085000 _etext, srodata
| |
+---------+ 0x80086000 _erodata, vmalloc_end
| |
| |
+---------+ 0x80088000 swapper_pg_dir
| |
| |
+---------+ 0x8008b000 id_pg_dir
| |
| |
+---------+ 0x8008e000 zero_page
| |
| |
+---------+ 0xaf400000 rkp_extra_mem_start
| |
| |
+---------+ 0xafa00000 rkp_extra_mem_end
| |
+---------+ 0xafc00000 rkp_phys_map_start
| |
| |
+---------+ 0xb0100000 rkp_phys_map_end, hyp_base

To sum up the process, after alignment and layout checks, the EL1 kernel
region is set in physmap (13) and mapped in EL2 Stage 1 translation tables
(14). The two bitmap regions are checked (15) and if they are not
incorporated in the kernel text, their Stage 2 (S2) entries are changed to
Read-Only and not executable (16) and finally physmap is updated with the
two bitmap regions. FIMC region, which will be discussed shortly, is
processed next (17) in function `my_process_fimc_region()` (0xb0112df0).
Continuing, kernel text is set as RWX in S2 translation tables (18) which
will change later during the initialization to read-only. Last but not
least, physmap and extra memory address are unmapped from S2 (19) and (21)
rendering them inaccessible from EL1 and their physmap regions are set (20)
and (22).

// vmm-G955FXXU4CRJ5.elf

int64_t rkp_paging_init(void)
/* alignment checks */

v2 = my_rkp_physmap_set_region(text_pa, etext - text, 4); /* (13) */
if ( !v2 ) return v2;

/* alignment checks */

res = s1_map(text_pa, etext_pa - text_pa, 9); /* (14) */

* bitmap alignment checks /* (15) */
* might lead to label do_not_process_bitmap_regions

res = rkp_s2_change_range_permission(rkp_pgt_bitmap, /* (16) */
bitmap_size + rkp_pgt_bitmap, 0x80, 0, 1); // RO, XN

res = rkp_s2_change_range_permission(rkp_map_bitmap,
bitmap_size + rkp_map_bitmap,
0x80, 0, 1); // RO, XN


if ( !my_rkp_physmap_set_region(rkp_pgt_bitmap, bitmap_size, 4) )
return 0;

res = my_rkp_physmap_set_region(rkp_map_bitmap, bitmap_size, 4);
if ( res )
res = my_process_fimc_region(); /* (17) */
if ( res )
res = rkp_s2_change_range_permission( /* (18) */
text_pa, etext_pa,
0, 1, 1); // RW, X

/* (19) */
res = maybe_s2_unmap(physmap_addr, physmap_size + 0x100000);

res = my_rkp_physmap_set_region(physmap_addr, /* (20) */
physmap_size + 0x100000, 8);

/* (21) */
res = maybe_s2_unmap(extra_memory_addr, extra_memory_size);

res = my_rkp_physmap_set_region(extra_memory_addr, /* (22) */
extra_memory_size, 8);
return res;

FIMC refers to Samsung SoC Camera Subsystem and during the kernel
initialization, regions are allocated and binaries are loaded from the
disk. There is only one relevant `hvc` call, related to the FIMC binaries
verification (command id 0x71). RKP modifies the related memory regions
permissions and then invokes EL3 to handle the verification in function
`sub_B0101BFC()`. Since we are implementing our own EL3 and are interested
in EL2 functionality we will be ignoring this region. However, we still
reserve it for completeness reasons and function `my_process_fimc_region()`
simply processes the S2 mappings for this region. By invoking `hvc` with
command id 0x71, even if every other condition is met and `smc` is reached,
as discussed above EL3 will hang because there is no handler for `smc`
command id 0xc200101d in our setup.

// vmm-G955FXXU4CRJ5.elf


mov X0, #0xC200101D
mov X1, #0xC
mov X2, X19 // holds info about fimc address, size, etc.
mov X3, #0
dsb SY
smc #0

Although, as mentioned, simply reserving the region will suffice for this
specific combination of hypervisor and subsystem, it is indicative of the
considerations needed when examining hypervisors, even if more complex
actions are required by other hypervisors and/or subsystems. For example
the verification might have been incorporated in the initialization
procedure, in which case this could be handled by our framework EL3

At this step we have performed the first step of RKP initialization
successfully. After some tasks such as the `hvc` command counters
initialization and the `is_rkp_activated` global flag setting `rkp_init()`
returns. We can now invoke other `hvc` commands.

------[ 2.3.3 - RKP Deferred Initialization

The next step is the deferred initialization which is handled by function
`rkp_def_init()` (0xb01131dc) and its main purpose is to set the kernel
S2 translation permissions.

// vmm-G955FXXU4CRJ5.elf

void rkp_def_init(void)

if ( srodata_pa >= etext_pa )
if (!rkp_s2_change_range_permission(text_pa, etext_pa, 0x80, 1, 1))
// Failed to make Kernel range ROX
rkp_debug_log("RKP_ab1e86d9", 0, 0, 0);
res = rkp_s2_change_range_permission(text_pa, srodata_pa,
0x80, 1, 1)) // RO, X

res = rkp_s2_change_range_permission(srodata_pa, etext_pa,
0x80, 0, 1)) // RO, XN

rkp_l1pgt_process_table(swapper_pg_dir, 1, 1);
rkp_debug_log("RKP_8bf62beb", 0, 0, 0);

As demonstrated below after `rkp_s2_change_range_permission()` invocation
the kernel region is set to read only. Finally, in
`rkp_l1pgt_process_table()` swapper_pg_dir (TTBR1_EL1) and its subtables
are set to read-only and not-executable.

// EL1 text before rkp_s2_change_range_permission()
Third level: 0x80000000-0x80001000: S2AP=11, XN=0
// EL1 text after rkp_s2_change_range_permission()
Third level: 0x80000000-0x80001000: S2AP=1, XN=0

// swapper_pg_dir before rkp_l1pgt_process_table()
Third level: 0x80088000-0x80089000: S2AP=11, XN=0
Third level: 0x80089000-0x8008a000: S2AP=11, XN=0
// swapper_pg_dir after rkp_l1pgt_process_table()
Third level: 0x80088000-0x80089000: S2AP=1, XN=10
Third level: 0x80089000-0x8008a000: S2AP=1, XN=10

------[ 2.3.4 - Miscellaneous Initializations

In our approach, we have not followed the original kernel initialization to
the letter. Specifically, we skip various routines initializing values
regarding kernel structs such as credentials, etc., which are void of
meaning in our minimal framework. Moreover, these are application specific
and do not provide any valuable information required by the ARM
architecture to properly define the EL2 state. However, we will be briefly
presenting them here for completeness reasons, and as our system
understanding improves and the framework supported functionality
requirements increase (for example to improve fuzzing discussed next) they
can be incorporated in the framework.

Command 0x40 is used to pass information about cred and task structs
offsets and then command 0x42 for cred sizes during the credential
initialization in kernel's `cred_init()` function. Next, in `mnt_init()`
command 0x41 is used to inform EL2 about vfsmount struct offsets and then
when rootfs is mounted in `init_mount_tree()` information regarding the
vfsmount are sent via command 0x55. This command is also used later for the
/system partition mount. These commands can only be called once (with the
exception of command 0x55 whose counter is 2) and as mentioned above are
used in the original kernel initialization process. Incorporating them to
the framework requires understanding of their usage from both the kernel
and the hypervisor perspective which will be left as an exercise to the
reader who can start by studying the various `rkp_call()` kernel

----[ 2.4 - Final Notes

At this point we have performed most of the expected RKP initialization
routines. We now have a fully functional minimal framework which can be
easily edited to test and study the RKP hypervisor behavior.

More importantly we have introduced fundamental concepts for readers to
implement their own setups and reach the current system state which allows
us to interact with it and start investigating fuzzing implementations.

On a final note, some of the original kernel initialization routines were
omitted since their action lack meaning in our framework. They were briefly
introduced and interested readers can study the various `rkp_call()` kernel
invocations and alter the framework state at will. Additionally, this
allows the fuzzers to investigate various configuration scenarios not
restricted by our own assumptions.

--[ 3 - Fuzzing

In this section we will be describing our approaches towards setting up
fuzzing campaigns under the setup presented above. We will begin with a
naive setup aiming to introduce system concepts we need to be aware and an
initial interaction with QEMU source code and functionality. We will then
be expanding on this knowledge, incorporating AFL in our setup for more
intelligent fuzzing.

To verify the validity of the fuzzing setups presented here we evidently
require a bug that would crash the system. For this purpose we will be
relying on a hidden RKP command with id 0x9b. This command leads to
function `sub_B0113AA8()` which, as shown in the snippet, adds our second
argument (register X1) to value 0x4080000000 and uses the result as an
address to store a QWORD. As you might be imagining, simply passing 0 as
our second argument results in a data abort ;)

// vmm-G955FXXU4CRJ5.elf

int64_t sub_B0113AA8(exception_frame *exc_frame)
*(exc_frame->x1 + 0x4080000000) = qword_B013E6B0;
rkp_debug_log("RKP_5675678c", qword_B013E6B0, 0, 0);
return 0;

To demonstrate the framework usage we are going to trigger this exception
with a debugger attached. We start the framework and set a breakpoint in
the handler from `hvc` command 0x9b at the instruction writing the QWORD to
the evaluated address. Single stepping from there causes an exception,
which combined with the previous information about RKP exception handlers,
we can see is a synchronous exception from the same EL. Continuing
execution from there we end up in the synchronous handler for data aborts
(EC 0x25) which leads to `vmm_panic()` :)

(gdb) target remote :1234
_reset () at boot64.S:15
15 ldr x30, =stack_top_el3

(gdb) continue
Breakpoint 1, 0x00000000b0113ac4 in ?? ()
(gdb) x/4i $pc-0x8
0xb0113abc: mov x0, #0x80000000
0xb0113ac0: movk x0, #0x40, lsl #32
=> 0xb0113ac4: str x1, [x2,x0]
0xb0113ac8: adrp x0, 0xb0116000
(gdb) info registers x0 x1 x2
x0 0x4080000000 277025390592
x1 0x0 0
x2 0x1 1

(gdb) stepi
0x00000000b010c1f4 in ?? ()

(gdb) x/20i $pc
=> 0xb010c1f4: stp x1, x0, [sp,#-16]!
0xb010c234: mov x0, #0x200 // Current EL
0xb010c238: mov x1, #0x0 // Synchronous
0xb010c23c: mov x2, sp
0xb010c240: bl 0xb010aa44 // vmm_dispatch

(gdb) continue

Breakpoint 5, 0x00000000b010a80c in ?? () // EC 0x25 handler
(gdb) x/7i $pc
=> 0xb010a80c: mov x0, x22
0xb010a810: mov x1, x21
0xb010a814: mov x2, x19
0xb010a818: adrp x3, 0xb0115000
0xb010a81c: add x3, x3, #0x4d0
0xb010a820: bl 0xb010a4cc // vmm_panic

----[ 3.1 - Dummy fuzzer

To implement the dummy fuzzer we decided to abuse `brk` instruction, which
generates a Breakpoint Instruction exception. The exception is recorded in
in ESR_ELx and the value of the immediate argument in the instruction
specific syndrome field (ESR_ELx.ISS, bits[24:0]). In QEMU, this
information is stored in `CPUARMStame.exception` structure as shown in the
following snippet.

// qemu/target/arm/cpu.h

typedef struct CPUARMState {

/* Regs for A64 mode. */
uint64_t xregs[32];


/* Information associated with an exception about to be taken:
* code which raises an exception must set cs->exception_index and
* the relevant parts of this structure; the cpu_do_interrupt function
* will then set the guest-visible registers as part of the exception
* entry process.
struct {
uint32_t syndrome; /* AArch64 format syndrome register */
} exception;

`arm_cpu_do_interrupt()` function handles the exceptions in QEMU and we can
intercept the `brk` invocation by checking `CPUState.exception_index`
variable as shown in (23). There we can introduce our fuzzing logic and
setup the system state with our fuzzed values for the guest to access as
discussed next. Finally, to avoid actually handling the exception (calling
the exception vector handle, changing ELs etc.) which would disrupt our
program flow, we simply advance `pc` to the next instruction and return
from the function. This effectively turns `brk` into a fuzzing instruction.

// qemu/target/arm/helper.c

/* Handle a CPU exception for A and R profile CPUs.
void arm_cpu_do_interrupt(CPUState *cs)
ARMCPU *cpu = ARM_CPU(cs);
CPUARMState *env = &cpu->env;

// Handle the break instruction
if (cs->exception_index == EXCP_BKPT) { /* (23) */

handle_brk(cs, env);

env->pc += 4;


We utilize syndrome field as a function identifier and specifically
immediate value 0x1 is used to call the dummy fuzzing functionality. There
are numerous different harnesses that can be implemented here. In our demo
approach we only use a single argument (via X0) which points to a guest
buffer where fuzzed data could be placed. The framework registers, hence
arguments which will be passed to EL2 by `rkp_call_fuzz` after calling
`__break_fuzz()` are set by our harness in function `handle_brk()`.

// framework/main.c

void el1_main(void) {
rkp_call(RKP_DEF_INIT, 0, 0, 0, 0, 0);

for(; ;){ // fuzzing loop
__break_fuzz(); // create fuzzed values
rkp_call_fuzz(); // invoke RKP

// framework/util.S

ldr x0, =rand_buf
brk #1

hvc #0

We will not be presenting complex harnesses here since this is beyond the
scope of this article and will be left as exercise for the reader. We will,
however, be describing a simple harness to fuzz RKP commands. Moreover,
since most RKP handlers expect the second argument (X1 register) to point
to a valid buffer we will be using `rand_buf` pointer as shown above for
that purpose.

The logic should be rather straightforward. We get a random byte (24), at
the end place it in X0 (25) and as a result will be used as the RKP command
index. Next, we read a page of random data and copy it to the guest buffer
`rand_buf` (using function `cpu_memory_rw_debug()`) and use it as the
second argument by placing the buffer address in X1 (26).

// qemu/target/arm/patch.c

int handle_brk(CPUState *cs, CPUARMState *env)
uint8_t syndrome = env->exception.syndrome & 0xFF;
int l = 0x1000;
uint8_t buf[l];

switch (syndrome) {
case 0: // break to gdb
if (gdbserver_running()) {
qemu_log_mask(CPU_LOG_INT, "[!] breaking to gdb\n");
case 1: ; // dummy fuzz
uint8_t cmd = random() & 0xFF; /* (24) */

/* write random data to buffer buf */

* Write host buffer buf to guest buffer pointed to
* by register X0 during brk invocation
if (cpu_memory_rw_debug(cs, env->xregs[0], buf, l, 1) < 0) {
fprintf(stderr, " Cannot access memory\n");
return -1;

fuzz_cpu_state.xregs[0] = 0x83800000 | (cmd << 12);
fuzz_cpu_state.xregs[1] = env->xregs[0];

env->xregs[0] = fuzz_cpu_state.xregs[0]; /* (25) */
env->xregs[1] = fuzz_cpu_state.xregs[1]; /* (26) */
return 0;

As you might expect after compiling the modified QEMU and executing the
fuzzer, nothing happens! We elaborate more on this next.

------[ 3.1.1 - Handling Aborts

Since this is a bare metal implementation there is nothing to "crash". Once
an abort happens, the abort exception handler is invoked and both our
framework and RKP ends up in an infinite loop. To identify aborts we simply
intercept them in `arm_cpu_do_interrupt()` similarly with `brk`.

// qemu/target/arm/helper.c

void arm_cpu_do_interrupt(CPUState *cs)

// Handle the instruction or data abort
if (cs->exception_index == EXCP_PREFETCH_ABORT ||
cs->exception_index == EXCP_DATA_ABORT ) {

if(handle_abort(cs, env) == -1) {
// reset system

When a data or instruction abort exception is generated, we create a crash
log in `handle_abort()` and then request QEMU to either reset and restart
fuzzing or terminate if `handle_abort()` fails which essentially terminates
fuzzing as we can not handle aborts. We use QEMU functions to dump the
system state such as the faulting addresses, system registers, and memory
dumps in text log files located in directory crashes/.

int handle_abort(CPUState *cs, CPUARMState *env)
FILE* dump_file;

if (open_crash_log(&dump_file) == -1) return -1;

const char *fmt_str = "********* Data\\Instruction abort! *********\n"
"FAR = 0x%llx\t ELR = 0x%llx\n"
"Fuzz x0 = 0x%llx\t Fuzz x1 = 0x%llx\n";

fprintf(dump_file, fmt_str, env->exception.vaddress,

fprintf(dump_file, "\n********** CPU State **********\n");
cpu_dump_state(cs, dump_file, CPU_DUMP_CODE);
fprintf(dump_file, "\n********** Disassembly **********\n");
target_disas(dump_file, cs, env->pc-0x20, 0x40);
fprintf(dump_file, "\n********** Memory Dump **********\n");
dump_extra_reg_data(cs, env, dump_file);

fprintf(dump_file, "\n********** End of report **********\n");


return 0;

A sample trimmed crash log is presented below. We can see that the faulting
command is 0x8389b000 (or command index 0x9b ;) the faulting address and
the code were the abort happened. You can create your own logs by
executing the dummy fuzzer ;)

********** Data\Instruction abort! **********
FAR = 0x41000c5000 ELR = 0xb0113ac4
Fuzz x0 = 0x8389b000 Fuzz x1 = 0x800c5000

********** CPU State **********
PC=00000000b0113ac4 X00=0000004080000000 X01=0000000000000000
X02=00000000800c5000 X03=0000000000000000 X04=0000000000000000
X29=00000000b0142e70 X30=00000000b010d294 SP=00000000b0142e70
PSTATE=600003c9 -ZC- NS EL2h

********** Disassembly **********
0xb0113abc: d2b00000 movz x0, #0x8000, lsl #16
0xb0113ac0: f2c00800 movk x0, #0x40, lsl #32
0xb0113ac4: f8206841 str x1, [x2, x0]
0xb0113ac8: f0000000 adrp x0, #0xb0116000
0xb0113acc: 911ac000 add x0, x0, #0x6b0

********** Memory Dump **********
X00: 0x0000004080000000
000000407fffff60: Cannot access memory


X02: 0x00000000800c5000
00000000800c4fe0: 0x0000000000000000 0x0000000000000000
00000000800c4ff0: 0x0000000000000000 0x0000000000000000
00000000800c5000: 0x21969a71a5b30938 0xc6d843c68f2f38be
00000000800c5010: 0xd7a1a2d7948ffd7e 0x42793a9f98647619
00000000800c5020: 0x87c01b08bb98d031 0x1949658c38220d4d


********** End of report **********

------[ 3.1.2 - Handling Hangs

RKP has two functions that lead to system hangs; `rkp_policy_violation()`
and `vmm_panic()`. The former is used when RKP unsupported exceptions or
exception classes are triggered, while the latter aligns better with the
`assert()` function logic.

Since there are only two functions with these characteristics we can simply
reset the system if they are ever executed. This is done in QEMU function
`cpu_tb_exec()` which is responsible for emulating the execution of a
single basic block. When they are identified via their address, the system
is reset as with the abort case presented above, without however creating a
crash log file.

Evidently, this is not an optimal approach and does not scale well. We
will be providing a better solution in the setup with AFL described next.

// qemu/accel/tcg/cpu-exec.c

/* Execute a TB, and fix up the CPU state afterwards if necessary */
static inline tcg_target_ulong cpu_tb_exec(CPUState *cpu,
TranslationBlock *itb)
CPUArchState *env = cpu->env_ptr;

if (env->pc == 0xB010DBA4) { // rkp_policy_violation
qemu_log("[!] POLICY VIOLATION!!! System Reset!\n");

if (env->pc == 0xB010A4CC) { // vmm_panic
qemu_log("[!] VMM PANIC!!! We should not be here!!!\n");


----[ 3.2 - AFL with QEMU full system emulation

One of the major problems encountered during this work was QEMU changing
rapidly. This caused various tools to become obsolete, unless teams were
dedicated porting them to newer versions fixing various problems introduced
by the modified QEMU code. With this in mind, we will first introduce
problems stemming from this situation and previous work on full system
emulation. We will then proceed with the proposed solution.

------[ 3.2.1 - Introduction

As mentioned before, we chose the latest stable QEMU v4.1.0 and AFL v2.56b.
The first step was to port AFL to the target QEMU version. The patch
itself is rather straightforward, so we will not be presenting details
here. Refer to the attached afl-2.56-qemu-4.1.0-port/readme for more
details. Note that to remove the QEMU directory from the AFL subfolder, we
included in AFL header files config.h and afl-types.h in the patch. As a
result, to avoid any unexpected behaviors theses files must be kept in sync
between AFL and QEMU.

After applying the patches and building QEMU and copying the resulting
binary in AFL directory as `afl-qemu-trace`, we invoke AFL with QEMU in the
old fashioned way:

$ ./afl-fuzz -Q -i in -o out /usr/bin/readelf -a @@

We will briefly explain some QEMU/AFL key points to help understand the
modified version. With QEMU the forkserver practically runs inside QEMU,
starts when the ELF entry point is encountered and is kept in sync with AFL
via pipes. When AFL instructs forkserver to run once, the forkserver
(parent) clones itself, writes the QEMU child (child) pid to AFL and allows
the child to execute free. AFL sets a child execution watchdog which will
terminate the child if triggered. While the child runs it updates the AFL
bitmap (`afl_maybe_log()`) and reports blocks that have not been translated
yet back to the parent (`afl_request_tsl()`) who waits in a read loop
(`afl_wait_tsl()`). Once a new block is encountered the parent mirrors the
translation and avoid re-translation for future children which
significantly improves fuzzing performance (interested readers can also
check [07]). Upon termination/crash/exit of the child, parent exits the
wait loop, reports back to AFL and awaits AFL to order a new execution.

+-------+ +-------------+ +------------+
| AFL | | Qemu Parent | | Qemu Child |
+-------+ +-------------+ +------------+
| . .
init_forkserver . .
| . .
fork/exec ------------> afl_setup .
| (entry point) .
setitimer | .
| | .
read <----+ | .
(block) | afl_forkserver .
| | | .
| +--unblock--- write .
| | <-------------------------------+
run_target +-------> read . |
| | (block) . |
| | | . |
write --unblock--+ | . |
| | . |
read <----+ fork -----------------> run |
(block) | | | <------+ |
| | | | | |
| +--unblock--- write afl_maybe_log | |
setitimer (child pid) | | |
| | | | |
read <-----+ | | | |
(block) | | | | |
| | afl_wait_tsl/read <----- afl_request_tsl | |
| | (loop block) write | |
| | | | | |
do stuff | | +--------+ |
| | waitpid() <---+ | |
| | | | terminate |
| | | +----------- exit |
| | | crash |
| +--unblock--- write |
| (child status) |
| | |
| +--------------repeat----------------+

Our approach is based on TriforceAFL [08] whose goal was to fuzz the Linux
kernel. We are going to provide a brief overview but skip various details,
because as aforementioned TriforceAFL is based on old QEMU (2.3.0) and AFL
(2.06b) versions, currently does not build and the project seems to be
abandoned. Furthermore, Linux kernel is vastly more complex compared to our
framework and the targeted hypervisor and for this reason different hashing
algorithm for the bitmap was used, which is not required here.
Additionally, the target in this article is an ARM binary and executes on
different level (EL2) from the Linux kernel (EL1). Nonetheless, interested
readers may refer to the project source code, documentation [09] and slides
for additional details.

In short, they introduced an instruction as a handler to dispatch
operations to 4 different functions called "hypercalls", all handled by
QEMU. The parent executes normally and boots the VM until the first
hypercall `startForkServer` is encountered which causes the forkserver to
be instantiated. The parent/forkserver the spawns a child guest which then
invokes hypercall `getWork` to fetch the new testcase from the host to the
guest VM and then hypercall `startWork` to enable tracing and set the
address region to be traced. If the child does not crash, it terminates by
calling hypercall `endWork` to force the child QEMU to exit. These
"hypercalls" are invoked from a custom Linux kernel driver.

As stated in TriforceAFL, getting forkserver to work was one of the most
difficult parts. QEMU full system emulation uses 3 threads; CPU, IO and
RCU. Their solution was to have `startForkServer` hypercall set a flag
which causes CPU thread (vCPU) to exit the CPU loop, save some state
information, notify the IO thread and exit. IO thread then receives the
notification and starts the forkserver by forking itself. The child IO
thread then spawns a new vCPU thread which restores its state from the
previous vCPU saved information and continues execution cleanly from
`startForkServer`. Basically, the forkserver is the IO thread (whose vCPU
thread has now terminated) and each new fork child spawns a new vCPU thread
(with information from the parent vCPU saved state) to do the CPU

Finally, AFL was edited to increase the QEMU parent/child memory limit
MEM_LIMIT_QEMU because full system emulation has larger memory requirements
compared to user mode emulation, especially for emulating Linux kernel.
Furthermore, during the AFL `init_forkserver()` fork, a timer controlled by
FORK_WAIT_MULT defined value is set in AFL to avoid blocking in read
indefinitely in case forkserver in parent fails. This value was increased,
because during this step the parent initializes the guest VM until
`startForkServer` hypercall is reached, which might be time consuming. Last
but not least, mode enabled by argument -QQ was introduced to allow user to
specify the QEMU binary path instead of using `afl-qemu-trace`.

Our approach relies heavily on TriforceAFL as mentioned before. We decided
to skip the TriforceAFL implementation details due to the vast QEMU
differences, however we recommend readers to study the TriforceAFL [08]
implementation and documentation.

------[ 3.2.2 - Implementation

First we are going to go over the AFL diff which is the most brief since we
only modified afl-fuzz.c and config.h and we do not deviate much from
TriforceAFL. The QEMU parent/child memory limits have been commented out
since our framework emulation has much larger memory requirements in
comparison. Secondly, to disable QEMU chaining feature which affects AFL
stability, AFL normally sets environmental variable "QEMU_LOG" to "nochain"
(see qemu/linux-user/main.c for details) before invoking QEMU in user mode.
This option however is not honored in full system emulation and as a result
QEMU option `-d nochain` _must_ be specified during QEMU full system
emulation invocation. Lastly, users must set the various system
configurations AFL requires such as disabling the CPU frequency scaling and
external core dump handling utilities. We invoke the fuzzer with our setup

./afl-fuzz -QQ -i in -o out \
<path-to-qemu>/aarch64-softmmu/qemu-system-aarch64 \
-machine virt \
-cpu cortex-a57 \
-smp 1 \
-m 3G \
-kernel kernel.elf \
-machine gic-version=3 \
-machine secure=true \
-machine virtualization=true \
-nographic \
-d nochain \
-afl_file @@

--------[ - QEMU patches

At this point we will be providing details regarding the QEMU patches to
support full system AFL fuzzing since as mentioned before, even though the
main idea persists, there are many differences compared to the original
TriforceAFL implementation mainly due to vast QEMU differences between the
versions. The first difference is that we utilized `brk` to introduce
hypercalls instead of introducing a new instruction.

// qemu/target/arm/patch.c

int handle_brk(CPUState *cs, CPUARMState *env)

switch (syndrome) {

case 3:
return start_forkserver(cs, env, env->xregs[0]);
case 4:
return get_work(cs, env, env->xregs[0], env->xregs[1]);
case 5:
return start_work(cs, env, env->xregs[0], env->xregs[1]);
case 6:
return done_work(env->xregs[0]);
return 0;

To better demonstrate the setup we provide the following diagram and each
step will be explained next. Readers are also advised to compare this with
the original AFL/QEMU diagram presented previously.

+-------------+ +-------------+ +------------+ +-------------+
| Qemu Parent | | Qemu Parent | | Qemu Child | | Qemu Child |
| IO thread | | vCPU thread | | IO thread | | vCPU thread |
+-------------+ +-------------+ +------------+ +-------------+
| . . .
initialize . . .
QEMU . . .
| . . .
(27) start vCPU -----> thread entry point . .
| | . .
do stuff <-+ tcg_register_thread (28) . .
| | | . .
+-------+ | . .
| main execution loop . .
| execute guest VM . .
| until start_forkserver . .
| (29) . .
| | . .
| | . .
| start_forkserver . .
| | . .
| set afl_wants_cpu_to_stop . .
| (30) . .
| | . .
| save vCPU state . .
| (31) . .
| | . .
| +-- notify . .
| | IO thread . .
| | (32) . .
| | | . .
got_pipe_notification <--+ exit . .
| | . .
afl_forkserver (33) X . .
| . .
write(unblock AFL) . .
| . .
+-> read(from AFL, block) . .
| | . .
| fork --------------------------> restore vCPU state .
| | (34) .
| | | .
| | start --> thread entry point
| | vCPU (35) |
| | | |
| | | tcg_register_thread
| | | (36)
| | | |
| write | getWork
| (child pid to AFL) | |
| | +--> do stuff |
repeat ... | | startWork
| | +-------+ |
| | |
| afl_wait_tsl <-----------------+ afl_maybe_log
| (37) | |
| | | |
| | +------------------- afl_request_tsl
| waitpid <-----------+ (38)
| | | |
| | | |
| write | crash
| (child status to AFL) +-------------------------------- endWork
| |

During system initialization, vCPU is instantiated (27) by IO thread in a
manner dependent on the system configuration. Our setup uses Multithread
Tiny Coge Generator (MTTCG) which allows the host to run one host thread
per guest vCPU. Note that we are using a single core/thread and as a result
there is a single vCPU thread in our setup.

The vCPU thread entry point for MTTCG configuration is function
`qemu_tcg_cpu_thread_fn()` under qemu/cpus.c where, after some
initializations, vCPU enters its main execution loop (29)-(40). In
a high level of abstraction, execution loop comprises two steps;
translating basic blocks (function `tb_find()`) and executing them
(function `cpu_tb_exec()`).

As mentioned before, we allow the QEMU parent to execute free and
initialize the guest VM until `start_forkserver` hypercall is invoked. As a
result, each forkserver child will start with a _fully initialized VM_
right before the targeted functionality significantly improving fuzzing

// qemu/cpus.c

/* Multi-threaded TCG
* In the multi-threaded case each vCPU has its own thread. The TLS
* variable current_cpu can be used deep in the code to find the
* current CPUState for a given thread.

static void *qemu_tcg_cpu_thread_fn(void *arg)
CPUState *cpu = arg;


tcg_register_thread(); /* (39) */

do {

r = tcg_cpu_exec(cpu); /* (40) */


} while ((!cpu->unplug || cpu_can_run(cpu)) /* (41) */
&& !afl_wants_cpu_to_stop);

if(afl_wants_cpu_to_stop) {

if(write(afl_qemuloop_pipe[1], "FORK", 4) != 4) /* (42) */
perror("write afl_qemuloop_pip");

restart_cpu = (&cpus)->tqh_first; /* (43) */


return NULL;

When during the execution `start_forkserver()` hypercall is invoked, global
flag `afl_wants_cpu_to_stop` is set (30)-(44) ultimately breaking the vCPU
main execution loop. There are various reasons that could cause the system
to reach this state so after the main loop we check flag
`afl_wants_cpu_to_stop` to decide whether vCPU must terminate (41).
Finally we save the vCPU state (31)-(43), notify IO thread (32)-(42) and
terminate the vCPU thread.

// qemu/target/arm/patch.c

target_ulong start_forkserver(CPUState* cs, CPUARMState *env, ...)

* we're running in a cpu thread. we'll exit the cpu thread
* and notify the iothread. The iothread will run the forkserver
* and in the child will restart the cpu thread which will continue
* execution.
afl_wants_cpu_to_stop = 1; /* (44) */

return 0;

Parent IO thread becomes the forkserver in the notification handling
function `got_pipe_notification()` (33)-(45). In the fork child (which is
the child QEMU IO thread) we reset the vCPU state (34)-(46) and start a new
vCPU thread for the child process (35)-(47). (don't forget to comment out
the `madvise(..., DONTFORK)` invocation ;)

// qemu/cpus.c

static void got_pipe_notification(void *ctx)

afl_forkserver(restart_cpu); /* (45) */

/* we're now in the child! */
(&cpus)->tqh_first = restart_cpu; /* (46) */

qemu_tcg_init_vcpu(restart_cpu); /* (47) */

Finally, for MTTCG all TCG threads must register their context before
starting translation (36)-(39) as part of their initialization process
mentioned before. As shown next, each thread registers its context in
`tcg_ctxs` array in an incremental fashion and assigns it to thread local
variable `tcg_ctx`. It is obvious that the system was not designed with a
forkserver in mind, where vCPU thread is respawned and trying to register a
new context for the forkserver children will fail. However, since we
use a single thread and we can simply bypass this by patching function
`tcg_register_thread()` to always set `tcg_ctx` to the first array entry
after the first invocation.

// qemu/tcg/translate-all.c

__thread TCGContext *tcg_ctx;

// qemu/tcg/tcg.c

void tcg_register_thread(void)
static bool first = true;
if (!first) {
tcg_ctx = tcg_ctxs[0];
first = false;


*s = tcg_init_ctx;


/* Claim an entry in tcg_ctxs */
n = atomic_fetch_inc(&n_tcg_ctxs);
g_assert(n < ms->smp.max_cpus);
atomic_set(&tcg_ctxs[n], s);

tcg_ctx = s;


--------[ - Framework support

Let's now demonstrate how to reach the state where forkserver is up and
running via the framework. After the framework initialization we call
`__break_start_forkserver()` from EL1 (48) which in turn calls `brk` with
instruction specific syndrome 3 which corresponds to the `start_forkserver`
hypercall. This eventually causes the forkserver to be started in the
parent QEMU process as discussed above.

Each new child QEMU process, will resume guest VM execution in its vCPU at
the instruction immediately following `__break_start_forkserver()` in a
guest VM state identical to the one the parent process had before
instantiating the forkserver. For example, in our setup the child will
continue in (49) invoking the `get_work` hypercall to fetch the test case
from the host (technically it will resume from `ret` instruction after
`brk #3` in `__break_start_forkserver()` function but you get the idea ;).

// framework/main.c

void el1_main(void) {

rkp_call(RKP_DEF_INIT, 0, 0, 0, 0, 0);

__break_start_forkserver(0); /* (48) */

/* fuzzing loop */
for(; ;){
__break_get_work(); /* (49) */

rkp_call_fuzz_afl((*(uint64_t*)(&rand_buf)), &rand_buf); /* (50) */


// framework/afl.S

brk #3

ldr x0, =rand_buf
mov x1, 0x1000
brk #4

mov x0, #RKP_VMM_START
add x1, x0, #RKP_VMM_SIZE
brk #5

hvc #0

// x0 is the exit value
brk #6

For demonstration purposes and to verify that the fuzzer works as expected,
we will be using the same fuzzing harness as with the dummy fuzzer to fuzz
the `hvc` command ids. If everything works as expected we should have at
least one crash by invoking command 0x9b.

As mentioned above, framework function `__break_get_work()` (49) invokes
qemu `get_work` hypercall (51). There, the child QEMU reads the AFL
created test case and copies its contents in guest VM `rand_buf`. In the
next step, `__break_start_work()` framework function invokes `start_work`
hypercall (52) which sets the child process to only track and edit the
AFL bitmap for addresses in the RKP range.

// qemu/target/arm/patch.c

static target_ulong get_work(CPUState *cs, CPUARMState *env, /* (51) */
target_ulong guest_ptr, target_ulong sz)
int l = 0x1000;
uint8_t buf[l];

assert(afl_start == 0);
fp = fopen(afl_file, "rb");
if(!fp) {
return -1;

fread(buf, l, 1, fp); // must add checks

if (cpu_memory_rw_debug(cs, guest_ptr, buf, l, 1) < 0) {
fprintf(stderr, " Cannot access memory\n");
return -1;

return retsz;

static target_ulong start_work(CPUState *cs, CPUArchState *env, /* (52) */
target_ulong start, target_ulong end)
afl_start_code = start;
afl_end_code = end;
afl_start = 1;
return 0;

The initial testcase provided to AFL must execute without crashing. For
that we use command id 0x98 which as shown in the snippet simply writes in
the debug log and exits. At long last, we can invoke and fuzz the `hvc`
handler. We read the first QWORD (50) from the provided test case as the
command id and simply use `rand_buf` as the second argument as discussed in
the dummy fuzzer harness.

// vmm-G955FXXU4CRJ5.elf

void rkp_main(uint64_t command, exception_frame *exception_frame)

switch ( hvc_cmd )

case 0x98:
rkp_debug_log("RKP_a3d40901", 0, 0, 0); // CFP_JOPP_INIT

However, not long after the `hvc` invocation our system crashes. The
problem lies in the basic block translations performed by the QEMU parent
process as we elaborate on in the next section.

--------[ - Handling parent translations

For QEMU to perform basic block translations for ARM architectures, it uses
`mmu_idx` to distinguish translation regimes, such as Non-Secure EL1 Stage
1, Non-Secure EL1 Stage 2 etc. (for more details refer to ARMMMUIdx enum
definition under qemu/target/arm/cpu.h). As shown below, to evaluate the
current `mmu_idx` it relies on the current CPU PSTATE register (53). This
process is normally performed by the vCPU thread during the guest VM

// qemu/target/arm/helper.c

int cpu_mmu_index(CPUARMState *env, bool ifetch)
return arm_to_core_mmu_idx(arm_mmu_idx(env));

ARMMMUIdx arm_mmu_idx(CPUARMState *env)
int el;

el = arm_current_el(env);
if (el < 2 && arm_is_secure_below_el3(env)) {
return ARMMMUIdx_S1SE0 + el;
} else {
return ARMMMUIdx_S12NSE0 + el;

// qemu/target/arm/cpu.h

static inline int arm_current_el(CPUARMState *env)

if (is_a64(env)) {
return extract32(env->pstate, 2, 2); /* (53) */

As earlier discussed, in QEMU/AFL when a child process encounters a basic
block previously not translated, it instructs (38)-(55) the parent to
mirror the basic block translation process (37)-(57) so that next
children will have cached copies to avoid re-translation and improve
performance [07]. To achieve this, the child sends (55) the current pc
address along with other information for the parent to perform the
translation (57) _within its own CPU state_. Moreover, in our setup the
parent translation is performed by the IO thread because vCPU thread is
terminated during the forkserver instantiation. The problem of course lies
in a state inconsistency between the child and the parent.

We will demonstrate the state inconsistency via an example. When the parent
becomes the forkserver in our setup/framework it is executing in EL1.
While the child process executes, its vCPU will emulate the `hvc`
invocation, change its state to EL2 to continue with the emulation of the
hypervisor code and almost certainly encounter new basic blocks. As
mentioned above, it will instruct the parent to do the translation as well.
As there is no way for the parent to be aware of the child state changes it
will remain in EL1. It should be obvious now that when the parent tries to
translate the EL2 basic blocks while being in EL1 will fail.

So the child must also send its PSTATE (54) which the parent uses to set
its own PSTATE (56) and then perform the translation correctly.

// qemu/accel/tcg/cpu-exec.c

static inline TranslationBlock *tb_find(CPUState *cpu, ...)

if (tb == NULL) {

CPUArchState *env = (CPUArchState *)cpu->env_ptr; /* (54) */
pstate = env->pstate;

* AFL_QEMU_CPU_SNIPPET1 is a macro for
* afl_request_tsl(pc, cs_base, flags, cf_mask, pstate);

// qemu/afl-qemu-cpu-inc.h

void afl_wait_tsl(CPUState *cpu, int fd) {

CPUArchState *env = (CPUArchState *)cpu->env_ptr;

while (1) { // loop until child terminates

env->pstate = t.pstate; /* (56) */
tb = tb_htable_lookup(cpu, t.pc, t.cs_base,
t.flags, t.cf_mask); /* (57) */

Furthermore, as stated above the parent process is originally in EL1 during
the forkserver instantiation. However, the child can terminate (hopefully)
during execution in other ELs. In this case, the parent might be left in
the EL the child was during the crash (if new basic blocks were encountered
before crashing) and consequently the next fork child will also be in that
EL. However, as previously discussed each child resumes execution right
after `__break_start_forkserver()` in EL1 and as a result of being in a
different EL, translations will fail causing the child to crash. For this
reason, we save the original state before the forkserver initialization
(58) and restore it before forking the each next child (59).

void afl_forkserver(CPUState *cpu) {

CPUArchState *env = (CPUArchState *)cpu->env_ptr;
afl_fork_pstate = env->pstate; /* (58) */

/* forkserver loop */
while (1) {
env->pstate = afl_fork_pstate; /* (59) */

child_pid = fork();

if (!child_pid) {
/* Child process */
/* Parent */

afl_wait_tsl(cpu, t_fd[0]);

Before executing we need to address some issues previously encountered,
namely how to handle aborts, policy violations etc.

--------[ - Handling hangs and aborts

As shown next, if an abort exception is triggered (60) we terminate child
process with exit status -1, which AFL is modified to treat as a crash
(62). Additionally, we skip the crash logging function to avoid cluttering
the system with logs due to high execution speeds as shown next.

// qemu/target/arm/helper.c

/* Handle a CPU exception for A and R profile CPUs.
void arm_cpu_do_interrupt(CPUState *cs)

// Handle the instruction or data abort
if (cs->exception_index == EXCP_PREFETCH_ABORT || /* (60) */
cs->exception_index == EXCP_DATA_ABORT ) {

* since we are executing in afl, avoid flooding system with crash
* logs and instead terminate here
* comment out to see abort logs

if(handle_abort(cs, env) == -1) {

// afl/afl-fuzz.c

static u8 run_target(char** argv, u32 timeout) {

* Policy violation (type of assertion), treat as hang
if(qemu_mode > 1 && WEXITSTATUS(status) == 32) {
return FAULT_TMOUT; /* (61) */

/* treat all non-zero return values from qemu system as a crash */
if(qemu_mode > 1 && WEXITSTATUS(status) != 0) {
return FAULT_CRASH; /* (62) */


Furthermore, we chose to treat `rkp_policy_violation()` as a system hang by
terminating the child with status 32 (63) which is then identified by AFL
(61). Additionally, `vmm_panic()` (64) is treated as a crash. As we
previously said, this solution does not scale well because of systems where
not all possible hangs can be identified. However, AFL sets watchdog timers
for each child execution and if the timer is triggered, the child is
terminated. This is the reason we chose to have unhandled `smc` invocations
and other unexpected exceptions to loop indefinitely. They might have a
small impact in fuzzing performance (loop until timer is triggered) but
otherwise allow for a stable system setup.

In essence this setup allows for flexibility regarding the way we handle
aborts, hangs and generally all erroneous system states, with a failsafe
mechanism that guarantees the fuzzing setup robustness even when not all
system behavior corner cases have been accounted for. As our understanding
of the system improves, more of theses conditions can be incorporated in
the fuzzing logic.

// qemu/accel/tcg/cpu-exec.c

static inline TranslationBlock *tb_find(CPUState *cpu, ...)

if (pc == 0xB010DBA4) { // rkp_policy_violation
qemu_log("[!] POLICY VIOLATION!!! System Reset!\n");
exit(32); /* (63) */

if (pc == 0xB010A4CC) { // vmm_panic
qemu_log("[!] VMM PANIC!!! We should not be here!!!\n"); /* (64) */

--------[ - Demonstration

We illustrate (show off ;) below an execution snapshot. We can see the
fuzzer operating on average at 350-400 executions per second, identifying
new paths and crashes, even with our naive fuzzing harness. Lastly, reading
one of the crashes reveals the faulting command id 0x9b ;)

american fuzzy lop 2.56b-athallas (qemu-system-aarch64)

-- process timing ---------------------------------- overall results -----
| run time : 0 days, 0 hrs, 0 min, 38 sec | cycles done : 0 |
| last new path : 0 days, 0 hrs, 0 min, 2 sec | total paths : 22 |
| last uniq crash : 0 days, 0 hrs, 0 min, 24 sec | uniq crashes : 4 |
| last uniq hang : 0 days, 0 hrs, 0 min, 13 sec | uniq hangs : 5 |
|- cycle progress ----------------- map coverage ------------------------|
| now processing : 7 (31.82%) | map density : 0.44% / 0.67% |
| paths timed out : 0 (0.00%) | count coverage : 1.49 bits/tuple |
|- stage progress ----------------- findings in depth -------------------|
| now trying : havoc | favored paths : 13 (59.09%) |
| stage execs : 630/2048 (30.76%)| new edges on : 15 (68.18%) |
| total execs : 13.3k | total crashes : 134 (4 unique) |
| exec speed : 375.3/sec | total tmouts : 835 (5 unique) |
|- fuzzing strategy yields ------------------------ path geometry -------|
| bit flips : 7/256, 6/248, 3/232 | levels : 4 |
| byte flips : 0/32, 0/24, 0/8 | pending : 15 |
| arithmetics : 5/1790, 1/373, 0/35 | pend fav : 7 |
| known ints : 2/155, 0/570, 0/331 | own finds : 20 |
| dictionary : 0/0, 0/0, 0/0 | imported : n/a |
| havoc : 0/8448, 0/0 | stability : 100.00% |
| trim : 98.77%/13, 0.00% |------------------------
-------------------------------------------------- [cpu000:109%]

$ xxd -e -g4 out/crashes/id:000000,sig:00,src:000000,op:flip2,pos:1

00000000: 8389b000

----[ 3.4 - Final Comments

Using the proposed framework, we have demonstrated a naive fuzzing setup
and an advanced setup employing AFL based on TriforceAFL while elaborating
on QEMU internals.

The proposed solutions can be easily modified to support other setups with
full system emulation and in different ELs or security states as well. For
example, let's assume the desired target is an EL3 implementation and we
wish to fuzz early initialization functionality before interaction with
other components or ELs. We can achieve this by identifying the desired
location by address similarly to `rkp_policy_violation` and injecting the
`start_forkserver` and any other required functionality to that specific
location. This is similarly true for trusted OSs and applications.

Finally, one of the AFL limitations is the lack of state awareness. After
each testcase the framework/guest VM state is reset for the new testcase to
be executed. This of course prevents us from finding bugs which depend on
more than one `hvc` invocations. A possible solution could be to build
harnesses that support such functionality, even though this is not the
intended AFL usage and as such it is not guaranteed to have good results.
It remains to be verified and other fuzzing solutions could also be
examined for state aware fuzzing.

--[ 4 - Conclusions

The author hopes that this article has been useful to readers who dedicated
the time to read it, did not lose motivation despite its size and of course
maintained their sanity :) Even though though we attempted to make this
(very long) article as complete as possible, there is always room for
improvement of both the presented solutions and new features or supported
functionalities, as is true with every similar project. Readers are welcome
and encouraged to extend/improve the proposed solution or, using the newly
found knowledge, develop their own and publish their results.

--[ 5 - Thanks

First of all, I would like to thank the Phrack Staff for being very
accommodating with my various requests and for continuing to deliver such
awesome material! This work would have been very different without huku's
insightful comments, his very helpful review and him being available to
bounce ideas off of. Thanks to argp as well for his helpful review and
assistance with various procedural issues. Also, cheers to friends from
CENSUS and finally to the many other friends who helped me one way or
another through this very demanding journey.

Remember, support your local artists, beat your (not only) local fascists,
stand in solidarity with the oppressed. Take care.

--[ 6 - References

[01] https://www.samsungknox.com/en

[02] https://www.samsungknox.com/en/blog/real-time-kernel-protection-rkp

[03] https://googleprojectzero.blogspot.com/2017/02/

[04] https://opensource.samsung.com/

[05] http://infocenter.arm.com/help/

[06] https://hernan.de/blog/2018/10/30/

[07] https://github.com/google/AFL/

[08] https://github.com/nccgroup/TriforceAFL

[09] https://github.com/nccgroup/TriforceAFL/

--[ 7 - Source code

begin 664 rkp-emu-fuzz-galore.tar.gz
M`[email protected]!8M7#P[-W[VV]5M]X(C#-)[MW9Z$PLH:Y75U5753\T_L=%E<Z7U<GR
MYO#F$I>'<>H+WW8#8CH.N34=VR+`W[?#-J!M^\0,X,UH&5!6(UJ`[email protected])8
M!)HN`0-0"72H1V^I<T:[email protected]&\*0/)*1)E)?)6N49Z0Q*OS4JE6JZ&W^Q9Q
M1\0>3<9<S"H^4OZ8Q98W(M((<1P&U#SBQ/99D,>[email protected]%%<^2&(CQ\GF(\WL<2.
M^(/[email protected]$F[*%%][email protected]![7(;,<[email protected]?*GR`%,[email protected]%;9L[9TIVR
MVBR8.\^11SW-8T9]UW1K%CU&VDCS\;$B'[email protected]&X&$6SJN56S^G=OZ;OT
MDUS^/VTIW_/_-[[email protected]!WE^0,#D,/*&D&;<Y7P$20>26)1A(<=C_N'!H"J"02I'
M[R,>8)S>2GOX4AML(\[email protected]!AI+:8W3%[C&G8LJ`,8B+/E*Y?OM.-=K<[,'3M
M]NU%X/FEBU[7.._U.Z^,?MNX;.NO>#"[email protected]*L3IH4'\,BX0(J)OI')Q87Z4"9I
M5TCQ&&[A`=>./,[email protected]/I*MXH*"/23%[7EZG&;?/>^I]3!/''MT%PJU-\LN;
M,\(;6D=[9*UAEVHNC]0B1P1((:O]=5Y"#[email protected]_*.,!"^6]!
MJ`[email protected]>I;$#E0"Y#G,;UBFUCBCR0X8HA6'8KAT81IE19Q*^QPM_UH26)XXY
M\M*':BQ0>R&%,J?V_#FI<[email protected]+#[email protected]+\/K#TP14Q"*N5`#Y'8&12$
M*5PFD3;P[[*D7P\[`P-GD5O4&L$<2E(.=WB^`W(([email protected]]/W,^).A7I[B`TYI
M*R7^+;7VI%)IW3/C,%WDM/$\]\#B\UP^/!KUGYI'UVVI$",_$0Z'%[email protected]&#XS
M3XOEV-U3.'0UIHN`O*)W(\_T+0TBBN\O%T%ND$,P3T7$#?1%[email protected]$?!_/#
MP\/P"5,<$^5BOD2$,HHW3.U;ZJ[5?RE*X>/^"P][email protected]>D'+6PKB0&KI
M\)([email protected][B8^Y(K77=A=2QR.#UF,@KAFVM,)QQ,Y;E"ME0B*>3P<2QP)-%DN7Z
[email protected]"2=(WF45!8I<^QK3"R2F:+`_%LZ0G/;[email protected](\26E+)=9/<[email protected]"QEQ
ML"!!6:(4&H6NG".OJVJ;D(D;[email protected]/C*YMH%L;."<.P$>$>&MU_CH\
M9AZ1RG(3H>.-#KE&A+KHEGDA?LJQ"=%[email protected]$)(=3DYDJY/+1R4Z"9F5`.
M7/Y#6O?'=,SZHOXH9KT[^Z.RS1_O%W*;/[email protected]'D#M1B[8F;"E(J(]EH,
M+%HO2`[email protected]"Q3Q_(O:?"(,L"2JYV)2.3F+6FQW>&R(AU*\SS"C9>)CC&%ID
M<$A^F33`=D\#;/<T4+SC\G7SP!:?N']<;?6)A\5;]L!X6["&FHI!P1>)[email protected]
[email protected]][email protected]%?'/;XNE_(,QD4Y8"'OOS,H1A6J#W82>T;EAGO'X.B/VO+D5]Y
M]D74MZ[U1:[email protected]/2Z7.C8+RA/;@1ESV3'G(\LDH)[email protected])_/",[.UQ*C6V
M<[email protected]$?VI-14'QK&2(:Z9:0H?<.UQ/0(YV+\3)3"9;[email protected](!Y8DUA"!
M9H44K23B%:[L13_7EW#6EOKX2Y"[email protected]?R47FJ)3?Y/>[email protected]+C,9/D
MIK.DJN][_L;%JD*^V%,ZA:K3I_][email protected]\<WH`%PMML4Z_WTR=JB))W'6
MFD)/X[<?R?^4>:#_^6?PE0(JN",&P1:EW$CKOY^E30.$UL`V>K1P,[email protected]?,T8
MB*W+$'IE^I1#N`(7,\VYXK;EP\[email protected]?P[G#YJ9!0!F\?S(#IE8N6:?E3PY43
M>,B0+1B9\9!$F>,]%ZD4AU+IW^2LQ%_Q*CK_D>[email protected]$>F3ZMS&IA.=>*;<XK'
M<I([_U.OGX`;?#__\PTN"._>XLZWIS/(^&.)U&7E2;[email protected]'[email protected]<
MF'X=2<(#0H*0Y8V7\<EC1#L&[email protected]%QKD)4P;;=%BB<VXJI)ON!/:L42/\A`I$
M&B#"M#H\M\V[SKQ)\`[email protected]/7&Q!Q^A`6([email protected]_GH.JYP(L:XR``(TUR=Z/V+
MMYV;@7J)\D&O]9MS?:@-;X8J>='O=[EB=77P&A**_I3T^[email protected]?3EK
M(`%JT9\"->S1C:YQ%6E70W4PN+D>:OTKB;[email protected])QM0.YR7?:O>(=!&_W!
M%5I1**3S1M-5":RCZ0BB"=9OVL#WAG<<;0*2B<>4_U6X[[email protected][0?:VA\"$X
M_UM<^[8[=I:0"?<F/[email protected]"Q<_3:G-]DI)RT<^J9MD7]K168SJ#'`<R'29YMOY
M'%^42G0%<"ZY]6R+L/G8&$,I4<8%/,R_TM,[email protected]_L\&#[email protected]
M!9Q?!N0B.%QH0%ML:A=TMD%`4A?M:&]0Y"8[&AA]#'.2,[email protected]&RKT"!\5Q#P^
M)@!"$);Z0K?440R,1AF%%[email protected][#B#5]=&5[TPM"L-XKZ<_B^"!7:[email protected]
MVQC=F\MK`Q%[[email protected]'[,$-Z5GY*GTC^3U90B4^3;LF9(
M<(^/$C\_(KJ)'YMQY:'[@&)[email protected]!9*&ON#G'_AV#/^&#\HZ_$PP_A#.(N6W
M)C^>KBLK]CHYU-:_<&SLXUI;\8!`[email protected]#W2TMQTK\EMXX;TNN*O_)=X5
M/VQ8>(X]OB.WMA>=J8.TE<;,J+=SV=6Z97GUY%Q:TS`"[email protected]+#W:D\QCH
M%MR^UW_?X$HJMOF=`;4#RY9QX6>`V9>+*=^W%_5=;6Z.?8^,([email protected]$--S0Y^=5
M(2E2)0K)73``Q:E=V[7H2A"[email protected])U)(!B[5_#1(IOF7,0S_<S(/RVWV[#)!WR
MS_6+X7G/P'^[email protected]?&;H!H*YS"'[#?>9YF+]BSOO/`H/1Z/(*D3&_S4
M0ZD&T6.^IFY^)@5RSR)4-O\>1>[email protected]\[%-C<@9M0L&L/;/M_NKQO-5Y"$NNI;
M0W^I70PS\"&9Z+X%(S)4(4:"P+]UNL=DD3U"8<-^A3^Y>@O%[email protected]:C?O!-
M\4:F`[5$Z,?HXB)VL%(-TN?4)[email protected]'/NW>)[email protected]!V:PFKKHM5_H
MHCP/*X\CLJK+?#=2;&]&7[#+<M+>@'[email protected]%XEKYKXBF;?M?!HU"<3/[(T%E/#
M'<EDWC20;S/[email protected])[email protected]`E`[email protected]"YTOTHI2$2^-P%L8
MHBA?;!`'[email protected]_$(<+.*4R!DB8HT<L=U%3BRRP5DR9FGENY"VMA7;BM.7OY:]
MMK*[email protected](!1H8TU6>^W\;TVO%^:=7.EA>(XC8<)-1>I`S^1D9%H
M:[email protected]+4K4$NK2IS`HU:LN+GV7BV*8E`V!U.6&A*(Z'?J2MV=9%WZ,XLD9I2'O
M?LFE&)=26ELQ.B+$/,3#F$MCPW1KR5]8;(0WE\[email protected]*#=4`\I'2?*^GZ4Y('7
MY\S_;ND8RA*V\QSPGOG?*4S]<O._1O/[_O^WN<+YQ&[email protected])Y/<V+D:
M1A1QBX0HX!;Y&J(.V"B=R(?YYL0G=.X39;[email protected]/@9U*5OUAID##8$0$/H;ZQ8J
MZ%O>YZCC\XD99?Y&!M1)Z,?O07:ZB6_>,\[email protected]@?,I9KPV)G'[email protected]"[$2
M3F-Q,V(ZUCK;]SAAR]0280<01,FS&5!.&)7(.:WDS0SD#?0C"[email protected],[email protected]
M;I%B$S4F+E70F+AC06/[email protected]%0T)H>1D7-J6%8U)P:QD7-J3!0U)P*(P7-
M&ZP>-Z?"6%%S*@P6-:?":%%S*@R'S?$L/"PV%26N1<.\[email protected]?"<\!$[4G
M#@3IUUDO#`F>BO*2MY`:B:]CB!9W[GCF>ZZW9+LC:8-?CF_AS^X8%[email protected])\'
M",;/QA_?BCOBW=OWU5^W[]FN][email protected]@Q_2\<_K^6=T_3/ZOI/A<[UO
MU/_BO=\2%[email protected]:33U_CP__H?'A3P<(<!Z#87\-Q_M?=JX&.([J2/?\2!:2;%8_
MQ3D5<J65#61WKZZ*"[[email protected]/5VD`Y1XJ`A#F2(V'E'_[$O_RCP9;WOIZ9E4;2
M5B5^`[email protected]#NU#/U3#U3S]0S]4P]4\_4,_5,/5//U#/U3#UC'X]G\:$Z-WWB
M):KMCW;VSB/*;&[email protected]`+',D*!MV>%`N_FAP(#EX0"'Q2%`A]=&0I\
M=90+:CIVX60'[email protected];=^YYNMT#%AU'WJ"E:/JF]BD*:<*;NH'1&/OA<-%K2&HWN
M,[email protected][8/DB=0QA/CDH#Z,T:[email protected]`2]Z+]Z!74<7ROHAY*INUG,;&]^:=W6YD1%
M[11IH`>YFSF>K%W.<."[email protected]`LX?X/1GI8M>7RR-A_])Y-B.I&UKZ.M"":>(Z8K
M=X+F0OVC[[email protected]\[email protected][F/J-BHP^:N)$/.ZL&:<OB,!SY3$1C>\)R?
M_0GP7GLYO.'78_SKN#3'M$%/LM8U3=%W2([email protected]=<P9'\Z5:T^*>S9^BCZ=^]/
M^UN47[I(&&B-^8>[email protected]@CV'DY>;\GYVPQO4F.?`9QM,QWA#&.X7Q3DHRUGU"
MNAU="WI3)7SO^;&^!]WSW`8Q-S.^3;[email protected]>!;ZK1?D57C-F/$S4VG+5WB/H
M/PI[/"`FM">[email protected]<_"?X-8[^;<O-.-N'0IZ!-B,<,W78-\O?,M65FNX0W[
M9#[email protected]\R-PBSHKH#E^*;%H\?&`[email protected](6->C',8N,MSXLW)7#O;!+N_C\HZ
M=AOK>0&5QF08SX/;[email protected]=P7K:!78G&51"H&;>]1M/NG\5Z1"OF$H(3]M(7$
[email protected]`FX>`#V%<1`VN/`">"N,E\5<0Z\-)&[email protected],_KQ6G7:[email protected]]<%X%MHP<I2
M7H.L1]DG>4[0`>)CB2HJI3[([email protected]=$*2"S8+5)(&7XK)9>0MWEC>DG#P>>B7
M.VP1(!NOY7JR])Q4T1WK8YW'FQ?&>9G<,[0KX9L\OV([email protected]:[I9RO2U9
MZ2Y&WS;$HPX/:[email protected]#RBUK$L9=W'YZA'0=-!^(9]S7"EAR_.#8T>/+;OR'Q
MWJCH3),;M?9'F^R&3C!>>:JB'X'O>9#/E<'W5-BVC&[email protected]'?A=#(?[DJ%'WF]$
MC)^'?4G$'B3)I',=]M&QU^[email protected]),KF_R85^O9Z`B/(XCMJU++AV2+#CZB>U'"
M*:-="[email protected]&+8"\1P$,$C00>920-M()'/MH-X"&"1QYH\D%;0>9<\M&N`'T9
MOX"[email protected]'Z9=8*S?6D?"#^NE4*WDIK>4[M(8DM;I159V-LRFM\>XYZ<A?B\N6
M%W3A2Z):[email protected]/TTG0!Y(_QV(Q^.%UFK.]@(O0CC]5E)^@?<'3^C/[email protected]],3UR
MCX('L3;>5/(&]D/WB22W>TBJVH^[email protected]+ON8+O?/F_H>9GS$$5?CO))T"?'
MUIAEY]6P<P+P#[email protected]<K8SQA$Q!O*8XG[L)?-D>F4SB>VHO]A&PL-=PS^M
M1*19',\*#[email protected]\*O'?/#OZK([email protected]?IZ8*VZR?<885^AC6*-<,?LFMPDJD(<
M2D$,JUH".7Z>W^-4+Z7T?FEV01KH^"SHNZ5HB.?)?(\`[email protected];X=B126F>>LB;W
MWB+.'[email protected]"L(@RVO=;_L_W!2&<31Z!#'>!WP_Q3CQ[QA^_`;C!\QS_R3CC
M1_TS!OL!8%A_VS-`AV`^,=^WS?$EVQP[;?6-X^8;\Y,W;674,UI_TU:/[email protected]
MV<;G91N^,MM67V*[email protected]&TZYC;;\*J,>D<SSB3EO6[]CE$YY>;:M;N/G
MMN&[;[email protected]&*'I][email protected]::-PMVU.;ON<O#;^7AO\1AO\1AM\APV^PP;?:8/OM,%[
M;/`>^[[email protected][JE,#7FVSCUW'/;9ZM<F'UENQUBK5]:E&Z;-*LDJW51JTZQ8?
M*L?$?_.N-!C*-LZF3Y$[S;AKVL;GXD1:"[email protected]\^0[:8>9GSQ%:IK6COY4M#G>
[email protected]_R[MK<,RO[&);WR+JGQ4ED[V=:BPYGKUIZ9-U6MX6?PN<$[I--/5!EPTA?
M\II=)]Z,"3JY`OT.&S[G*;[email protected]=F:O7IGKZ&K&5]C7.7]ZWZQHJ^U077
M]-UV:57?]_YX;Q^?.T(5],[email protected]`<S%B,$^<:QN60_Q=#O#.%-9>'+,!M\U
M\2H;_G(VN+WI_&[email protected])L\-'9_X,->K*T8V<GL0%E3[#!'\Y^[email protected](;_/;L
M3[\[.3WZ)Z5?=]/D].B?E/Z&E9/3HS\>?2OZW'%[email protected][email protected]':GLT2D
MR='%][email protected]<2/.(ZP'"Q?)BFE'[email protected]_&V38\%_#T>WLSSK+%FZ$!>BPZ8\
MYGJ!Y;\MB']AT)];#[email protected]%7(A]B;1K)O2Q.Z:/(Z3]WM+'/=`'KZ%8CM<J
MXSQ-.0M]<R'3W;/2V7;>1*44_86(R:[email protected]\$OY7.Y.FELTTK]N;CKW<Q^M
MRES/S_V_L-=S7S%[13['7O7RJ+TJ,1?CVWSJ7\=FR"O2^?S)8R!?&V,[email protected]_P
M`?F;Q<Q"^$?!=L"NPGMI%[email protected]]2M.Q\YG8_>!GP#>16W&;\,>8AJ\EYV>
M!\\@[email protected])!V\!Y*=J&CS<*6A;:[EC[>J6[$^V(3+N[*LI+W?Q=1*8B
MW_V")J2Z%G._9'[email protected]_LYGOU3+P9P,LB?^\]>4U/^RH$K2M?T5M%H=T!O_)=
MINA\![#C$D77T&Y.I+3F/$KO$%=HG6+6`/\&B?/W;[email protected]+)*A.M4K9*
MT2KY>\3(MX59K/<7XOZ&[email protected];[email protected]@G]*#']#*+-^WM,'_F"]C%D[I&M
M=IG2?0#]*NM'*B\%ST*>KZ$;]/TO>5<?'E5UYL^],[email protected],2(8$R([email protected]:%*
M:Q"2XM-<$C]0?-HER6KEZ3:3!(4:=ZL-`[email protected]^[email protected]&;`#XC:QPU!
[email protected]:Q6E^Y328K=VMT:`BHK)!`@R=Q)R.S[GG-N[ID[7X%EN_;I'WEFYMY[
M<)ZT`\8U74-LCJ/GG5:[email protected]+WED1U.":K1;R.'V(=4.ZHY"U[#;%'?0MU
[email protected]=_IT3;F6\^Z.#D.D`[.#S$L*[email protected]/],%U)\Z_G%P.W/](?$[7%9[#
M<!Q-CX/5YQ+I"EBMX;K>)&`UVX35L0)63P8CL9H>`ZM;3#A*BX/5IQ+I"[email protected]
MRHO/KPT:ZL8QBW8#GDX,)[email protected]?^`=H-MCVK,QA&\`,9P'!$5LX"#TXGJ
M`,P>U82<Q3%;/[email protected]`&0_S.O`,<4U08:)$1Q`^WMHD&$\#`=P_9`8([B_1GQ.
MU]7)<'`RD:Z`V;<T(6<Y&0[N'[email protected];I^2]=5P,'W!R\F9[[email protected]&1G#5G
M]#DK(TK\[email protected]]S>[_/XW\A$!G_M#CQ_^$HXE^E"7F`Q[]C,#S^P:`1_S>T
[email protected];>N]J'ZE;6O&[email protected]@^54?ATYW<[email protected]+NTZNC^[email protected]^?&X5/?QH0\,I]
MWN';._PSV%R;SGG^.2^`G/;/!AE?!.\U8%M.IGQ[\-]DM9S;][email protected](A
M#[email protected]/,XMW>/R"MGYH,RFQS1F`YX5NE>7";YNPOF8E<MT3%&_Q67F4ISL:D?.
M'!^3\R<NQX9RDI7#.&]E^]F9=`R%Y9:'6!L0R_W[@.'K<P.AO4*[;[email protected]"LX6
MA\[email protected]&C;2)^]>>2<.PJ\^<`D\_SYZZB^Y"(2?FD_NSA888S^[email protected][$G!=GH-
M</8$OY;H#)*(K<[email protected],\(;ZRH=X`X"L'<05Q',/CV"K$L8W'D-7+8G$O
MKWNN$,-K**8FG!S#,67(R&EJ%F5P/-W%[email protected]%/$VB,K*8C%6BC.PFORB#8WL1
MEY%[email protected]!V]GUZ0*6&CF.1-T7"+ZL"\3'D=%VWX[)(?:5RFH>Y#7D__ZBG\TA
M]R\@VBJH\^,2A[H#YH+^[email protected]^8Z[.G(&6'YY=(#O]T(?4)5"*OAZ
M`:Z_`_+L4*Z\]J%`IK-VI.Q`/RM[[email protected];9XW#];[email protected][)]#]<%5DY=.5+V
M>O]_N?A(EY.?$XVG1-N1UT&Y"C_H%[@*)EY(CIZG'#:U$I[[email protected])?\`V2=NP
[email protected]+P(O9]M7DQ8AY%/#;[email protected]%*6]9F[+QK*7QS!N"_8O<P9&[email protected]
M\9BAEO:)>V0&1P+J:5D8A<<QM9?Q.'[email protected]`\8X8X#M:[H%[email protected]:VHQ-Q.1QMD;HX
ME^%9/QRKZ^7Q/%P)D0[)0Y8/=D)YAON9ZMGSK#[.*<[email protected]=PFS/,-E%Y4!]B
M7\?L<O%D?$F1<[email protected]>S[BL0ETOCQNR+F`M[4TC+`,N?'Q'W++7Z'.1/D'-Z
M9"]=SZ]4]N%Y6.1>^#<(7),VSJ>`^_DD][IO0-[&=Q([email protected]+\[F_%-;KO`
M]O0HWP3FZN_&X)[email protected]^FFGS,[=VSGOQ,XY%G;.L;!SCH6=<RSLO-^Q4_S8F\0Y
MG!SPTP&3/_,YET?WY^><RX/^I-P4DR]OY-P=LR^1GZ+[$,>RZ#L<R^[email protected]';`
MAFJP00$;%G(;O&"#*.=+,P]`8OO[:[email protected];`+]?=E&[J]PVW1]_"/#L6P0>`.
M.)+#=8SG9U''`R8.[email protected]+A'`28/Z4G\K][LEK"_?\[email protected]>C\[.?1/]S3L*O1/X$
MU/5&''NPW>SF>_^[email protected]';[email protected]\9.(L7%1\!#D-9NZ#Q#@-_<-1XI-F
MZ%G&;=5Y"T_$LF?V)<9'T/$')MX%C4\IVR,;[email protected]^OLGJ)[TL/M-YOZ/'YVJ,
M#^=AM(J<$:CK[^/[email protected]_%Y7H\/Z+#U'#M;Z)[email protected]/#.<3BT$&YI8)/+=,X+EE
M`L\M$VAN$<_\_R9L;9WNS982]3^#H2W/@PV(!>\YIJ<[email protected]<A<GVL;+SA
M<*R$>XDV)K-"E]E&U#M09BZ764/4U"&*I[V^M4Q.C/,C#='[email protected],*XAW*L[NB-
MG%=CV2#*:1R,GE=;+D2VVU8AK[[email protected]>?5T>K8^[email protected][+RZ-Y'_(:^>.L/\
M_Z0IKQ8F&7GUGJ'PO'IG''NPW98'C;SZ!N1MKRFO?GLP<5Z-:;[email protected];!Z'G5
M%RT^0EXM-^[email protected],FKH][email protected][K^Y)%!_(JQMY?*XVY=6/K$9>O7<H/*^&
[email protected]'S:FG0R*LWG>7OR3'EU>&@P8%3TDCCQ>76=\+';',@Q]J,,5OQ&<9Q,N>6
M$+$+^>8I$W_)C-U1];<@YU$S#TIB_*:?#[email protected]]^]$[$+YE;%B/>-_.2;`
[email protected][email protected]%8?2:./[email protected]]>09AE6W":N-FL$Q_#R5O;LS,5[#UZO\R2RWHOP3
MD\?&KJ^>8>]=H^/57+:[email protected]/Z8#W6C#VS<!S;J`UM3Y)K5KZ)PUJ2F73'LCX>C
M([email protected]+G2G`-CHDF4MY=]<C?G-;D1/[(>QXGXWF37<P:_"?1R4:[2
M[]SS2>%RVKD<7)<N[V<<K:[email protected]"[T?L;^H]\][email protected][H3V5`=XUKF>R/U[
MC'/_J`ZML]7F;I'[UQ:3^[[email protected],`LM(&7NJ-S_\Y=&.'^46R_T!V;^W=D.!RS
M,[email protected]]FXZOMN'>]&RQ5NV,),4D$>N*B^!7*[email protected]+?:Z2H`+Y7)><4^'>2HLX4
MR*>ODB(8=^[email protected];+%IT);YJ60QG'PW0\YON"4O(\0FRL5?A>>"N?;B'O3##?7
MJ&/AN1`\9PMX&[email protected]?`>7Q7''@%[email protected]'^OH7P7&9Z;"M><I\QGBW\9,Z<Q/UVC
MGH,R7?#G;Y/4#S'_C"5[<[email protected]'<1+\K8;G!N1K5>3PV5:L#?1#GKEC1O4>G5\C
MT%>PCTPA>^[email protected]*A0):S-D;==E<KE_DRR)DFU)UO#7_N+?[<5J'N
MQ_2Z-TCJ)[email protected];S^?BOL=YK+M`T2:L6!E8A6=TDPVNDB'3YO*?8MS(_P`YC5,A
MY_!]D.W)2J\T'*HH<A+5GD+&[email protected]%^F"-<267PK6E,TB&)UWI/7H^%B_R
M1"DZ"'7B.^*<F4IA:28I+(5KR%?!^][email protected]>QK\[email protected]:?)5`6Z\$ZD.OBQ;UBJ`OK
M728\[email protected]*LX+NSEX%,*\A<QJ_#&*\BCY`BS`MXOQKN=T%9*_^MA4+9<[email protected]
M:0(,[email protected](7*]!\8V_F'Z?N0RGH_*=-N=\(>^0FQ7$W(]ED<;9)#MA#^\YP6=
M\1/'1,2Q?2GO*\-D[9`Q!N`GJJ.E%[email protected]>R/HL!%TL1)K/3Y_$)X#NU34
M,327.T;U5^B[Y+&LE9=92-NRI6D'QXPE5<%[email protected]>^Y+4TD&S(>N1SY6
M*.B#,`ZL'2M%;?!Y'-_YS^."?D3;,#Z(_;OA&?Q_"[email protected]_5LPXV4S(H1)BJ_51
MSH92]!GHU`:X9F=`V+MSH4],Q[X<^:/8AK&[email protected]/^+L+Z=$,[email protected]#<+8
M2J%G/[email protected]`\.)YB_&%,E.):K,JE/[email protected]\UX+?OAT_,+0GDP^OV\M5-^=!3T\!QD
M^[email protected]<W^T$.*S7E:*2M8PGE*E6Z)<F<W)2E%C&O1)LK<,\0UCI[GP[-QU
M(CXA;SR8+"W9?R_XHV!K3IU,%N=9;+7_"'GL+2DP/R1//+D";//(.;[email protected]_(@
M.P.O8=ZM^S'[email protected]#WR9;Y_%\A/?1O\<@GV._S?R>W31/"LS3=>\$W0<V5#4/
[email protected]*Y"PLN`1/+.2:6?_4PH<<_Z%&:[TH'#)P</08F_P4Q\"S(\B\[email protected]
M8:Q'8KR`Q1CSVP#80Y_!_\N6,.;AG%,/6_=P0>X_#+FLWB.3DS#&[email protected]"']-^
M+8L42N?S"O%Z#?YO$2'7A=K(8>B'[email protected]>)P^<2"(5E3/)`Y8A3\<7$-LOB"4M
M9&[\GC3RVT.23[JAS[UI&/[email protected])#_/83;A&E41YB\@94CM!_GX8P^RFXV^I
MWG6;=G&;J#V/*+H]2[M`_N<6N<F:^E[.!F]2;[email protected][@M-6"+
M_KN2VW+C<.AZ_!]@H[6E%&[email protected]"V5%V&+!+$K]K*]>@GZ+/S>"F6+6]@9CFF`
MLT+X?SK8_W#R/B+E)CJOUL?/0-Y!%.U[5D6[TZ[L0T[7FO]A[[email protected]/??.
M$`($DDR^))&9$!0:*/(+))"0FX\V0HHI1$7,TYF`-`6LQB"[email protected]:[[email protected]
M(JQMVTZXSY63ZK>[email protected]=^[[)MA+QJC--OJ";%^\!HYN\"SF+#\%/.//[8;=63G
MP,\,G9^KD3D#/Y&<'[<^/[email protected]<G*8P?1?`3:^`'[U$-!GE"O1.0+_BC':ZK
M13#'$#PDO_<(Z)&<N3?2+X7^*[email protected]=L-^N-("BFWA>F/UV$N.]E<)KD7B+F4
M,H)SZ8=S9]E<)KGO$'-I?S.['[email protected](]SL#^XQY3`\F5]**?48^Z:[email protected]*6X
M>;!M]U6V#?UJ#[email protected]\CH9=',%TXEIF?A>#/7+')@[[#?666_H-YYG=DEP
MO-?0[[I_(&]91MX`'[email protected],M_L$;XL-O%7\`WF;8.`-]<[ABT'>[email protected][6;!
M2'<3Z*TFT%M-H+>:0&\[email protected]=[J,JN6)M!;7:"WFD!O[4LJ:MF7),&_&/YR2Q/H
MK?=#]-9E]CW3^5X["\9_`>BL^:"S7'I^2(EDX?YG)2''D[MNI#[email protected]%<U
MS:)[email protected][email protected]=^"WX!#PWL#U2(BE'/PT)=%P^[I$28-]VEX/IN(+F]'H;
M?DD;=%_#XK#H^YI_8VNS`?1$(^B))M`3^T!/O`AZXJ4ZT!<__GI][email protected]@
M(QJL:([email protected]"M32`[email protected]$'=$PR-X&[;7/,1WQWJ#O11,NE.ZQ7<BG,,Z]
M\?NW/^>\5+KGMN[^O2_(UM[Q$KZ#2'`[email protected][email protected]_%'&`\SD5\+WXGN*5;Y*D+
M>6?Z]>WG7:;]O+#V9W_#]J^_3/N3P]J?.&C[_#MW/)Q+A?HQW0-]F,[email protected]#
MSC&#G(N`[email protected])QO.V>I$KJ0ZGDL)<X+9!6Q3^3FKP*VB[B?B:'Q?HC!_Z#GT
M=][email protected]<(L1&MP+\JVZTKUG["COOFL.^@7JZV3OMS%]V<Y_#P6(LL_J^.?35
MVN,!^@NHXW9%4P/T`5^N:+4!^H`[email protected][U[@'XV=2Q1M(T!^H#?K&@/!.CG4$>A
MHFT(T`=\L:)5!>@#OE#[email protected]+Z2.^8IF#]`'?(ZB503H`SY3T58&Z"^BCDQ%
M*P_0!_P&12L+T,^ECLF*[email protected]#[email protected])T`<\1=&*`_3SJ"-1T90`_3S,OZSE
[email protected]#/D'[email protected]/T%U/,13XO0!_P"$6;U1W^_?PW0;DA^70:G'_S</_>3EU&E'R:
MB>+:,W4;[email protected][PUXW7MDMLS3UCO-8F4PG*?F*LI\KT`N"]QC*?3,\`?M)8
MLG_O:[email protected]?XP"<.0:\A/0-GH.A?MMA$0</Z/]&T+_E"O0K!/UGKT#_TSY.O_,+
M*-.,[9'1]$DHN\4X)\[email protected]=X2<@\C*9;`3\60G<T?03*"D+F/9)N!/SM$+J1
M`W4Q^X90"WOF*%)>!.ME]?Y9U%'BR%X->V?'DWSO3&[email protected]]62S1Q>A?!&
M#M^!\`,<+D=X`X?1IIA4<[email protected]!1A.X=QWT<J.(QV=F0EAPL1+N=P/L)E
M',Y%N)3#:']'[email protected]\'^%B#F/L1Z)P&&/MD5P.HYT4R>9P)L+S.#P5X5D<1CL5
M,H/#Z0A/XS#&VB-3.,SB&-HXC/Y?)(W#"[email protected]<[email protected]\A_'[.HGA,'YG)5$<
MX_S([email protected]:B,5N\-.Z3+"?S<9+C>;YM.89HN#^[email protected]'\NX]LQAS?:,,7
MAK:[email protected],2GZTG$2X'MPFD_7M$6A'$L3?!MT%:RN`V\V(UP5PURC`536`IX\A
MY4EL?K<O5T09VK\;\;?Q'8&[email protected]_.+\)KU"<"=5SB&E7'@0\61W8J[%LLQ%E"
[email protected])^*)[email protected]&*/@"\`[email protected];\(=?,$O`[email protected]*.A3%8(&`[E*.\N)8JK2WP_/$I
MO+P+<`>VIQ#[email protected]@?UN_KZABT'\STFQ(SNV`_G=FE[RO&LF>N2DN!
M^\\/H1W)KNS>[email protected]"W,=C?$RT*>'R$D4CN%[email protected])[<,[email protected]!+1SSL]MR#G?450#
MW'&N8K>OSO$*K)UZ>(SK0-NM'IA[OJ>*XOG__*QM]DV7TQO/[email protected]'+\W7XZ>
MVTC/-9Y^#/A'W,<\BX_'>/H7/\9_2J3W^\/[email protected]@RRY\+U]`[46S:!./$[^#.\
MVR8PFU'<0_S"S^PU=][email protected]#GZKLQV0,/[0+HR7BV/@D-AS,/,]0IS%TS#DI=?/
MX3B&VA2_,>!]%8[9W7Z6.SYSAI_'L:CW\[email protected],,_T\5\A#\.QQGY_MO0[>"T?4
MUZO%FI#[email protected]>N$1*3ZN8<?]7X%<KM1)MKF"*(]/)9HFR80[2$+T4YTPO6)
M1`N-2?'6P&=,X$N/FWK:)*//@)C3";3*+]8>CH,8`YQKG`/)[email protected]&S,%[email protected][\8
[email protected]/@,G1&UR>C/*"[email protected]?1!'<!M)'>'DLOG&)S#JJ0+L_XF#T#QP_FIZ#G
M/&/#;[email protected]%Y`&P]<]S>/)4ZTU_BCD'&K:FI%_%[email protected])-69R;[1&(
[email protected]('1??R/W_5[;QWV^&K%.1D'HOOY&[A=W_`ONL]7;&^33;EB_'X/.
MXX)]N\[email protected]]=EHF65Z8(U5[8"Q_`-=^$46<^7#<Z>O?6]3)]/D"/K_Q=`[email protected]
M`[^Y'/[email protected]*_?K,-U`6;C;(0K&0A4-'+R\+7<>Y+%BO(`OW"5FHZAUD/DD"
M?>T2G\^[email protected]+PGT'^]I.\5$FA:)^O3[G`;H<%B5>-]H(O;:_+Y?Z-`
M<V$^2+UMT`<_A;;[email protected]'E&7=4(=*T'_$W.?BY5'L/,I_/N0F_FC8`[email protected]
[email protected]]__L_/%\.*?TC0TS_RR&F?WJ(Z5\<8OIF>6CICQMB^I8AIC]QB.G;AIC^
MXE*9N97S<[email protected]?$S0<AO([email protected],;#`]OJ8&T5RQIKBTP*:>L_H:UUHJT"
M`EPFX!_#==\5\"\[email protected]>V$LOH/7KU,T85^YBRBA_#X'_!*3NCQ]@MJQ`^C4
M;5(T!_"Z9QWZ\<>['[email protected]@[email protected]?/W42W0[GT7;0)*L=3T$;+%]4/*^3
MR6WK8)Q#:6V#>AF"M[,@0S8!1Z00YW4$<T!*[UEK25\SBVG)Y:[email protected]
M/[email protected])S#(*HO'P.O='4^<:.-L9_%[email protected]([4V;^&S!/[email protected]!>KA2#
M$OU<'[email protected]?^]-<#W:-VX$>#O033<7:NA[\";P>+]>%BG*=-Y`)N.3%2TN3='6
M0ITN;@,*8V^E/"YYG#[email protected]^9\^8';/[GIC7358=S;4/2CJ5$00)X[9
MKT;[email protected];[email protected];@QC35)7UM685MHUR)O;9"NW$P;$<SCEE&^4QJ^/<
MS.%(@#_:[email protected]'__`(=C`'YC`X?C`7ZYBL/)`#^_AL-I`.^T<]@&<&T%AZ<`
MO&$EAZ<!7%'.X1D`EY9Q>!;`N:4<[email protected]?PC!(.9P.<5LSA7)*3'J7L+JAR9$L*
MR;$6DQR6^Y:0`[B.[JFR9?-8=1*[email protected]]-<1`4?HX_9(.$+_&L;",8I?
MJ_N>$O.K'07$U7&L?Z!?/HE\%9[%G^[X-.3<P%[email protected]?IV?A'G;&)+M/FTSN
MDR:S^RO3*/=;X\B!?P&9S"[email protected])Q/="\&/5(Y1\FQSU=R"FW$;5\(1X6X'8OA
M[BP^MV:8][email protected]<.,N]FF/=1,.\_NHIYGQ(5.N_M,==VWE^+N?IY/W<I=*S?
MZQE\WM_M"<[[L;!KWNH)G9_VGN"\^\/JMH;5/[email protected]/<_A]7]15A==T_HO+_4
M,W#>&T29!'!7$K^O_CTR\[email protected]:Q_F'];_"3U/46D/ZE9>QO0(Z!<=!WV#.95S
MZ`,@8QM$[L68[CIOF&_;^[email protected];W582ESVN][email protected]<:K7$^J*E\G%25>
MC(MM`YX(R`'4R<D'?O*[email protected])3^9ZT"]O72\9^_:GH(XVT?8S=3V%_O90?WM
[email protected])\B*,P;?-HP9\E<8PVU/D&H;M%6S6TVIF416.*$M9Z69JA_6G&7R`/.,
MOJ`NJ+L'ROZ7O:^!DZ*Z\KW=/<`(J,A\,`)*SQBCCL94=WTK2LV`[email protected]
M9`U=55T5_(A104.([email protected])&(2\RCT1C-N)[email protected],+[CZ-218A&DW<
M\[email protected]*_(X,RR)+,\M-K.E9_([QY__)O\W8\)-)7`_E-D.&"=WMVE;L1YMZ*\^3
M+7[F4?^@T/4JZ8'WS5`6!6RK6QK8OY10#P9:X%Z[2-][email protected]']<RC`GVF<%H^
M#4#]]-ZU1!O`=TN/Y?I,)YY[4QGFNIHP\K>",(LHS!%[email protected]&D+T!+K4X-R
M_)RH>"AO#[email protected](C[593.M'I8X*_4R?NP5X'>>\D/[L-0B'^E!_?"ORF6FYN$
M/Q\6<N/8(+Y,$%\SE[5/[email protected]%[=(&\R>/Z.U65VS^HRL>S?!#K]='!P4O5W
M=?\V;+L)SD+`\[KV05VZHAY75M5CX?2\75$/#T#:<[email protected]<'0W"!MI^%)LGZ'MZ
MD/*)][email protected]<@;Y.07>H9[1'-9AE-];X?VED-^]4$^@)_2`&-B#:>P8_,[6'<<6
M^6Q,?S(AOB,7?%*[email protected]*<UK8?CY2];Z1WD\*:2G.=\)W,7J'WZ0_L&]QSP,L
MT3MJP8<';@,[\H&!"WKP'[email protected]:+'L%[T983O2OPV\_#<[9M/AK'BH;NWU`]
ML$`<;3&^3TXDXY)G5HV+]8&?8\'/,[email protected]'2_C;,)_&F'@ZH--T,[8"SPFZ;QJE
MP+V4P78$?28^@?N;BWODGW!8[!DBZJ<Z'MR+^P>5\[email protected],IY"=3QG0CP]
M'N&?0;AV-BO_YU?%V;V"=M7IO`+A/@7AL,[email protected]<ZY<MJ:[+,HAY>V[N\O=$![]
MTT`G".+H`G_=X`_C^"[email protected]?JMS/O5:5?O';-V\NGPO.I9L3]-T!\7#@F>Q;/+
MAC2Q3[;W#L[[([email protected]=6JX[7Q7MMGAP<,-FBBO<@WFX<YEHGX!0MV1"CVFZ(U[&
M+%[email protected];&FL:B;+17S'9UEL+=1/SWX'V(?E$]37HKQ,"^=!]\?(7W:?RE(L\3W
M%6EQ.M\FYGLY/0O-^?B^#5OCJ^)E=DQA:[)![,[email protected]=V/%.]P_Z!8:4^F"
M<[email protected]?M9NT\+^^DTWYLI*.\"XB.T/R\=AH^*%7R$^OU)'<NVGD*\Q'@^FU;$
M"_E?=BZ[%.T^W,<[L",[email protected]=GX3V#;)@%;Q/TI[`Z#^P$\\Z&.6AB7C8`1[F
M\2;CO8&_0U0^K-/F1F8N/7?V-IQ3"7B[6N;[email protected];/@TI(MG`B,O:4#O9KYG
M30[/@G\4Y<[email protected]'=-*GS;K'7']^+"<\]GDCVY/0*/]\F/R3?>B\9%/M*X?W'
MXIA+>X(IF1C;U;*S"W2$%MY_XC/7*:!]+X1[U+F^/-HJ7_V;4%[email protected]_V5
MO3*:7;\7Z!+P`;:CNT:+]3%[email protected]:[email protected]:1!T1WR'\POM$[X[^?[#
MCBOS/2+Y>[email protected]#/.\XM61B..<1HS`'/\P`Z=.(XVS;00?&LO0T3[YDL]G=O
[email protected]\+/86G#^K+,#\[email protected],[email protected]$\%3W00+_Y\0/#IW307<ONO`SVSJ7?Y
MI(59Y540_O$/1'^PDMHD[D5XXYDSMY4JQMIP+'=.&[email protected]/8HYRO=EP`-<+U2
M8;35`_*6GT-?^,VB'[email protected]#8[%^O[?.*9`U#_J)/HF&>P\8H5:2`]Y2"-I)*O
MJO8O#[email protected]?_D#L7>9=GCPT;>`]S&/2Z']O%[9#H;I5['^[email protected]_4KP=QQX
M=7YQ_`[WPL/U:4%>_V5`Z"%[email protected]\?<5X>[email protected];ST<[email protected]:YEI\XLS[KG
M$/";RGEC&<CA^^'W(W#?=S26<5+G=I"QSPY26QS'[email protected]_B2$Y?EL`#WWT,?R
M\DH\UI\8S>8A?V2AG+=RMT3_`[email protected]$?>PO/T2J^?V!K8!]^[email protected]>
MW0;/#0U\3`GJ0Q/EXW/J3;T7'HCL5^RS<*[email protected]<%YCT*;;`O:?T:$P_R^
MU'TWN&-[+G]C[61\=U!?.WD?Q"7&KW`]Y/'`GVW`GTW`GY.`/[email protected][\.IYL
M'!CD=(\?$GK/\&<2!?MMUL[S!GWRO0>B/GDI],GK3F%E<[email protected]^_CAP2]6;Q"
M;VTDV5+2JG3CU?M)[email protected]:\[T6YGVL4[>VE0WS_4&X3_N(0W]^YLTVL&5&V
[email protected];+B/I!5T/Z4DT.^%FG%SQ%AY/UBWW(<`T;9$?01.,[email protected]%-DB#/
[email protected]^"X'/!]4NE_*"'H'VL<V<\WXZ+<,4CS5JC#+*YA'\=6'4/R;*D8
MSC+O"T=U[H/^\"0Z7Q#/,]PX1%;]A(\[email protected]',-K"6P3=:SI)''LS/O`YGP
M=\'][^G^=BI'U^#@O/[email protected]+>_Y'NOU;[email protected]][email protected]_,RG%V:[email protected]+>[
MNZ;Y5\W?:XZ+_F(N^(F!'.+IP_OLV,UK1%LR\UC>6W^5^-Z?][email protected]
MU*<>%&,[email protected]\8)^-JI&.4+QXE+(#_FQ42^8E`?N;%/KFG>$OO>HXSX])+S
M^[email protected]+U(T<?Y/*0RP1\/[email protected]+?TD<[(JTQ_>YGV[1Z:[email protected]^&27]>=?IOEZO3
M?[/\7T__24H_,33]?QPF_4QU^K\>DOXS(Z8__%@[email protected]_/3$??2/(BIMNL,K?
MF#[email protected][[email protected]?^.MX3_C"MS]%XV1JXOZE![)G>]9[80WT)S\LD+C-$7B;U
MC`]U$AQS+P1]=*8ZG9/[email protected]>VN?6,]0&<?\[email protected]*U7%,'":.E_:AO*F.
M_#ZB=CSI)X/BS)VI^\)S';8P"+L/[email protected];;9NL^H6\5Q=P[R*'IXON01!O7"Z;L
MO0!U]&2W)72/TG20-?:`2'M2[^[email protected]\ESK3+2?AUW%SKA/^Z-SFU*!OW0D>8,
M`W'T4CHXEGH7G9_QU<KT,N=4V>L/[Q%CLGRN!]ZW%\[)[email protected]&ZE<_+'
MO\S70D=NF7/SS2^+>0DNQ_ZUN^P`K7B^F[OPN^;>S)[email protected]]J9;_*K_!VIM(
M]&;&[email protected]"UTKE5:Z]R>P1/5+I]#,H+-EWS-7O%65&+(/U54+>YT1`/\(&_
M5_`</[email protected]'Z8#_\I0_$F5*7`9T>#?E[!C\K-?C>Q:4TA9L81^^$./`\OE6C
MK;X"_'A[`UZVXTS!\Z=P?&/M7+;[39#[email protected]>SW0_%B`\S,XC'Q1C_G#T!CT=N
M31`[email protected]$%Y0C.6%EVHM5WQ1^@;4,^L"RQKR8'\,S6'/#IDTLJ^KXJ7GQ\V._>
[email protected]\`\@)I/8[J`,^C:0SX\*-6&=LR\N<JU,GA][M#(3^N9*495?,>8R#M3W)^
MQ/FOUM[9>"9+7/`=/D\\C/[email protected]?`QD?0+Z6%%GC+>A94O<@<WPV[];Z#?H'\<2
M!3Z,5<FK>;MQ?:[email protected]#C(O>O3<ZJZP'WC<'M,M4Q]--\0BZ5K\[>W=TEM&6
M6A\EFD\@^EQ`Y?H2SF'$Q1J>Y0>X'[email protected]@B>2\7#]+<8WGO)^*<1Q/(O.
M:^[email protected]^EQ<R4^9ZK`?[!)A9^T7YS)%<X'+YF[Y?30W>"/E[ZS](Z]Y1)V<QDG6
M<[email protected]!LKEG^T6[0O'24A_7L]V0EL'O6'IDN3C1QIW$'+IO#Z0"=??,8;-PSCQ
MZ/Y4N%?H_D-P;]"]`O?3Z7XVW$^E^UEPGZ1["^X_1/=)N#^5[[email protected]+Z;C\#
M#:[email protected]>DVY`W0=5N#_B39P.WWH(X>A/[email protected]\>[email protected]&=MT?=G']7\7]
M;"]-S2=G9PR^O]-RL;\3RM-%@^+;4KS_Q*!8\X/WY\+]QX+Q=]`M9]$][email protected]
MHGL<YSZ7[L\"O?]LNL?U8D80=A#G56F,'^))[email protected]@?QF?<D^G'\-Q9
M?X&Z&9?;BK:A"W+`>I?FCDH->[email protected]#K+AK'?#M8I0GZ/X.'H01GZW>ET,
M_M;>.O[Y5V8DGN=]T>+&Y][email protected]]_G%H\/[PL5]\>Q7#EV:/[R#LLZ+GYS8OG]
[email protected]_7DA<O`'HP?FC][IM5UX69PX]^Y,^LK_$S+0VMGXS/VY1"V<3N\C]\<
[email protected]>"JPZ2;UQL']D_!<`/=//R5TE+OP'.EXTR^GW;%H3Y*OVYK4>^C=<)TE
M"3<!C[\0/_[9%XYI'?="FAV'\D30;G2^<#;)[email protected]+<ZZP,M%E_[ZNC\H\/67,2
MOQ+<'X?G,?#[Q>:([email protected]>:^Z=7\5C8T+]]6+([email protected]/E4\%ODY[QWZ
MMJAB+2R.<:%MA-\RB'50K;U;[email protected]?RMX'6T3X&;KLKZ#]49\`^%VE5K-H_
M$,6Q[VW\]AYL^]A*D6ZIL8H7=KX=RLV:=W]Z>RB?#-,[email protected](AJ)<AT5KO-P
[email protected]/:70OE.WDSMZUT=)L*]U>"6W(S'[O2#D`]XSC""X#8YS_)Y\[::,P`V_/Q
MEAF;#_:'03^[email protected]["%:O?\V[R=KHP5V_(,[email protected]+4FYEU6>RHXP8=A\#X$<^
M3D%QM$`<[email protected]^/\QPS33_'F\;T*4#?B]MXFEQ>FV!^Q/@]]M-?/Y%PW';`OA/
[email protected]]'XC/0MU;*D!:VE[.>0WYB?&RG$?>&"<>PQE;QSJ?>%FU7T'!<U;M/
M5/)<IOK=[!J>JYVC"LH_"?*D0?E/?$+(GVE/T#I[[email protected]')ZS[4:H
MP5KX.E][email protected]'Y'7'Q#6KKVQ5M.CD^=)_P]DA[`0F9Y.!WK;E9?=T)T"L:XL_-
M;X-^%[email protected],>/U#?(T1KK]EN]HS)^3;9SL&GM_>M;Q]11+TP^<.B_/I#QP6XP'-
M]!T1?E^$>?FG03%>A/MQX/C]+P[7[ALU$^C0`[email protected]_H96[LF
M\OO3(ZY'VH%Z[1E6#ZYQ2$;?ZT-=C^?K=)`.O]DIUGO"OV:[email protected]'^LR:[WU^
MVQ,+[(%DDO$^.4-KO5B"[email protected]@\G`?]/__1'FX">*XY\N7;4.=0%UTV;8ID.8_
M7#IGFW[)G&TLB.<DQOMU49]'YPLSZ3X#]Q][email protected][6F)EO[EXQCPQ905VZ[Z
MZD"&]*$2](5(?^RKMOV]%;[email protected]'?1'G"_N0;E"_<EQ3UDA?B;,4^D&=-\1<?
MRQR<U0-ARH69J*\$\[email protected]`R.B;:SBQ[!,5#DW6FL<3?NPX7O,8^X
MA\6,Q*3^IT<A/QW?R_T/[email protected]^9_4?R7X1UU^;;RMOSTVDC\1[U3NKZ4?>'<>
M^C\M)O:,&LG_!/+?/J(_D3[2K/`Q+&<SS8FU]%H[A1S?B/O0O#<X[[[email protected]
MB_/+,^^*O61JYD>K]*YGAM5Y<.Z2KXL>A]\%=>5+H#\Q:^.>[8!+`6>*^:[email protected]
MS1D_NS[0`9"?)^[email protected]#UH]7OFN#=W?'N?&!+5NX#L./M(?$FC\D'MB6&;8"P
MY^6?^X4-(O(Y(=\5Y`5H\1"\N_`/@[email protected]`Y'="5?IK^[$^Y^3!GINDLO-%
M*[email protected];VF>+CA<)VX'M-)4.^G5#5WU[3+V3-!;CF$G0GULCFW0+Z-8:]
M=SK)[X2!>\`T\[T#!,V."WED)OG%,836,86MR#,;XPF^[email protected]%A7V^0WQ:2
MSZT1Y9](Y1+[?1VHV',4V_;GGZYLVQ.KZFCG6R+-64$_>[email protected]'3X^$V_B^ZET
MK4H[I?K=S]_B\Y$KD];Y?7S?2&MTGY`+8L[P]L-B+I_KC>@'[email protected]\RXAAO7
MOC6]"=XC+6S0(:[email protected]:8MG?9.,0>&8^!NM,<0T+=9[#$TQRJ[EUCEI6\)N;4P
ML-V7"+WTJK?"^[email protected]/:6+_J>+_9><M_C:6-Y6JN(I5<=S^5M\K2BNDZZ16[A^
M%3$9SOW4KF^.+2+[1DJ4<2V'WB]T>]RG]9?PNS%N]17G/SP1[)=QR*[email protected]@RX
MJ"O&=B5/393Y\QQZ_E"B[)[email protected]'U+SV=E"[_IR!V?CS>P<JR1E3_W
M&OKYG^#G$/E95^DG$_GY!?AY;J=8%X%UB#2(%2:8WP3_:`<$WRA^[email protected]:JCK
ME99QA+0^]R:?O]O5A&=([.SB<\[email protected]`W:^_Z[XEB5S?LP4Y:\.]_$WCVP+;^=M
MF7_;ROT?_=;P\W<X1M<$<H.W`VMF&>S)#:@[<)[email protected]_8C\'"\#T;JM:BZ]
MD\K`OW.-!6MMFGIQWZG#[XBY?%'VZG!3WQ2VM<[email protected]!^XXWAY_GXVV8'96?
MP8XRD3^AS9KQ\<S$=2"QVP"7P^\.^*[email protected]'8N9\0;X-<)O5LR<B>L"YL7,
M/TJFHOZ^_Z;8_R2(+[[`-N8?2EQ?P/UA&]@G^7[.(--QSZ-N_,X0_%@[email protected]^
M>)"3\<>[email protected]%K;&FND=I%<:7+NU%'MLSPS:>RF7P/[email protected]'MN::'ALZQ??I'5/
MD$['!+`Y:6];[email protected]\<SR3)[email protected]=\2.13.#N1DJ9JVW_GS"./-M(Z6ST=W3,F+
M^?`I^;LA+B>.Z;7P[Y1<Z'\P+=2!E_&QSM9.M&[email protected]_06=N,X>'/_THIYR"/M
MY'NA77W]"9!GT!=^!A'ZPMXG4/Z`WG&B<./WT"?^"M]#[email protected];8B<K9X-WT#]^
M#[email protected]?]R(J+'R+Q'/8N7&P,^YK#P.W:#O.Q81^KXFQ`M%?-P/]*6WHQOTI1]!
M9H[/G_D"ZEM-XT`G7/]"[email protected]@S:3&W6W9MN._X/(Y?!W%LCS==Q/=2!?TC
M">[email protected]#WY7A?D!/'L;S1?Y">L7C\Q,I/9[W32?D>;J;3OSKTOU[:R!.Z6*:
MV_^:--GD_'O/BS2Q?;1,GU56X^S1?1#?AAV)YX)T6\'O"\.FVPKISA]X[[email protected]
M%2?GIX$_[.^2C:RO9GU4L.\(RI/<9+Z>*)`G7WT#Y-(2T?^AWLSW]1YF'[email protected]
M6=["J^=]Z;HD>-*4^5+*[email protected]"QAB;L>^;#^QZXX6;/[GN[_[93;_^J;W?
MNW][[email protected]_?VKQ"8?/?FO_8P<[?JY.G=CS\,`;FVZ+G?N11P?&?'IJCY+]]3W+
M%=:;;QJZK:JBVM.JFX)Z-,63DI+DK*LZXDF5?=65_=3)UXVM2,\T4DI:][email protected]
M0S[QTE`YIOS?IB>T`[email protected]$WY6BR9(]83)%_-RL;?EH:6DY%-Z&M
M_U;^*OB[*G^.E,[*7ACU?RD??X%A_U*V!'^F-<_0I+"[email protected]:4]60KF2SJ:S
M%?J+XVI:2E-"^9HUY7364"-YJTFR)#MAOYNV32TKR>%[$SH4'[email protected]#NRG];3

Related Posts