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: <20140904103949.GA19300@redhat.com>
Date:	Thu, 4 Sep 2014 12:39:49 +0200
From:	Oleg Nesterov <oleg@...hat.com>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	Rik van Riel <riel@...hat.com>, Mel Gorman <mgorman@...e.de>,
	Kautuk Consul <consul.kautuk@...il.com>,
	Ingo Molnar <mingo@...hat.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Michal Hocko <mhocko@...e.cz>,
	David Rientjes <rientjes@...gle.com>,
	Ionut Alexa <ionut.m.alexa@...il.com>,
	Guillaume Morin <guillaume@...infr.org>,
	linux-kernel@...r.kernel.org, Kirill Tkhai <tkhai@...dex.ru>
Subject: Re: task_numa_fault() && TASK_DEAD

On 09/04, Peter Zijlstra wrote:
>
> On Wed, Sep 03, 2014 at 06:08:19PM +0200, Oleg Nesterov wrote:
>
> > And a stupid (really, I don't understand this code) question:
> >
> > 	/* for example, ksmd faulting in a user's mm */
> > 	if (!p->mm)
> > 		return;
>
> In general kernel threads have !->mm, and those cannot do the
> accounting. The only way to get here is through get_user_pages() with
> tsk != current and/or mm != current->mm.
>
> > OK, but perhaps it make sense to pass "mm" as another argument and do
> >
> > 	/* ksmd faulting in a user's mm, or debugger, or kthread use_mm() caller */
> > 	if (p->mm != mm)
> > 		return;
> >
> > ?
>
> I'm still somewhat fuzzy in the brain but that doesn't appear to
> actually work, use_mm() explicitly sets ->mm so in that case it would
> match just fine.

Yes, yes, sorry, I meant

	if (p->mm != mm || PF_KTHREAD)
		return;

> That said; I don't think we really need to worry about this. The !->mm
> case is special in that that cannot ever work, the other cases are
> extremely rare and will not skew accounting much if anything.

Sure, this is not bugfix. To me this change looks like a cleanup because
I think that, say, ksmd doesn't really differ from debugger in this case
(ignoring the fact that ->mm == NULL can probably lead to crash), or from
use_mm().

But of course I agree, this is minor.

Oleg.

--
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