Skip to content
/ mubsan Public
forked from xyve7/mubsan

Minimal implementation of UBSAN

License

Notifications You must be signed in to change notification settings

9xbt/mubsan

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mubsan

Minimal implementation of UBSAN, which can be utilized inside kernels.

Note

I understand some of the code is a bit repetitive and an eyesore, I'm currently thinking of ways to reduce the repetitive nature of the code, while also making sure it doesn't over complicated it

This isn't complete yet, however if you want to test it, fork the repository and run:

$ make

Usage

Statically link the mubsan.c file with your existing project.
Then, define a function with the following signature:

int mubsan_log(const char* format, ...) {
    // code
}

This function should accepting a formatted string and print it to the screen, however, how you implement it is up to you.

Running the test with the aforementioned instructions will yield this output, then exit:

mubsan @ test.c:21:8: array out of bounds, for type 'int [4]', by index type 'int' 4

Credit

So, finding documentation for this was pretty abysmal, so I had to utilize other implementations and using them as reference.
However, the only main reference I even used was GCC itself, however, I'll credit the others that I viewed anyways.

OSDev Wiki Page on UBSAN
GCC Mirror
Sortix
optee_os
tinyubsan
barebones
dgos

About

Minimal implementation of UBSAN

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 94.1%
  • Makefile 5.9%