%!TEX root = main.tex

Power consumption is a major concern for both small embedded devices and huge clusters.
In the first case, the low battery life is a major hardware constraint, while in the second,
the amount of power needed by HPC environments can make its use unfeasible, or at least unprofitable.
To improve the energy efficiency of computing systems, it is important to be able to measure and
profile the power consumption. One common solution is to use external power measuring tools, such as Watt's Up Pro Power Meter, or PowerMon 2~\cite{bedard2009powermon}. Another solution is to
use internal power measurement interfaces such as Running Average Power Limit (RAPL), introduced by Intel on SandyBridge chips, or the AMD Application Power Management.

The RAPL components provide
a software interface for the user to obtain estimates on the processor's power consumption based on
models validated by Intel. Since its inception, researchers have studied how accurately
RAPL measurements correspond to real power consumption and how one can use this interface
to efficiently profile an application energy usage~\cite{weaver2012measuring,desrochers2016validation}.
Two security concerns that comes with the ability to measure power consumption in software are
side-channel attacks and covert channels. With respect to RAPL components, side-channel attacks were first studied
by Mantel et al.~\cite{mantel2018secure}, while covert channels were first considered by
Miedl and Thiele~\cite{miedl2018security}.

A covert channel enables two processes called the Trojan and the spy
to communicate in a system where they are meant to be isolated~\cite{lampson1973note}.
As such,  this type of channel is a central tool in data exfiltration, where an attacker wants to recover some
secret information from a target system without leaving any trace.
Figure~\ref{fig:covert-channel} illustrates the use of a covert channel.


\begin{figure}[!h]
  \centering
  \includegraphics[width=0.75\columnwidth]{graphs/intro/covert-channel.pdf}
  \caption{ In this setup, the Trojan and spy run on different isolated containers of the target system.
The Trojan obtains some secret information, but because of the system's security policy,
unauthorized applications in the container where the secret key reside cannot access the Internet.
The Trojan then uses a covert channel to transmit the secret key to the spy process,
which has access to the Internet and therefore can transmit the secret key to the attacker.}
  \label{fig:covert-channel}
\end{figure}


To successfully build a covert channel, the spy and the Trojan must have access to some
shared resource, but not the usual ones such as shared memory, files, or network,
because communication over these ones could be detected by security auditors or explicitly
prohibited by isolation mechanisms.
There are numerous examples of covert channels. Some recent constructions are based on
inaudible audio~\cite{deshotels2014inaudible}, branch predictors~\cite{evtyushkin2015covert},
core temperature~\cite{masti2015thermal}, and cache coherence protocols~\cite{yao2018coherence}.

The US Department of Defense standard Trusted Computer System Evaluation Criteria
(TCSEC)~\cite{united1985department}
defines a high bandwidth covert channel as one which can transmit at rates higher than 100 bps.
To protect systems against information leakage, it is important to lower, to 0 if possible,
the bandwidths of known covert channels. This can be done by introducing noise, lowering the
rate in which the channel can be modulated, or preventing the processes from accessing
the resources in which covert channels are based.

In this work, we investigate the possibility of building a covert channel using the DRAM power
consumption estimates given by the Intel RAPL interface. In Linux, these estimates can
be read using the \texttt{powercap} module without any special privileges.
Our main motivation is that, for devising mechanisms to protect the systems against these channels without
compromises to energy efficiency, it is necessary to understand the true risk posed by these RAPL
covert channels.

\paragraph{Contribution.}
We present the first covert channel based on the RAPL measurement registers for the
DRAM power consumption.
This covert channel can transmit at 2400 bps, with error rates
around 15\%. We tested the channel performance under two platforms: a notebook and a desktop computer.
The channel robustness against application interference was evaluated under three
different workloads: MRBench, Terasort and LINPACK.
The channel appears to be much more robust against interference than previous work. In particular,
under the notebook setup, the channel achieved high bandwidths between 300 and 600 bps with error rates close to 10\%, depending
on the workload considered.
On the desktop, the covert channel achieves 400 bps under MRBench or Terasort workload
with 10\% error rate, but it is not reliable when LINPACK is running.


\paragraph{}
This paper is organized as follows.
Section~\ref{sec:related_work} reviews relevant side and covert channels based
on power consumption.
The threat model and experimental setup are presented in Section~\ref{sec:rapl}.
In Section~\ref{sec:powerprofs}, we show how to modulate CPU and DRAM power usage and
discuss how the benchmarks affect the power consumption.
The algorithms for Trojan and spy are presented in Section~\ref{sec:covertchannel}.
The performance evaluation of the covert channel is done in Section~\ref{sec:eval}.
In Section~\ref{sec:highrates}, we consider two methods to achieve higher transmission rates.
Section~\ref{sec:discussion} consists of a discussion on our results.
We finish with the conclusion and discussion of possible future work in Section~\ref{sec:conclusion}.