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 CheriBSD #55

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Commits on Aug 12, 2024

  1. Use uintptr_t when reading kevs[i].ident

    This avoids a warning when building for CheriBSD (Morello purecap).
    arichardson committed Aug 12, 2024
    Configuration menu
    Copy the full SHA
    58c9087 View commit details
    Browse the repository at this point in the history
  2. Fix epoll__event_size test on CHERI systems

    Some systems such as 64-bit CHERI-RISC-V or Arm Morello have 128-bit
    pointers, so for them the sizeof(event) assertion needs to be updated.
    arichardson committed Aug 12, 2024
    Configuration menu
    Copy the full SHA
    6dce79a View commit details
    Browse the repository at this point in the history
  3. Safely interpose fcntl() on architectures with bounded variadic argum…

    …ents
    
    `fcntl()` abuses C variadic arguments to implement optional parameters.
    We want to forward this argument to the real `fcntl()` call, but doing
    so is non-portable. On most architectures, we can just read an
    `intptr_t`/`void*` and this will give us a (semi-)valid result even if
    no argument/an int was passed instead since `va_arg()` will generally
    read the next argument register or arbitrary data from the stack.
    
    On CHERI-enabled architectures, variadic arguments are tightly
    bounded, which means that reading a `void*` if an `int` was passed will
    result in a runtime trap. To avoid this problem this commit uses a new
    `vfcntl` libc function (CTSRD-CHERI/cheribsd#2194),
    that takes a va_list instead of variadic arguments.
    
    Since this needs a new HAVE_VCNTL compile-time check, this adds a new
    config.h header that also includes the HAVE_TIMERFD value. This removes
    the need to pass -D flags on the command line.
    
    This reduces the number of test failures on CheriBSD Morello from 210
    to 8.
    arichardson committed Aug 12, 2024
    Configuration menu
    Copy the full SHA
    dbf8124 View commit details
    Browse the repository at this point in the history