klange / toaruos

A completely-from-scratch hobby operating system: bootloader, kernel, drivers, C library, and userspace including a composited graphical UI, dynamic linker, syntax-highlighting text editor, network stack, etc.
https://toaruos.org/
University of Illinois/NCSA Open Source License
6.03k stars 475 forks source link

Calling fswait can cause the kernel to crash. #272

Open mxlgv opened 1 year ago

mxlgv commented 1 year ago

Here is the code that causes the kernel to crash:


#include <sys/fswait.h>

int main(void)
{
    int fds[2];
    fswait(-1, fds);

    return 0;
}

Fix please.

klange commented 1 year ago

Sounds like this is a running theme - maybe we should collect as many instances of these unintended uses of signed values as we can in one place?

Should be fixed with 534aca26de2cddb6838e58b447be9adb5453d98e

mxlgv commented 1 year ago

Fine. The next time I find more such problems, I will issue a common issue for them. Or you can create an issue now and move the found similar issues there.