On Thu, 2008-05-15 at 15:58 +0400, Pavel Emelyanov wrote:
> Pavel Emelyanov wrote:
> > Subrata Modak wrote:
> >> Hi Pavel,
> >>
> >> We have PID, SYSVIPC and UTSNAMESPACE test cases written recently in LTP
> >> (Linux Test Project) and used by people for their namespace testing. Would
> >> you like to use them and review them for us, telling about itÅ› 
> >> effectiveness
> >> and other stuff:
> 
> Well, current tests look sane, but there's something that caught my 
> eyes immediately.
> 

Thanks Pavel for this immediate review.

Rishi,

Can you please look in to this when you have time for this ?

Regards--
Subrata

> 
> 1) The very important thing that has to be checked, but is missed is
> that parent from init_pid_ns can waitpid (not just wait) a child
> from a sub namespace by its pid returned from clone. It will be *not*
> 1, but some number above it.
> 
> I.e. test like this:
> 
> int child(void *x)
> {
>       return 0;
> }
> 
> int main(void)
> {
>       int pid;
> 
>       pid = clone(child, CLONE_NEWPID, stack, NULL);
> 
>       if (waitpid(pid) == -1 && errno == ESRCH)
>               /* FAIL - pid must exist */
>       else
>               /* Either we're OK, or some other bad
>                    thing (but not pid-ns-related) happened */
> }
> 
> 
> 2) The other thing to check (also very important) is that child from
> newly created namespace cannot see its parent from the init one by this
> parent's pid.
> 
> I.e. smth like this
> 
> int child(void *x)
> {
>       int ppid = (int)x;
> 
>       if (kill(ppid, 0) == -1 && errno == ESRCH)
>               /* PASS - parent is invisible */
>       else
>               /* FAIL - parent is visible (but maybe
>                    just not enough perms to kill one */
>       return 0;
> }
> 
> int main(void)
> {
>       int pid;
> 
>       pid = clone(child, CLONE_NEWPID, stack, (void *)getpid());
> 
>       wait();
> }
> 
> 
> I will try to produce more feedback in the future :)
> 
> >> http://ltp.cvs.sourceforge.net/ltp/ltp/testcases/kernel/containers/
> > 
> > I will try to take a look early.
> > 
> > Thanks,
> > Pavel
> > 
> 
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft 
> Defy all challenges. Microsoft(R) Visual Studio 2008. 
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Ltp-list mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ltp-list


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to