jm + turing-complete 5
BPF - the forgotten bytecode
may 2014 by jm
'In essence Tcpdump asks the kernel to execute a BPF program within the kernel context. This might sound risky, but actually isn't. Before executing the BPF bytecode kernel ensures that it's safe:
* All the jumps are only forward, which guarantees that there aren't any loops in the BPF program. Therefore it must terminate.
* All instructions, especially memory reads are valid and within range.
* The single BPF program has less than 4096 instructions.
All this guarantees that the BPF programs executed within kernel context will run fast and will never infinitely loop. That means the BPF programs are not Turing complete, but in practice they are expressive enough for the job and deal with packet filtering very well.'
Good example of a carefully-designed DSL allowing safe "programs" to be written and executed in a privileged context without security risk, or risk of running out of control.
coding
dsl
security
via:oisin
linux
tcpdump
bpf
bsd
kernel
turing-complete
configuration
languages
* All the jumps are only forward, which guarantees that there aren't any loops in the BPF program. Therefore it must terminate.
* All instructions, especially memory reads are valid and within range.
* The single BPF program has less than 4096 instructions.
All this guarantees that the BPF programs executed within kernel context will run fast and will never infinitely loop. That means the BPF programs are not Turing complete, but in practice they are expressive enough for the job and deal with packet filtering very well.'
Good example of a carefully-designed DSL allowing safe "programs" to be written and executed in a privileged context without security risk, or risk of running out of control.
may 2014 by jm
Accidentally Turing-Complete
march 2014 by jm
slightly ruined by the inclusion of some "deliberately Turing-complete" systems
turing
computation
software
via:jwz
turing-complete
accidents
automatons
march 2014 by jm
Thoughts on configuration file complexity
march 2013 by jm
some interesting thoughts on the old "Turing complete configuration language" question
configuration
turing-complete
programming
ops
testing
march 2013 by jm
Turing-incomplete Lua?
december 2009 by jm
discussion thread on the cons of using Turing-complete general-purpose programming languages in places where it's not necessary, such as configuration files
configuration
turing-complete
safety
coding
software
lua
from delicious
december 2009 by jm
related tags
accidents ⊕ animations ⊕ automatons ⊕ bpf ⊕ bsd ⊕ coding ⊕ computation ⊕ configuration ⊕ cs ⊕ dsl ⊕ funny ⊕ kernel ⊕ languages ⊕ linux ⊕ lua ⊕ ops ⊕ powerpoint ⊕ presentations ⊕ programming ⊕ safety ⊕ security ⊕ software ⊕ tcpdump ⊕ testing ⊕ turing ⊕ turing-complete ⊖ via:jwz ⊕ via:oisin ⊕ via:zeynep ⊕Copy this bookmark: