{"id":15119819,"url":"https://github.com/vusec/floatzone","last_synced_at":"2026-03-01T11:35:10.550Z","repository":{"id":174439713,"uuid":"646752082","full_name":"vusec/floatzone","owner":"vusec","description":null,"archived":false,"fork":false,"pushed_at":"2024-07-04T12:57:33.000Z","size":45,"stargazers_count":70,"open_issues_count":0,"forks_count":3,"subscribers_count":17,"default_branch":"main","last_synced_at":"2025-09-28T03:35:30.329Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vusec.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-29T09:03:09.000Z","updated_at":"2025-05-26T19:49:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"6ac79a6f-05e7-4f2e-876b-2323553d9638","html_url":"https://github.com/vusec/floatzone","commit_stats":null,"previous_names":["vusec/floatzone"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/vusec/floatzone","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vusec%2Ffloatzone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vusec%2Ffloatzone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vusec%2Ffloatzone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vusec%2Ffloatzone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vusec","download_url":"https://codeload.github.com/vusec/floatzone/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vusec%2Ffloatzone/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29968571,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T10:55:55.490Z","status":"ssl_error","status_checked_at":"2026-03-01T10:55:55.175Z","response_time":124,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-26T02:00:15.049Z","updated_at":"2026-03-01T11:35:10.542Z","avatar_url":"https://github.com/vusec.png","language":"C","funding_links":[],"categories":["C/C++"],"sub_categories":["Uninitialized Reads"],"readme":"# FloatZone\n\n\n**FloatZone**: a compiler-based sanitizer to detect spatial and temporal memory errors in C/C++ programs\nusing lightweight checks that leverage the Floating Point Unit (FPU).\n\n**Paper:** [https://www.vusec.net/projects/floatzone/](https://www.vusec.net/projects/floatzone/)\n\n## Dependencies\n\n(Tested on system running Ubuntu 22.04, glibc 2.35, and a stock v5.15 Linux kernel)\n\n```\nsudo apt install ninja-build cmake gcc-9 autoconf2.69 bison build-essential flex texinfo libtool zlib1g-dev\npip3 install psutil terminaltables\n```\n\n## How to install\n\n\n```\ngit clone https://github.com/vusec/floatzone.git --recurse-submodules\n```\n\nEdit `env.sh` and update `FLOATZONE_TOP` with the full path where you cloned this repository.\n\n(OPTIONAL) To run SPEC benchmarks, update also the variable `FLOATZONE_SPEC06` with the full path of your SPEC installation.\n\nThen, load the environment in your current shell:\n```\nsource env.sh\n```\n\n**IMPORTANT**: always ensure to load `env.sh` in your terminal before doing any of the following steps\n\nFinally, let's install everything. This will take a while since LLVM is quite a big project:\n\n```\n./install.sh\n```\n\n## How to test FloatZone is working\n\nCompile the example `buggy.c` and `uaf.c`\n\n```\ncd examples\nmake clean\nmake\nmake uaf\n```\n\nThis is the expected output:\n\n```\n./buggy_floatzone_run_base 15\nA\n```\n\n```\n./buggy_floatzone_run_base 16\n\n!!!! [FLOATZONE] Fault addr = 0x7fffffffdc10 !!!!\n0x7fffffffdbd0: e0 11 40 00 \n0x7fffffffdbd4: 00 00 00 00 \n0x7fffffffdbd8: 00 dc ff ff \n0x7fffffffdbdc: ff 7f 00 00 \n0x7fffffffdbe0: 40 d0 ff f7 \n0x7fffffffdbe4: ff 7f 00 00 \n0x7fffffffdbe8: 2e 12 40 00 \n0x7fffffffdbec: 00 00 00 00 \n0x7fffffffdbf0: 89 8b 8b 8b \n0x7fffffffdbf4: 8b 8b 8b 8b \n0x7fffffffdbf8: 8b 8b 8b 8b \n0x7fffffffdbfc: 8b 8b 8b 8b \n0x7fffffffdc00: 41 41 41 41 \n0x7fffffffdc04: 41 41 41 41 \n0x7fffffffdc08: 41 41 41 41 \n0x7fffffffdc0c: 41 41 41 41 \n0x7fffffffdc10: 89 8b 8b 8b  \u003c-----\n0x7fffffffdc14: 8b 8b 8b 8b \n0x7fffffffdc18: 8b 8b 8b 8b \n0x7fffffffdc1c: 8b 8b 8b 8b \n0x7fffffffdc20: 00 00 00 00 \n0x7fffffffdc24: 00 00 00 00 \n0x7fffffffdc28: 00 00 00 00 \n0x7fffffffdc2c: 00 00 00 00 \n0x7fffffffdc30: a0 3d 40 00 \n0x7fffffffdc34: 00 00 00 00 \n0x7fffffffdc38: 90 7d 74 f1 \n0x7fffffffdc3c: ff 7f 00 00 \n0x7fffffffdc40: 00 00 00 00 \n0x7fffffffdc44: 00 00 00 00 \n0x7fffffffdc48: e0 11 40 00 \n0x7fffffffdc4c: 00 00 00 00 \n\nFault RIP = 0x40123d\nBacktrace:\n - [0] ./buggy_floatzone_run_base() [0x40123d]\n - [1] /lib/x86_64-linux-gnu/libc.so.6(+0x29d90) [0x7ffff1747d90]\n - [2] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80) [0x7ffff1747e40]\n - [3] /home/sec23_ae/floatzone/runtime/libwrap.so(__libc_start_main+0x1fa) [0x7ffff19502fa]\n - [4] ./buggy_floatzone_run_base() [0x401095]\n```\n\n## Benchmarks\n\n### CPU SPEC\n\nTo run SPEC06 benchmarks simply run the following command:\n\n```\npython3 run.py run spec2006 default_O2 asan_O2 floatzone_O2 --build --parallel=proc --parallelmax=1\n```\n\nThis will run baseline, ASan and FloatZone all together.\n\nTo compute the respective time and memory overhead do: (substitute `run.2023-06-20.15-37-32/` with your result folder)\n\n```\npython3 run.py report spec2006 results/run.2023-06-20.15-37-32/ --aggregate geomean --field runtime:median maxrss:median\n```\n\nThis is an expected output:\n\n```\n+ spec2006 aggregated data ----------------------------------------------+\n|               asan_O2          default_O2         floatzone_O2         |\n|               runtime maxrss   runtime    maxrss  runtime      maxrss  |\n|benchmark      median  median   median     median  median       median  |\n+------------------------------------------------------------------------+\n|400.perlbench  427      5517864 107        1235732 154          2893056 |\n|401.bzip2      301      3581624 196        3448396 254          3550160 |\n|403.gcc        237     13467288  83.9      4259380 163          8043360 |\n|429.mcf        145      1935800 110        1718588 118          1718428 |\n|433.milc       156       982764 130         697832 144          1020312 |\n|444.namd       188        61280 121          49808 142            49892 |\n|445.gobmk      285      1368400 182         152456 217          1062460 |\n|447.dealII     214      1764156  99.8       816224 132          1664564 |\n|450.soplex     120      1271488  76.5       564236  93.5        1231012 |\n|453.povray     101       236780  44.5         7408  73.6         217624 |\n|456.hmmer      236       814480 104          34004 164           607576 |\n|458.sjeng      342       184764 196         180744 226           181428 |\n|462.libquantum 135       366912 118         100732 123           334072 |\n|464.h264ref    368       726084 156         117508 354           659368 |\n|470.lbm         96.0     476048  78.5       421032  79.9         421040 |\n|471.omnetpp    230       776404 121         175944 190           647448 |\n|473.astar      224      1489504 157         473900 184          1118144 |\n|482.sphinx3    282       413280 174          45752 229           446512 |\n|483.xalancbmk  159      1472808  61.9       430504 129           831000 |\n+------------------------------------------------------------------------+\n|geomean        205       939084 114         278538 155           782220 |\n+------------------------------------------------------------------------+\n```\n\nWe can see that the ASan time overhead is `205/114=79%` while FloatZone is `155/114=36%`\n\n### Juliet\n\n1. Edit `runtime/wrap.c` and set the `CATCH_SEGFAULT` macro to 1 to enable segmentation faults to also be caught (as ASan does).\n2. Enable **FloatzoneExt** by editing `env.sh` such that `FLOATZONE_MODE=\"floatzone double_sided just_size\"`.\n3. Make sure `env.sh` is loaded via `source env.sh`\n4. Check `echo $FLOATZONE_MODE` is equal to `floatzone double_sided just_size`.\n5. Run `./install.sh` to update the shared library.\n6. Run the following commands:\n\n```\npython3 run.py run juliet floatzone_O0 --build --cwe 121\npython3 run.py run juliet floatzone_O0 --build --cwe 122\npython3 run.py run juliet floatzone_O0 --build --cwe 124\npython3 run.py run juliet floatzone_O0 --build --cwe 126\npython3 run.py run juliet floatzone_O0 --build --cwe 127\npython3 run.py run juliet floatzone_O0 --build --cwe 415\npython3 run.py run juliet floatzone_O0 --build --cwe 416\n```\n\nNote 1: Some Juliet test cases are random (their test case contains the word 'rand') and you may need to re-run multiple times for it to be caught.\n\nNote 2: Juliet needs to compile with O0, so that's why we use `floatzone_O0`\n\n\n## Troubleshooting\n\n* Ensure `source env.sh` was executed in your terminal (with correct paths)\n* Ensure evyerhting is up-to-date via `./install.sh`\n* For FloatZone binaries, `run_base` must be present in the binary file name.\n* Edit `wrap.c` depending on your needs (e.g. `SURVIVE_EXCEPTIONS=1`)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvusec%2Ffloatzone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvusec%2Ffloatzone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvusec%2Ffloatzone/lists"}