Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
syscall: Getdirentries on freebsd 11 is broken #31416
It converts old, smaller records into new, bigger records. It tries to account for the size increase by calling the syscall with a smaller buffer (1/4 the size). But it also has a lower bound on the minimum size, so the syscall buffer may in fact be no smaller than the original buffer. As a result, when copying from the syscall buffer to the output buffer, there may not be room for all the listed files. The code silently drops the files that don't fit.
The patch below will at least panic in that situation. The freebsd port needs to be fixed somehow. The new test
Split off from #31403