[LTP] [PATCH] syscalls/openat2: New tests

Cyril Hrubis chrubis@suse.cz
Mon Mar 2 11:16:28 CET 2020


Hi!
> > The code you had there in the first place was passing by accident
> > because the were non-zero bytes on the stack after the structure, which
> > is pretty bad, because if it started to fail randomly nobody would know
> > why.
> 
> I know :)
> 
> What about this? This doesn't test the success case with pad = 0 though, as it
> is a success case. Don't want to add a separate file for it. :)

This has still one small drawback, the whole purpose of the test buffers
is that there is a PROT_NONE page allocated right behind the end of the
buffer. This is implemented so that we can make sure that kernel does
not touch any data outside of it. So the buffer has to be sized exactly
as the tc->size otherwise there is no point in using it. So I guess we
still need two buffers.

Also I guess that we can add the success case to the openat201.c test
but that would mean that we need two buffers there as well.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list