Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for sanitizing user provided pointers #1215

Merged
merged 7 commits into from
Sep 14, 2024
Merged

Commits on Sep 12, 2024

  1. Clean up resources in various tests

    These tests leak resources, sometimes in the good path, sometimes
    in the fail path. To satisfy LeakSanitizer, clean them up.
    
    Signed-off-by: Michael de Lang <[email protected]>
    Oipo committed Sep 12, 2024
    Configuration menu
    Copy the full SHA
    55f15a6 View commit details
    Browse the repository at this point in the history
  2. Skip tests that are not able to be run with sanitizers

    These tests use some form of dereferencing custom pointers or force usage
    after free, tripping up the address sanitizer.
    
    Signed-off-by: Michael de Lang <[email protected]>
    Oipo committed Sep 12, 2024
    Configuration menu
    Copy the full SHA
    c5283ca View commit details
    Browse the repository at this point in the history
  3. test/read-mshot-empty: set line-endings to unix

    Signed-off-by: Michael de Lang <[email protected]>
    Oipo committed Sep 12, 2024
    Configuration menu
    Copy the full SHA
    28bcc10 View commit details
    Browse the repository at this point in the history
  4. src/setup: don't munmap user provided buffer

    If the user provides a malloc()'d piece of memory, munmap will not be able
    to unmap it, leaking a resource.
    
    Signed-off-by: Michael de Lang <[email protected]>
    Oipo committed Sep 12, 2024
    Configuration menu
    Copy the full SHA
    f4934cc View commit details
    Browse the repository at this point in the history

Commits on Sep 14, 2024

  1. Add support for sanitizing user provided pointers

    This change introduces support for using the address sanitizer
    checking the opague, user-provided pointers as well as various
    pointers provided through functions.
    It does this by looping over the sqe's in userspace in
    `__io_uring_submit`, check their opcodes and use the sanitizer
    interface to check for memory poison values.
    
    Enabled through using the --enable-sanitizer flag when calling configure.
    
    Signed-off-by: Michael de Lang <[email protected]>
    Oipo committed Sep 14, 2024
    Configuration menu
    Copy the full SHA
    fa56f18 View commit details
    Browse the repository at this point in the history
  2. Add tests for testing sanitizer functionality

    This requires adding an "expected fail" mode to runtests.sh.
    The tests use obvious bugs, like use after free, to force asan to report
    an error and kill the test, exiting with error code 1.
    
    Signed-off-by: Michael de Lang <[email protected]>
    Oipo committed Sep 14, 2024
    Configuration menu
    Copy the full SHA
    39f1179 View commit details
    Browse the repository at this point in the history
  3. CHANGELOG: add sanitizer adition

    Signed-off-by: Michael de Lang <[email protected]>
    Oipo committed Sep 14, 2024
    Configuration menu
    Copy the full SHA
    07b9fb4 View commit details
    Browse the repository at this point in the history