* [LTP] "pidns17" problem in "2010-02-11" cvs
@ 2010-02-12 7:50 Mitani
2010-02-12 17:51 ` Serge E. Hallyn
0 siblings, 1 reply; 6+ messages in thread
From: Mitani @ 2010-02-12 7:50 UTC (permalink / raw)
To: ltp-list
Hi,
I tried to test with "2010-02-11" cvs in RHEL5.4 system.
But the test brings termination of connection.
I examined the phenomenon and discovered that "pidns17" test made
accident and sshd stopped after the test.
I had some problems.
1. I think that "tst_exit()" must be added last of "cleanup()"
function.
============
--- ./testcases/kernel/containers/pidns/pidns17.c 2009-12-07
05:55:16.000000000 +0900
+++ ./testcases/kernel/containers/pidns/pidns17.c.new 2010-02-12
16:26:31.000000000 +0900
@@ -104,7 +104,6 @@
/* cleanup and exit */
CLEANUP();
- tst_exit();
}
/***********************************************************************
@@ -136,7 +135,6 @@
/* cleanup and exit */
CLEANUP();
- tst_exit();
} /* End main */
/*
@@ -147,4 +145,5 @@
{
/* Clean the test testcase as LTP wants*/
TEST_CLEANUP;
+ tst_exit();
}
============
After revision, connection termination didn't occur.
2. I cannot understand the purpose that "kill()" function whose
first parameter is "-1" is called.
------------
if (kill(-1, SIGUSR1) == -1) {
tst_resm(TBROK | TERRNO, "cinit: kill(-1, SIGUSR1) failed");
CLEANUP();
}
------------
If kill()'s first option is "-1", "man kill" says that
"All processes with pid larger than 1 will be signaled."
Therefore, not only the "sshd" but also the other processes were
affected, I think.
I'm glad if I could get some opinions.
Thank you--
-Tomonori Mitani
------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [LTP] "pidns17" problem in "2010-02-11" cvs
2010-02-12 7:50 [LTP] "pidns17" problem in "2010-02-11" cvs Mitani
@ 2010-02-12 17:51 ` Serge E. Hallyn
2010-02-12 19:17 ` Garrett Cooper
0 siblings, 1 reply; 6+ messages in thread
From: Serge E. Hallyn @ 2010-02-12 17:51 UTC (permalink / raw)
To: Mitani; +Cc: ltp-list
Quoting Mitani (mitani@ryobi.co.jp):
> Hi,
>
> I tried to test with "2010-02-11" cvs in RHEL5.4 system.
> But the test brings termination of connection.
>
> I examined the phenomenon and discovered that "pidns17" test made
> accident and sshd stopped after the test.
>
>
> I had some problems.
>
> 1. I think that "tst_exit()" must be added last of "cleanup()"
> function.
> ============
> --- ./testcases/kernel/containers/pidns/pidns17.c 2009-12-07
> 05:55:16.000000000 +0900
> +++ ./testcases/kernel/containers/pidns/pidns17.c.new 2010-02-12
> 16:26:31.000000000 +0900
> @@ -104,7 +104,6 @@
>
> /* cleanup and exit */
> CLEANUP();
> - tst_exit();
> }
>
> /***********************************************************************
> @@ -136,7 +135,6 @@
>
> /* cleanup and exit */
> CLEANUP();
> - tst_exit();
> } /* End main */
>
> /*
> @@ -147,4 +145,5 @@
> {
> /* Clean the test testcase as LTP wants*/
> TEST_CLEANUP;
> + tst_exit();
> }
Yeah I'm afraid I don't understand what CLEANUP and tst_exit exactly
do. Hopefully Garrett can give an educated answer.
> ============
>
> After revision, connection termination didn't occur.
>
>
> 2. I cannot understand the purpose that "kill()" function whose
> first parameter is "-1" is called.
> ------------
> if (kill(-1, SIGUSR1) == -1) {
> tst_resm(TBROK | TERRNO, "cinit: kill(-1, SIGUSR1) failed");
> CLEANUP();
> }
> ------------
>
> If kill()'s first option is "-1", "man kill" says that
> "All processes with pid larger than 1 will be signaled."
Right, the test is checking whether kill -1 inside a private pidns
kills all processes besides init in the pid namespace.
> Therefore, not only the "sshd" but also the other processes were
> affected, I think.
sshd is not in the private pid namespace and should not be killed.
If it is being killed by the pid -1 inside the container, then there
is a kernel bug.
> I'm glad if I could get some opinions.
>
>
> Thank you--
>
>
> -Tomonori Mitani
Thanks for testing.
-serge
------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [LTP] "pidns17" problem in "2010-02-11" cvs
2010-02-12 17:51 ` Serge E. Hallyn
@ 2010-02-12 19:17 ` Garrett Cooper
2010-02-12 19:23 ` Garrett Cooper
2010-02-12 19:41 ` Serge E. Hallyn
0 siblings, 2 replies; 6+ messages in thread
From: Garrett Cooper @ 2010-02-12 19:17 UTC (permalink / raw)
To: Serge E. Hallyn; +Cc: ltp-list, Mitani
On Fri, Feb 12, 2010 at 9:51 AM, Serge E. Hallyn <serue@us.ibm.com> wrote:
> Quoting Mitani (mitani@ryobi.co.jp):
>> Hi,
>>
>> I tried to test with "2010-02-11" cvs in RHEL5.4 system.
>> But the test brings termination of connection.
>>
>> I examined the phenomenon and discovered that "pidns17" test made
>> accident and sshd stopped after the test.
>>
>>
>> I had some problems.
>>
>> 1. I think that "tst_exit()" must be added last of "cleanup()"
>> function.
>> ============
>> --- ./testcases/kernel/containers/pidns/pidns17.c 2009-12-07
>> 05:55:16.000000000 +0900
>> +++ ./testcases/kernel/containers/pidns/pidns17.c.new 2010-02-12
>> 16:26:31.000000000 +0900
>> @@ -104,7 +104,6 @@
>>
>> /* cleanup and exit */
>> CLEANUP();
>> - tst_exit();
>> }
>>
>> /***********************************************************************
>> @@ -136,7 +135,6 @@
>>
>> /* cleanup and exit */
>> CLEANUP();
>> - tst_exit();
>> } /* End main */
>>
>> /*
>> @@ -147,4 +145,5 @@
>> {
>> /* Clean the test testcase as LTP wants*/
>> TEST_CLEANUP;
>> + tst_exit();
>> }
>
> Yeah I'm afraid I don't understand what CLEANUP and tst_exit exactly
> do. Hopefully Garrett can give an educated answer.
Mitani's correct -- this is what should be done... CLEANUP is a
constant that maps to cleanup in the event that tst_brkm is called,
because linux_syscall_numbers.h's copy of syscall calls tst_brkm
internally if ENOSYS is returned...
>> ============
>>
>> After revision, connection termination didn't occur.
>>
>>
>> 2. I cannot understand the purpose that "kill()" function whose
>> first parameter is "-1" is called.
>> ------------
>> if (kill(-1, SIGUSR1) == -1) {
>> tst_resm(TBROK | TERRNO, "cinit: kill(-1, SIGUSR1) failed");
>> CLEANUP();
>> }
>> ------------
>>
>> If kill()'s first option is "-1", "man kill" says that
>> "All processes with pid larger than 1 will be signaled."
>
> Right, the test is checking whether kill -1 inside a private pidns
> kills all processes besides init in the pid namespace.
Yeah, that's just not smart...
>> Therefore, not only the "sshd" but also the other processes were
>> affected, I think.
>
> sshd is not in the private pid namespace and should not be killed.
> If it is being killed by the pid -1 inside the container, then there
> is a kernel bug.
No, it isn't. If the test is being run as root it'll force a reboot on the box:
If pid is -1:
If the user has super-user privileges, the signal is sent to all
processes excluding system processes (with P_SYSTEM flag set),
process with ID 1 (usually init(8)), and the process sending the
signal. If the user is not the super user, the signal is sent to
all processes with the same uid as the user excluding the process
sending the signal. No error is returned if any process could be
signaled.
>> I'm glad if I could get some opinions.
I'll look at fixing this testcase once the cvs tree has been fully
converted to git by Rishikesh, as the points you've made are important
and valid...
Thanks :),
-Garrett
------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [LTP] "pidns17" problem in "2010-02-11" cvs
2010-02-12 19:17 ` Garrett Cooper
@ 2010-02-12 19:23 ` Garrett Cooper
2010-02-12 19:37 ` Serge E. Hallyn
2010-02-12 19:41 ` Serge E. Hallyn
1 sibling, 1 reply; 6+ messages in thread
From: Garrett Cooper @ 2010-02-12 19:23 UTC (permalink / raw)
To: Serge E. Hallyn; +Cc: ltp-list, Mitani
On Fri, Feb 12, 2010 at 11:17 AM, Garrett Cooper <yanegomi@gmail.com> wrote:
> On Fri, Feb 12, 2010 at 9:51 AM, Serge E. Hallyn <serue@us.ibm.com> wrote:
>> Quoting Mitani (mitani@ryobi.co.jp):
>>> Hi,
>>>
>>> I tried to test with "2010-02-11" cvs in RHEL5.4 system.
>>> But the test brings termination of connection.
>>>
>>> I examined the phenomenon and discovered that "pidns17" test made
>>> accident and sshd stopped after the test.
>>>
>>>
>>> I had some problems.
>>>
>>> 1. I think that "tst_exit()" must be added last of "cleanup()"
>>> function.
>>> ============
>>> --- ./testcases/kernel/containers/pidns/pidns17.c 2009-12-07
>>> 05:55:16.000000000 +0900
>>> +++ ./testcases/kernel/containers/pidns/pidns17.c.new 2010-02-12
>>> 16:26:31.000000000 +0900
>>> @@ -104,7 +104,6 @@
>>>
>>> /* cleanup and exit */
>>> CLEANUP();
>>> - tst_exit();
>>> }
>>>
>>> /***********************************************************************
>>> @@ -136,7 +135,6 @@
>>>
>>> /* cleanup and exit */
>>> CLEANUP();
>>> - tst_exit();
>>> } /* End main */
>>>
>>> /*
>>> @@ -147,4 +145,5 @@
>>> {
>>> /* Clean the test testcase as LTP wants*/
>>> TEST_CLEANUP;
>>> + tst_exit();
>>> }
>>
>> Yeah I'm afraid I don't understand what CLEANUP and tst_exit exactly
>> do. Hopefully Garrett can give an educated answer.
>
> Mitani's correct -- this is what should be done... CLEANUP is a
> constant that maps to cleanup in the event that tst_brkm is called,
> because linux_syscall_numbers.h's copy of syscall calls tst_brkm
> internally if ENOSYS is returned...
>
>>> ============
>>>
>>> After revision, connection termination didn't occur.
>>>
>>>
>>> 2. I cannot understand the purpose that "kill()" function whose
>>> first parameter is "-1" is called.
>>> ------------
>>> if (kill(-1, SIGUSR1) == -1) {
>>> tst_resm(TBROK | TERRNO, "cinit: kill(-1, SIGUSR1) failed");
>>> CLEANUP();
>>> }
>>> ------------
>>>
>>> If kill()'s first option is "-1", "man kill" says that
>>> "All processes with pid larger than 1 will be signaled."
>>
>> Right, the test is checking whether kill -1 inside a private pidns
>> kills all processes besides init in the pid namespace.
>
> Yeah, that's just not smart...
>
>>> Therefore, not only the "sshd" but also the other processes were
>>> affected, I think.
>>
>> sshd is not in the private pid namespace and should not be killed.
>> If it is being killed by the pid -1 inside the container, then there
>> is a kernel bug.
>
> No, it isn't. If the test is being run as root it'll force a reboot on the box:
>
> If pid is -1:
> If the user has super-user privileges, the signal is sent to all
> processes excluding system processes (with P_SYSTEM flag set),
> process with ID 1 (usually init(8)), and the process sending the
> signal. If the user is not the super user, the signal is sent to
> all processes with the same uid as the user excluding the process
> sending the signal. No error is returned if any process could be
> signaled.
Oh wait.. containers isolate PIDs and resources, correct (a weak form
of BSD jails or Solaris zones)? If so, then I'd watch the console //
/var/log/messages, etc and see whether or not things stay alive after
the signal is tossed...
>>> I'm glad if I could get some opinions.
>
> I'll look at fixing this testcase once the cvs tree has been fully
> converted to git by Rishikesh, as the points you've made are important
> and valid...
Thanks,
-Garrett
------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [LTP] "pidns17" problem in "2010-02-11" cvs
2010-02-12 19:23 ` Garrett Cooper
@ 2010-02-12 19:37 ` Serge E. Hallyn
0 siblings, 0 replies; 6+ messages in thread
From: Serge E. Hallyn @ 2010-02-12 19:37 UTC (permalink / raw)
To: Garrett Cooper; +Cc: ltp-list, Mitani
Quoting Garrett Cooper (yanegomi@gmail.com):
> On Fri, Feb 12, 2010 at 11:17 AM, Garrett Cooper <yanegomi@gmail.com> wrote:
> > On Fri, Feb 12, 2010 at 9:51 AM, Serge E. Hallyn <serue@us.ibm.com> wrote:
> >> Right, the test is checking whether kill -1 inside a private pidns
> >> kills all processes besides init in the pid namespace.
> >
> > Yeah, that's just not smart...
> >
> >>> Therefore, not only the "sshd" but also the other processes were
> >>> affected, I think.
> >>
> >> sshd is not in the private pid namespace and should not be killed.
> >> If it is being killed by the pid -1 inside the container, then there
> >> is a kernel bug.
> >
> > No, it isn't. If the test is being run as root it'll force a reboot on the box:
> >
> > If pid is -1:
> > If the user has super-user privileges, the signal is sent to all
> > processes excluding system processes (with P_SYSTEM flag set),
> > process with ID 1 (usually init(8)), and the process sending the
> > signal. If the user is not the super user, the signal is sent to
> > all processes with the same uid as the user excluding the process
> > sending the signal. No error is returned if any process could be
> > signaled.
>
> Oh wait.. containers isolate PIDs and resources, correct (a weak form
weak? :)
> of BSD jails or Solaris zones)? If so, then I'd watch the console //
> /var/log/messages, etc and see whether or not things stay alive after
> the signal is tossed...
Right. To approximate this testcase by hand I just tried on today's
fresh kernel git pull
ns_exec -cp /bin/bash
for i in `seq 1 100`; do sleep 30 & done
kill -USR1 -1
and only the sleeps were killed.
thanks,
-serge
------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [LTP] "pidns17" problem in "2010-02-11" cvs
2010-02-12 19:17 ` Garrett Cooper
2010-02-12 19:23 ` Garrett Cooper
@ 2010-02-12 19:41 ` Serge E. Hallyn
1 sibling, 0 replies; 6+ messages in thread
From: Serge E. Hallyn @ 2010-02-12 19:41 UTC (permalink / raw)
To: Garrett Cooper; +Cc: ltp-list, Mitani
Quoting Garrett Cooper (yanegomi@gmail.com):
> On Fri, Feb 12, 2010 at 9:51 AM, Serge E. Hallyn <serue@us.ibm.com> wrote:
> > Quoting Mitani (mitani@ryobi.co.jp):
> >> Hi,
> >>
> >> I tried to test with "2010-02-11" cvs in RHEL5.4 system.
> >> But the test brings termination of connection.
> >>
> >> I examined the phenomenon and discovered that "pidns17" test made
> >> accident and sshd stopped after the test.
> >>
> >>
> >> I had some problems.
> >>
> >> 1. I think that "tst_exit()" must be added last of "cleanup()"
> >> function.
> >> ============
> >> --- ./testcases/kernel/containers/pidns/pidns17.c 2009-12-07
> >> 05:55:16.000000000 +0900
> >> +++ ./testcases/kernel/containers/pidns/pidns17.c.new 2010-02-12
> >> 16:26:31.000000000 +0900
> >> @@ -104,7 +104,6 @@
> >>
> >> /* cleanup and exit */
> >> CLEANUP();
> >> - tst_exit();
> >> }
> >>
> >> /***********************************************************************
> >> @@ -136,7 +135,6 @@
> >>
> >> /* cleanup and exit */
> >> CLEANUP();
> >> - tst_exit();
> >> } /* End main */
> >>
> >> /*
> >> @@ -147,4 +145,5 @@
> >> {
> >> /* Clean the test testcase as LTP wants*/
> >> TEST_CLEANUP;
> >> + tst_exit();
> >> }
> >
> > Yeah I'm afraid I don't understand what CLEANUP and tst_exit exactly
> > do. Hopefully Garrett can give an educated answer.
>
> Mitani's correct -- this is what should be done... CLEANUP is a
> constant that maps to cleanup in the event that tst_brkm is called,
> because linux_syscall_numbers.h's copy of syscall calls tst_brkm
> internally if ENOSYS is returned...
Cool, thanks
-serge
------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-02-12 19:41 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-12 7:50 [LTP] "pidns17" problem in "2010-02-11" cvs Mitani
2010-02-12 17:51 ` Serge E. Hallyn
2010-02-12 19:17 ` Garrett Cooper
2010-02-12 19:23 ` Garrett Cooper
2010-02-12 19:37 ` Serge E. Hallyn
2010-02-12 19:41 ` Serge E. Hallyn
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.