summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README49
1 files changed, 41 insertions, 8 deletions
diff --git a/README b/README
index 0cbc797..936fa3c 100644
--- a/README
+++ b/README
@@ -1,10 +1,43 @@
1This is a standalone implementation of fortify source. The implementation 1What is it?
2is libc-agnostic and simply overlays the system headers by using 2===========
3#include_next magic.
4 3
5The implementation will trap only non-conformant programs. This in turn 4This is a standalone implementation of fortify source[0]. It is libc-agnostic
6implies that fortify source level 2 protection is handled in the same way 5and simply overlays the system headers by using GCC's #include_next. It was
7as level 1. 6initially designed to be used on musl[1] based Linux distributions.
8 7
9This implementation does not provide binary compatibility with existing 8
10fortify source implementations. 9Why?
10====
11
12- It is portable, works on *BSD and Linux systems.
13- It will only trap non-conformant programs. This means that fortify
14 level 2 is treated in the same way as level 1.
15- Avoids making function calls when UB has already been invoked. This
16 is handled by using GCC's __builtin_trap().
17- All of the check functions are inlined into the resulting binary.
18
19
20How to use?
21===========
22
23A plan for integrating fortify into a Linux distribution is still in
24planning stages. If you want to quickly test it, you can try something
25like the following:
26
27cat > fgets.c <<EOF
28#include <stdio.h>
29int
30main(void)
31{
32 char buf[BUFSIZ];
33 fgets(buf, sizeof(buf) + 1, stdin);
34 return 0;
35}
36EOF
37cc -I<path-to-fortify-include-dir> -D_FORTIFY_SOURCE=1 -O1 fgets.c
38./a.out
39
40At this point, the program will crash.
41
42[0] http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02055.html
43[1] http://www.musl-libc.org/