[LTP] [PATCH 2/2] security/dirtyc0w: synchronize parent and child

Jan Stancek jstancek@redhat.com
Fri Oct 6 13:57:11 CEST 2017



----- Original Message -----
> Hi!
> > > > +static const char *const resource_files[] = {
> > > > +	TEST_APP,
> > > > +	NULL,
> > > > +};
> > > 
> > > I do not get why we need the test binary to be listed as resource file,
> > > the rest seems OK to me.
> > 
> > Since the test is using tmpdir, we either need exec*p* variant and
> > set PATH or copy binary to tmpdir. I took inspiration from creat07.
> 
> We actually copy the binary for creat07 since are are trying to
> overwrite it, which is supposed to fail, but I do not want to overwrite
> the installed files in a case that the kernel is buggy.

I see, I'll send v2 which drops resource_files.

> 
> > Copy approach is slightly more convenient when running test from git tree:
> > # ./dirtyc0w
> > 
> > But I can replace it with execvpe() - user would just need to setup PATH
> > before running it from git tree:
> > # env PATH=`pwd`:$PATH ./dirtyc0w
> 
> You are supposed to do that, but maybe we can add the code to change
> PATH to the test library itself, so it will include $PWD automatically,
> which would fix this problem for quite a lot of test without a need to
> modify these. 

We'd also have to make sure all tests use exec*p* variant, right?

Regards,
Jan


More information about the ltp mailing list