01. October 2019

On recent events

This has come down from old, Atula,
& not just from today:
they find fault with one
            who sits silent,
they find fault with one
            who speaks a great deal,
they find fault with one
            who measures his words.
There’s no one unfaulted in the world.

There never was,
            will be,
nor at present is found
anyone entirely faulted
or entirely praised.

– The Buddha (Dhammapada XVII : Anger)

05. February 2019

Terminfo and its DSL

Programs for Linux that run in the terminal often use color. There are a few approaches to making this work. Many programs use hardcoded ANSI compatible escape sequences, which are widespread enough today that they work almost everywhere. There are drawbacks to hardcoding these and for that reason there’s a database called terminfo, which has its own stack-based Domain Specific Language (DSL).

more

06. January 2019

Alignment Checking & Meltdown

Here is some interesting news for compiler writers worried about Meltdown. I have previously described a way to get hardware-based type checks (think branchless car, cdr, vector-ref, etc.) using alignment checks. It now appears that this technique may be immune to Meltdown-type attacks:

Alignment Faults.

Upon detecting an unaligned memory operand, the processor can (optionally) generate an alignment check exception (#AC). We found that the results of unaligned memory accesses never reach the transient execution. We suspect that this is because #AC is generated early-on (even before the operand’s virtual address is translated to a physical one). Thus, Meltdown-AC is not possible.

A Systematic Evaluation of Transient Execution Attacks and Defenses (2018, Canella, et al.)

The kernel unfortunately can’t use it because #AC does not work at CPL=0, but for user space it could be a great way to avoid some Meltdown vulnerabilities.