https://bugzilla.redhat.com/show_bug.cgi?id=2505515
Noah Arcouette kcu9626@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Flags|needinfo?(kcu9626@gmail.com | |) |
--- Comment #4 from Noah Arcouette kcu9626@gmail.com --- Hello, no this does not cause any security issues, but it certainly shouldn't be expected behaviour. I encountered this while using valgrind and originally thought something terrible had occurred because my program raised a system call fault within valgrind because -1 was being passed to fstat. I never used fstat in the program and barely allocated any data. But, the issue was being raised and data was left allocated. The data is fine, though annoying because I prefer my apps freeing everything and I can't free data I didn't allocate, but that's all normal behaviour as it wasn't leaked data just unfreed data.
What isn't normal behaviour is passing -1 to a system call. Why exactly are you doing it this way? Why are you checking if a value is -1 by passing it to the kernel and letting it yell at you?
In my opinion, passing -1 as an fd to the kernel should never be expect. It causes debuggers -- specifically valgrind -- to raise one of its deepest faults; no stack trace could be built, it was just a ghost error in my program that made no sense to be there.
If this truly is expected behaviour, and you really do want the kernel to check an integer for you, then you should at least create a valgrind suppression file so people don't freak out when their program's passing -1 to a system call.
Thank you for your time, Noah
sssd-maintainers@lists.fedoraproject.org