Differ: Tool for testing and validating transformed programs
blog.trailofbits.com
blog.trailofbits.com
(FD: My company.)
Out there question:
Do you guys have any plans on releasing a tool which could be used for diffing filesystems?
eg. Run the tool, run an arbitrary program which modifies the filesystem, run the tool again and it reports on what has changed?
Using existing diff tools for this right now is clunky. I'm surprised there's not a go-to tool used by security researchers (or perhaps there is and I don't know about it).
I don't think we have any immediate plans for this, but it's an interesting idea. I think you could use graphtage for this (since it performs an IR transformation to do diffs against arbitrary graph-shaped inputs), provided you're able to transform your FS changes/metadata into a graph-shaped object (even just a JSON array of events).
More specifically, assuming you have a journaling FS, I think you could do something like "record the journal for the period you're interested in, and then build a graph of (event, inode) items during that period." But there might be edge cases I'm not thinking of.
Example: CompCert (https://compcert.org/), a formally-verified compiler AKA formally-verified sequence of semantics-preserving transformations from C code to Assembly. It's a great accomplishment, but few people are actually compiling their code with CompCert. Because GCC and LLVM are much faster[1], and have been used so widely that >99.9% of code is going to be compiled correctly, especially code which isn't doing anything extremely weird.
But no matter how large a testsuite, how many tools like these exist, there may always be bugs. Formal verification provides guarantees that tests can't, and as we start relying on software more it will become more important.
[1] From CompCert, "Performance of the generated code is decent but not outstanding: on PowerPC, about 90% of the performance of GCC version 4 at optimization level 1"
In practice, this is probably fine, since you won't run into bugs where the compiler aborts very often (and if you do, you know that you did.)
William McKeeman started the current wave of this in 1998 at DEC; Regehr and coworkers at U. of Utah with Csmith, and so on. I used it in 2005 for Common Lisp and continue to use it today for testing SBCL.
I bet that fuzzing old, unmaintained programs leads to many, many crashes. (If the old code crashed on a certain input, should the transformed code crash too, to maintain "compatibility"?)