Re: [RFC][PATCH -mm 4/6] Freezer: Prevent new tasks from inheriting TIF_FREEZE set

Pavel Machek
2007-07-09T23:21:13Z

Hi!

> From: Rafael J. Wysocki <rjw@sisk.pl>
>
> Tasks should go to the refrigerator only if explicitly requested to do that by
> the freezer and not as a result of inheriting the TIF_FREEZE flag set from the
> parent. Make it happen.

Umm, what prevents userspace task from escaping freezer this way? Does
tasklist_lock prevent new tasks and thus this race?

Pavel

> --- linux-2.6.22-rc6-mm1.orig/kernel/fork.c
> +++ linux-2.6.22-rc6-mm1/kernel/fork.c
> @@ -932,6 +932,7 @@ static inline void copy_flags(unsigned l
> if (!(clone_flags & CLONE_PTRACE))
> p->ptrace = 0;
> p->flags = new_flags;
> + clear_freeze_flag(p);
> }
>
> asmlinkage long sys_set_tid_address(int __user *tidptr)

--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html