[LTP] [PATCH v2] syscalls/execveat01: new test to verify execveat unlinked fd
Cyril Hrubis
chrubis@suse.cz
Wed Aug 1 14:53:03 CEST 2018
Hi!
> > +static void do_child(void)
> > +{
> > + char *argv[2] = {TEST_FILE_PATH, NULL};
> > + int fd;
> > +
> > + SAFE_CP(TEST_APP, TEST_FILE_PATH);
> > +
> > + fd = SAFE_OPEN(TEST_FILE_PATH, O_PATH);
> > + SAFE_UNLINK(TEST_FILE_PATH);
> > +
> > + TEST(execveat(fd, "", argv, environ, AT_EMPTY_PATH));
> >
>
> Shouldn't we handle EINVAL here? As the comment says from kernel-4.14,
> this case is expected to fail with EINVAL.
I already asked about this, apparently the syscall returns EINVAL when
the bug is hit, hence this would render the testcase useless.
So we decided to set minimal kernel version that has the call
implemented rather than handle EINVAL.
Well I guess that the best option would be trying execveat() before we
unlink the file and TCONF if we got EINVAL and proceed with the testing
otherwise...
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list