News for hackers. Stuff that matters.
Re:KLEE LLVM Execution Engine by mslate on Monday April 16, 2018 @06:31PM (#16853453)
Anyone using this in practice?
Re:KLEE LLVM Execution Engine by TheNewAndy on Monday April 16, 2018 @07:24PM (#16853902)
I use it - I am writing a subset-of-yaml parser, and I've littered the code with a bunch of abort()/assert() statements for things I don't think should be possible. Running klee over my code spits out ~100K test cases (I let it use any 10 byte YAML input), and so while I don't inspect the output of any of the cases - I do make sure that none of them crash.

Similarly, if I make a change which I don't expect to change the output of the parser, then I can use this test suite to be quite sure that my change hasn't changed behaviour.

One thing I am unclear about is what it means for klee to be "done" on my binary. When it has generated all the test cases, if none of them crash my binary, then does that mean it is impossible to crash my binary in 10 bytes of input?

Re:KLEE LLVM Execution Engine by withzombies on Monday April 16, 2018 @09:09PM (#16854540)
Have you checked out DeepState (https://github.com/trailofbits/deepstate), it's a symbolic unit testing framework that has an interface similar to google test.
Re:KLEE LLVM Execution Engine by TheNewAndy on Monday April 16, 2018 @09:14PM (#16854574)
I haven't - thanks.

Writing test harnesses specific to the different tools (so far, just AFL and KLEE) has not been particularly difficult - all of them fit easily on one screen. So I'm not sure that deepstate really brings much to the table for what I'm doing.

Re:KLEE LLVM Execution Engine by xnum on Monday April 16, 2018 @07:57PM (#16854131)
if your program calls system call or random function which KLEE couldn't handle, some parts of code may not be tested. KLEE uses its special libc (uclibc) to deal with that cases in glibc. To solve this problem perfectly, we usually uses S2E instead of KLEE in large and complex softwares (http://s2e.systems/)
Re:KLEE LLVM Execution Engine by TheNewAndy on Monday April 16, 2018 @08:34PM (#16854352)
Right - but being a parser, I don't have those problems. My problem domain is quite well specified and there isn't any place for random numbers of system calls.
Re:KLEE LLVM Execution Engine by wyldfire on Monday April 16, 2018 @08:05PM (#16854184)
Can you share more details about this? Is the work already public?
Re:KLEE LLVM Execution Engine by TheNewAndy on Monday April 16, 2018 @08:35PM (#16854354)
The work won't be public. What details are you interested in?
Re:KLEE LLVM Execution Engine by nickpsecurity on Monday April 16, 2018 @10:11PM (#16854864)
You can find both interesting uses (esp extensions) and users on the page below:

http://klee.github.io/publications/

There's a large amount of work building on KLEE. Similarly, it builds on LLVM that has its own huge ecosystem. The potential of all that together is what interests me about it.

Re:KLEE LLVM Execution Engine by rurban on Tuesday April 17, 2018 @01:58AM (#16855877)
More people are using cbmc, the non-llvm variant, but otherwise very similar tool. I find cbmc much easier to use.