lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cc723f590702250633i27a79a9tedd5fe670cd9e4ed@mail.gmail.com>
Date:	Sun, 25 Feb 2007 20:03:07 +0530
From:	"Aneesh Kumar" <aneesh.kumar@...il.com>
To:	"Rafael J. Wysocki" <rjw@...k.pl>
Cc:	"Pavel Machek" <pavel@....cz>, LKML <linux-kernel@...r.kernel.org>,
	paulmck@...ux.vnet.ibm.com, ego@...ibm.com, akpm@...l.org,
	mingo@...e.hu, vatsa@...ibm.com, dipankar@...ibm.com,
	venkatesh.pallipadi@...el.com
Subject: Re: [RFC][PATCH 4/7] Freezer: Fix vfork problem

On 2/25/07, Rafael J. Wysocki <rjw@...k.pl> wrote:
> On Sunday, 25 February 2007 11:45, Rafael J. Wysocki wrote:
> > Hi,
> >
> > =========
> --- linux-2.6.20-mm2.orig/kernel/power/process.c        2007-02-22 23:44:04.000000000 +0100
> +++ linux-2.6.20-mm2/kernel/power/process.c     2007-02-23 22:33:11.000000000 +0100
> @@ -127,22 +127,12 @@ static unsigned int try_to_freeze_tasks(
>                                 cancel_freezing(p);
>                                 continue;
>                         }
> -                       if (is_user_space(p)) {
> -                               if (!freeze_user_space)
> -                                       continue;
> -
> -                               /* Freeze the task unless there is a vfork
> -                                * completion pending
> -                                */
> -                               if (!p->vfork_done)
> -                                       freeze_process(p);
> -                       } else {
> -                               if (freeze_user_space)
> -                                       continue;
> +                       if (is_user_space(p) == !freeze_user_space)
> +                               continue;
>

How about ?
if ( ! (is_user_space(p) == freeze_user_space) )
     continue;


BTW one of the concern that vatsa had was; is it ok to allow some of
the tasks to be left running  ( the parent from vfork ) while
freezing.  I guess we can solve this in a nice way.

in fork.c

if (clone_flags & CLONE_VFORK) {
                        p->vfork_done = &vfork;
                        p->flags |= PF_PARENT_WAKEUP_ON_FREEZE;
                        init_completion(&vfork);
}


and in freeze_process(struct task_struct *p)

if ( p->flags & PF_PARENT_WAKEUP_ON_FREEZE ) {
  wake_up_parent();
}

now parent should be wating for these completion via

wait_for_completion_freezable(); // pavel's implementation.

-aneesh
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ