Skip to content

Commit e599a5c

Browse files
author
Aslan Askarov
committed
Updating documentation on mailbox clearances and interval receive semantics
1 parent 1715fe1 commit e599a5c

File tree

1 file changed

+58
-7
lines changed

1 file changed

+58
-7
lines changed

body.tex

Lines changed: 58 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,10 @@ \subsubsection{Example: updateable service}
304304
main thread finished with value: ()@{}%{}
305305
\end{verbatim}
306306

307+
\subsection{Debugging concurrent programs}
308+
To help debugging concurrent programs, one can use a special primitive $\code{\_setProcessDebuggingName}$ that
309+
takes a string argument and uses that string when reporting errors in the process. By design, there is no mechanism
310+
for reading the process name other than causing an error; this prevents using process names to leak information.
307311

308312
\section{Information flow control}
309313
\label{sec:infoflow}
@@ -571,6 +575,8 @@ \subsubsection{Declassification of the blocking level}
571575

572576

573577
\subsection{Information flow control with I/O primitives}
578+
This section may be omitted upon first read as it has a number of information flow subtleties that
579+
can be omitted when first starting to use the system.
574580
\subsubsection{Generalized receive and mailbox clearances}
575581

576582
I/O operations such as send and receive introduce additional concerns w.r.t.
@@ -604,14 +610,15 @@ \subsubsection{Generalized receive and mailbox clearances}
604610
that constrains receives on an interval. The mailbox clearance is a proxy for an authority.
605611
It can be raised using a dedicated command \code{raisembox (lev)} that returns a lowering
606612
capability and lowered with command \code{lowermbox(c, authority)}.
607-
There are two main constraints related to the mailbox clearance.
613+
There are a few constraints related to the mailbox clearance.
608614

609615
\begin{enumerate}
610-
\item First, at the time of the receive on an interval $(\ell_1, \ell_2)$ under context $\mathit{pc}$
611-
with mailbox clearance at $\ell_{\mathit{clear}}$ it must be that $\ell_2 \sqcup \mathit{pc} \sqsubseteq \ell_1 \sqcup \ell_{\mathit{clear}}$.
612-
This constraint ensures that the mailbox clearance is sufficient for the interval receives. When mailbox clearance is $\bot$ -- as it is in the beginning of the program -- this means that only point intervals of the form $(\ell, \ell)$ s.t. $\mathit{pc} \sqsubseteq \ell$ are allowed.
616+
\item In order to receive on an interval $(\ell_1, \ell_2)$ under $\mathit{pc}$
617+
with mailbox clearance $\ell_{\mathit{clear}}$ it must hold that $\ell_2 \sqcup \mathit{pc} \sqsubseteq \ell_1 \sqcup \ell_{\mathit{clear}}$.
618+
This constraint ensures that the mailbox clearance is sufficient for the interval receives. When mailbox clearance is $\bot$ -- as it is in the beginning of the program -- only point intervals of the form $(\ell, \ell)$ where $\mathit{pc} \sqsubseteq \ell$ are allowed.
613619

614-
\item
620+
\item The $\mathit{pc}$-label of the program point where the mailbox clearance is raised affects the lower bound of the intervals. In particular, if the clearance is raised when the $\mathit{pc}$ counter is $\mathit{pc}_{\mathit{raise}}$, the mailbox structure cannot be influenced by receives that are not as restrictive as $\mathit{pc}_{\mathit{raise}}$; in other words: $ \mathit{pc}_\mathit{raise} \sqsubseteq \mathit{pc} \sqcap \ell_1$, where $\ell_1$ is the lower bound of the interval receive.
621+
\item If the process mailbox clearance is raised in a branch, it must be lowered back before reaching the join point of the branch.
615622
\end{enumerate}
616623

617624

@@ -752,6 +759,14 @@ \subsubsection{\code{declassify}}
752759

753760
\end{description}
754761

762+
\subsubsection{\code{lowermbox}}
763+
\begin{description}
764+
\item [Description] Lowers the clearance of the current process' mailbox.
765+
\item [Arguments] A tuple of the raise capability and authority
766+
\item [Returns] Unit.
767+
\item [Failure behavior] Fails if the type of the argument is invalid (dynamic type checking). Fails if the authority is insufficient for this lowering, or the provided capability does not match the stack scoping discipline.
768+
\end{description}
769+
755770

756771
\subsubsection{\code{mkuuid}}
757772
\begin{description}
@@ -832,6 +847,16 @@ \subsubsection{\code{send}}
832847
\end{description}
833848

834849

850+
\subsubsection{\code{\_setProcessDebuggingName}}
851+
\begin{description}
852+
\item [Description] Sets the process name that is used in debugging.
853+
\item [Argument] A string value.
854+
\item [Returns] Unit.
855+
\item [Failure behavior] Fails if the type of the argument is invalid (dynamic type checking).
856+
\end{description}
857+
858+
859+
835860
\subsubsection{\code{sleep}}
836861

837862
\begin{description}
@@ -863,6 +888,31 @@ \subsubsection{\code{raisedTo}}
863888
\item [Example usage] $\code{42\ raisedTo\ \{alice\}}$
864889
\end{description}
865890

891+
\subsubsection{\code{raiseTrust}}
892+
\begin{description}
893+
\item [Description] Dynamically raise the trust level of a node.
894+
\item [Arguments] A triple of a node identifier, root-level authority, and the intended trust level.
895+
\item [Returns] Unit.
896+
\item [Failure behavior]. Fails if the argument type is invalid. Fails if the authority argument is not top.
897+
Fails if the blocking level is not $\bot$.
898+
\item [Example usage] $\code{raiseTrust("@alicescomputer", authority, \{alice\})}$
899+
\end{description}
900+
Note that the top-level authority is required because this is a privileged operation with system-wide consequences.
901+
902+
903+
904+
905+
\subsubsection{\code{raisembox}}
906+
\begin{description}
907+
\item [Description] Raises the clearance of the current process' mailbox.
908+
\item [Arguments] A security level
909+
\item [Returns] A capability for lowering the mailbox level back to the previous value.
910+
\item [Failure behavior] Fails if the type of the argument is invalid (dynamic type checking).
911+
\end{description}
912+
913+
914+
915+
866916
\subsubsection{\code{readInput}}
867917
\begin{description}
868918
\item[Description] Reads a line from the console.
@@ -888,10 +938,11 @@ \subsubsection{\code{register}}
888938
$\mathit{authority}$ is the top authority value.
889939
\item [Returns] Unit.
890940
\item [Blocking behavior] Synchronous.
891-
\item [Failure behavior] Crashes if the provided authority is not top.
892-
\item [Example usage]\textcode{register ("auctionServer", self())}
941+
\item [Failure behavior] Crashes if the provided authority is not top, or if the blocking level is not $\bot$.
942+
\item [Example usage]\textcode{register ("auctionServer", self(), authority)}
893943
\end{description}
894944

945+
Note that this is a privileged operation with system-wide consequences.
895946

896947

897948
\subsubsection{\code{rcv}}

0 commit comments

Comments
 (0)