All Projects → offlinemark → suicide

offlinemark / suicide

Licence: MIT license
LLVM pass that detects one undefined behavior, and emits code to delete your hard drive

Programming Languages

C++
36643 projects - #6 most used programming language
c
50402 projects - #5 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to suicide

Llvm Tutor
A collection of out-of-tree LLVM passes for teaching and learning
Stars: ✭ 941 (+2751.52%)
Mutual labels:  llvm, compilers
open-ops
Open Optimizing Parallelizing System
Stars: ✭ 21 (-36.36%)
Mutual labels:  llvm, compilers
pymlir
Python interface for MLIR - the Multi-Level Intermediate Representation
Stars: ✭ 84 (+154.55%)
Mutual labels:  llvm, compilers
Optviewer Demo
Demonstration of LLVM's opt-viewer tool
Stars: ✭ 63 (+90.91%)
Mutual labels:  llvm, compilers
Llvm Heat Printer
LLVM Profiling Visualization
Stars: ✭ 68 (+106.06%)
Mutual labels:  llvm, compilers
Gllvm
Whole Program LLVM: wllvm ported to go
Stars: ✭ 126 (+281.82%)
Mutual labels:  llvm, compilers
Meta Clang
Clang C/C++ cross compiler and runtime for OpenEmbedded/Yocto Project
Stars: ✭ 76 (+130.3%)
Mutual labels:  llvm, compilers
Jlang
JLang: Ahead-of-time compilation of Java programs to LLVM
Stars: ✭ 186 (+463.64%)
Mutual labels:  llvm, compilers
Llvm Ir Tutorial
LLVM IR入门指南
Stars: ✭ 232 (+603.03%)
Mutual labels:  llvm
sbt-instrumentation
Configurable instrumentation of LLVM bitcode
Stars: ✭ 31 (-6.06%)
Mutual labels:  llvm
Kazan
Mirror; Work-in-progress software-rendering Vulkan implementation
Stars: ✭ 226 (+584.85%)
Mutual labels:  llvm
Rellic
Rellic produces goto-free C output from LLVM bitcode
Stars: ✭ 234 (+609.09%)
Mutual labels:  llvm
vicis
Manipulate LLVM-IR in Pure Rust
Stars: ✭ 194 (+487.88%)
Mutual labels:  llvm
Ts Llvm
TypeScript to LLVM compiler (abandoned)
Stars: ✭ 230 (+596.97%)
Mutual labels:  llvm
SCAF
A Speculation-Aware Collaborative Dependence Analysis Framework
Stars: ✭ 25 (-24.24%)
Mutual labels:  llvm
Spirv Llvm Translator
A tool and a library for bi-directional translation between SPIR-V and LLVM IR
Stars: ✭ 223 (+575.76%)
Mutual labels:  llvm
Omniscidb
OmniSciDB (formerly MapD Core)
Stars: ✭ 2,601 (+7781.82%)
Mutual labels:  llvm
expressi
Expression-oriented toy programming language written in Rust
Stars: ✭ 17 (-48.48%)
Mutual labels:  llvm
EffectiveSan
Runtime type and bounds-error checking for C/C++
Stars: ✭ 95 (+187.88%)
Mutual labels:  llvm
Dr checker
DR.CHECKER : A Soundy Vulnerability Detection Tool for Linux Kernel Drivers
Stars: ✭ 251 (+660.61%)
Mutual labels:  llvm

suicide cc

A common illustrative example of something undefined behavior in C can do is "format your hard drive". Suicide CC is a LLVM pass which implements this. When compiling with this pass enabled, each function is checked for 1 type of undefined behavior. If it is found, the pass emits code which executes an arbitrary shell command using system().

The scope of detected undefined behavior is simply local uses of uninitialized stack variables of primitive type. It should support most POSIX like operating systems.

This project is named for its similarity to Suicide Linux.

Note: For the safety of my dev machine, the pass in this source tree is declawed such that it will only emit code to delete a very specific file from the system executing the program. However, to achieve the fully advertised functionality, simply reassign Suicide::SYSTEM_CMD in Suicide.cc to your choice of hard drive erasing shell command.

demo

(slightly out of date)

asciicast

building

Install LLVM 3.8.

To build the test program and pass.

make

To run the pass on the test program.

make check

misc

  • "SURE" means there is a code path between allocation of a stack variable, and a read of it, before any writes to it
  • "UNSURE" means that in between the code path between allocation of a stack variable, and a read of it, a pointer to that variable is passed into at least one function
  • in some cases, "SURE" warnings might be misclassified as "UNSURE". this occurs when the analysis encounters an "UNSURE" path before a "SURE" path involving the same variable and memory read
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].