[LTP] [PATCH v2] syscalls/execveat01: new test to verify execveat unlinked fd

Cyril Hrubis chrubis@suse.cz
Wed Aug 8 16:41:55 CEST 2018


Hi!
> static void do_child(void)
> {
>     ...
> 
>     /* Check if system support execveat() correctly */
>     TEST(execveat(fd, "", argv, environ, AT_EMPTY_PATH));
>     /* Do TCONF if we get EINVAL here */
> 
>     SAFE_UNLINK(TEST_FILE_PATH);
> 
>     /* Do your testing */
>     TEST(execveat(fd, "", argv, environ, AT_EMPTY_PATH));
>     /* Here if we get EINVAL again that means hit a bug! */
> }
> 
> Did I miss anything?

It's a bit more complicated than that, we have to fork() first and run
the check in the child otherwise we will never get to the test code, as
we will either do tst_brk(TBROK) or execute the child code instead...

I will write the code to check it and amend the test before applying to
the tree.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list