[LTP] [PATCH 2/2] readdir02: use invalid DIR stream descriptor
Fri Feb 1 07:59:06 CET 2019
On Mon, Jan 28, 2019 at 11:19 PM Cyril Hrubis <firstname.lastname@example.org> wrote:
> > In this patch, I simply modify the test to use an exist FILE *
> > stream to simulate the invalid directory stream descriptor. Then
> > it won't hit the use-after-free issue any more.
> Actually I think that the best we can do here is to delete the testcase
> * Casting FILE* to DIR* is IMHO invoking even worse undefined behavior
> than the original test that called readdir() on closed DIR*
Why say this? Does this CASTING will do something more bad? AFAICT that
changing an variable of one data type into another, and the worst
harmness is to loss of information in the variable so we'd better avoid
that. But in this test we only need a invalid DIR* for readdir() tesst, it
does *not* really care about the pointer content I guess?
> * We do cover the EBADF for getents() syscalls getents02 test
I'm sorry, I don't find this testcase in LTP, or did I miss anything?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ltp