  Plenty of in-process vulnerabilities are blamed on various out of bound
memory accesses. Previous prevention methods are mainly based on software
checking associated with performance overhead, while traditional hardware
protection mechanisms only work for inter-process memory accesses. In this
paper we propose a novel hardware based in-process isolation system called PULP
(Protection by User Level Partition). PULP modifies processor core by
associating program counter and virtual memory address to achieve in-process
data isolation. PULP partitions the program into two distinct parts, one is
reliable, called primary functions, and the other is unreliable, called
secondary functions, the accessible memory range of which can be configured via
APIs. PULP automatically checks the memory bound when executing load/store
operations in secondary functions. A RISC-V based FPGA prototype is
implementated and functional test shows that PULP can effectively prevent
in-process bug, including the Heartbleed and other buffer overflow
vulnerabilities, etc. The total runtime overhead of PULP is negligible, as
there is no extra runtime overhead besides configuring the API. We run SPEC2006
to evaluate the average performance, considering the LIBC functions as
secondary functions. Experimental timing results show that, running bzip2, mcf,
and libquantum, PULP bears low runtime overhead (less than 0.1%). Analysis also
shows that PULP can be used effectively to prevent the newest "Spectre" bug
which threats nearly all out-of-order processors.
