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] [day] [month] [year] [list]
Date:	Mon, 27 Jun 2016 23:17:33 +0200
From:	"Rafael J. Wysocki" <rafael@...nel.org>
To:	Michal Hocko <mhocko@...nel.org>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	David Rientjes <rientjes@...gle.com>,
	Miao Xie <miaox@...fujitsu.com>,
	"Rafael J. Wysocki" <rjw@...ysocki.net>,
	Linux Memory Management List <linux-mm@...ck.org>,
	LKML <linux-kernel@...r.kernel.org>,
	"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
	Michal Hocko <mhocko@...e.com>
Subject: Re: [PATCH 1/2] freezer, oom: check TIF_MEMDIE on the correct task

On Mon, Jun 27, 2016 at 2:15 PM, Michal Hocko <mhocko@...nel.org> wrote:
> From: Michal Hocko <mhocko@...e.com>
>
> freezing_slow_path is checking TIF_MEMDIE to skip OOM killed
> tasks. It is, however, checking the flag on the current task rather than
> the given one. This is really confusing because freezing() can be called
> also on !current tasks. It would end up working correctly for its main
> purpose because __refrigerator will be always called on the current task
> so the oom victim will never get frozen. But it could lead to surprising
> results when a task which is freezing a cgroup got oom killed because
> only part of the cgroup would get frozen. This is highly unlikely but
> worth fixing as the resulting code would be more clear anyway.
>
> Signed-off-by: Michal Hocko <mhocko@...e.com>

Looks reasonable to me, so ACK.

> ---
>  kernel/freezer.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/freezer.c b/kernel/freezer.c
> index a8900a3bc27a..6f56a9e219fa 100644
> --- a/kernel/freezer.c
> +++ b/kernel/freezer.c
> @@ -42,7 +42,7 @@ bool freezing_slow_path(struct task_struct *p)
>         if (p->flags & (PF_NOFREEZE | PF_SUSPEND_TASK))
>                 return false;
>
> -       if (test_thread_flag(TIF_MEMDIE))
> +       if (test_tsk_thread_flag(p, TIF_MEMDIE))
>                 return false;
>
>         if (pm_nosig_freezing || cgroup_freezing(p))
> --

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ