* [PATCH] setpgid(child) fails if the child was forked by sub-thread [not found] ` <20070822082517.321edfa5.akpm@linux-foundation.org> @ 2007-08-22 16:55 ` Oleg Nesterov 2007-08-22 17:08 ` Randy Dunlap 0 siblings, 1 reply; 5+ messages in thread From: Oleg Nesterov @ 2007-08-22 16:55 UTC (permalink / raw) To: Andrew Morton; +Cc: Marcin Kowalczyk, linux-kernel Spotted by Marcin Kowalczyk <qrczak@knm.org.pl>. sys_setpgid(child) fails if the child was forked by sub-thread. Fix the "is it our child" check. The previous commit ee0acf90d320c29916ba8c5c1b2e908d81f5057d was not complete. (this patch asks for the new same_thread_group() helper, but mainline doesn't have it yet). Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru> --- t/kernel/sys.c~SETPGID 2007-08-09 19:59:27.000000000 +0400 +++ t/kernel/sys.c 2007-08-22 20:11:23.000000000 +0400 @@ -1442,7 +1442,6 @@ asmlinkage long sys_times(struct tms __u * Auch. Had to add the 'did_exec' flag to conform completely to POSIX. * LBT 04.03.94 */ - asmlinkage long sys_setpgid(pid_t pid, pid_t pgid) { struct task_struct *p; @@ -1470,7 +1469,7 @@ asmlinkage long sys_setpgid(pid_t pid, p if (!thread_group_leader(p)) goto out; - if (p->real_parent == group_leader) { + if (p->real_parent->tgid == group_leader->tgid) { err = -EPERM; if (task_session(p) != task_session(group_leader)) goto out; ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] setpgid(child) fails if the child was forked by sub-thread 2007-08-22 16:55 ` [PATCH] setpgid(child) fails if the child was forked by sub-thread Oleg Nesterov @ 2007-08-22 17:08 ` Randy Dunlap 2007-08-22 17:24 ` Oleg Nesterov 0 siblings, 1 reply; 5+ messages in thread From: Randy Dunlap @ 2007-08-22 17:08 UTC (permalink / raw) To: Oleg Nesterov; +Cc: Andrew Morton, Marcin Kowalczyk, linux-kernel On Wed, 22 Aug 2007 20:55:39 +0400 Oleg Nesterov wrote: so "fixes http://bugzilla.kernel.org/show_bug.cgi?id=8921" ?? > Spotted by Marcin Kowalczyk <qrczak@knm.org.pl>. > > sys_setpgid(child) fails if the child was forked by sub-thread. > > Fix the "is it our child" check. The previous commit > ee0acf90d320c29916ba8c5c1b2e908d81f5057d was not complete. > > (this patch asks for the new same_thread_group() helper, but mainline doesn't > have it yet). > > Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru> > > --- t/kernel/sys.c~SETPGID 2007-08-09 19:59:27.000000000 +0400 > +++ t/kernel/sys.c 2007-08-22 20:11:23.000000000 +0400 > @@ -1442,7 +1442,6 @@ asmlinkage long sys_times(struct tms __u > * Auch. Had to add the 'did_exec' flag to conform completely to POSIX. > * LBT 04.03.94 > */ > - > asmlinkage long sys_setpgid(pid_t pid, pid_t pgid) > { > struct task_struct *p; > @@ -1470,7 +1469,7 @@ asmlinkage long sys_setpgid(pid_t pid, p > if (!thread_group_leader(p)) > goto out; > > - if (p->real_parent == group_leader) { > + if (p->real_parent->tgid == group_leader->tgid) { > err = -EPERM; > if (task_session(p) != task_session(group_leader)) > goto out; > > - --- ~Randy *** Remember to use Documentation/SubmitChecklist when testing your code *** ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] setpgid(child) fails if the child was forked by sub-thread 2007-08-22 17:08 ` Randy Dunlap @ 2007-08-22 17:24 ` Oleg Nesterov 2007-08-22 17:30 ` Randy Dunlap 0 siblings, 1 reply; 5+ messages in thread From: Oleg Nesterov @ 2007-08-22 17:24 UTC (permalink / raw) To: Randy Dunlap; +Cc: Andrew Morton, Marcin Kowalczyk, linux-kernel On 08/22, Randy Dunlap wrote: > > On Wed, 22 Aug 2007 20:55:39 +0400 Oleg Nesterov wrote: > > > so "fixes http://bugzilla.kernel.org/show_bug.cgi?id=8921" ?? Hopefully yes... should I add some note at /bugzilla.kernel.org? Oleg. ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] setpgid(child) fails if the child was forked by sub-thread 2007-08-22 17:24 ` Oleg Nesterov @ 2007-08-22 17:30 ` Randy Dunlap 2007-08-23 8:49 ` Marcin 'Qrczak' Kowalczyk 0 siblings, 1 reply; 5+ messages in thread From: Randy Dunlap @ 2007-08-22 17:30 UTC (permalink / raw) To: Oleg Nesterov; +Cc: Andrew Morton, Marcin Kowalczyk, linux-kernel On Wed, 22 Aug 2007 21:24:36 +0400 Oleg Nesterov wrote: > On 08/22, Randy Dunlap wrote: > > > > On Wed, 22 Aug 2007 20:55:39 +0400 Oleg Nesterov wrote: > > > > > > so "fixes http://bugzilla.kernel.org/show_bug.cgi?id=8921" ?? > > Hopefully yes... should I add some note at /bugzilla.kernel.org? I think that it can wait until Marcin confirms that it's fixed (if he does so soon), then mark 8921 as fixed. --- ~Randy *** Remember to use Documentation/SubmitChecklist when testing your code *** ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] setpgid(child) fails if the child was forked by sub-thread 2007-08-22 17:30 ` Randy Dunlap @ 2007-08-23 8:49 ` Marcin 'Qrczak' Kowalczyk 0 siblings, 0 replies; 5+ messages in thread From: Marcin 'Qrczak' Kowalczyk @ 2007-08-23 8:49 UTC (permalink / raw) To: Randy Dunlap; +Cc: Oleg Nesterov, Andrew Morton, linux-kernel Dnia 22-08-2007, Śr o godzinie 10:30 -0700, Randy Dunlap napisał(a): > > > so "fixes http://bugzilla.kernel.org/show_bug.cgi?id=8921" ?? > > > > Hopefully yes... should I add some note at /bugzilla.kernel.org? > > I think that it can wait until Marcin confirms that it's fixed > (if he does so soon), then mark 8921 as fixed. Yes, it's fixed. Thank you! -- __("< Marcin Kowalczyk \__/ qrczak@knm.org.pl ^^ http://qrnik.knm.org.pl/~qrczak/ ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-08-23 9:26 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-8921-10286@http.bugzilla.kernel.org/>
[not found] ` <20070822082517.321edfa5.akpm@linux-foundation.org>
2007-08-22 16:55 ` [PATCH] setpgid(child) fails if the child was forked by sub-thread Oleg Nesterov
2007-08-22 17:08 ` Randy Dunlap
2007-08-22 17:24 ` Oleg Nesterov
2007-08-22 17:30 ` Randy Dunlap
2007-08-23 8:49 ` Marcin 'Qrczak' Kowalczyk
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
Powered by JetHome