Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Sanitizing static freestanding nolibc programs? (stackoverflow.com)
2 points by matheusmoreira on Jan 4, 2024 | hide | past | favorite | 2 comments


For undefined-sanitizer, you can implement your own at least. I did it here: https://github.com/fwsGonzo/barebones

Undefined-sanitizer also has a minimal-run-time mode designed to be able to run in production: https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html#...

As for ASan and MSan I think that will be quite a bit of work. I have worked in embedded a lot, and my advice here is to split off your project into static libraries, and make it so that you can run parts of it as a regular Linux program. I don't know if that's possible for you.

For example, when I was fuzzing a network stack, I would just use TAP devices to fuzz almost all of it, except the actual devices. So I partially compiled the operating system as a regular Linux program.


I just bountied this stackoverflow question yesterday. I know for a fact there are people on HN who might be able to provide a detailed answer so I'm submitting it here.

https://news.ycombinator.com/item?id=35760049




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: