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: <569FCA5A.8040906@suse.cz>
Date:	Wed, 20 Jan 2016 18:56:42 +0100
From:	Vlastimil Babka <vbabka@...e.cz>
To:	Dave Hansen <dave@...1.net>, linux-kernel@...r.kernel.org
Cc:	linux-mm@...ck.org, x86@...nel.org, dave.hansen@...ux.intel.com,
	akpm@...ux-foundation.org, kirill.shutemov@...ux.intel.com,
	aarcange@...hat.com, n-horiguchi@...jp.nec.com, jack@...e.cz
Subject: Re: [PATCH] mm, gup: introduce concept of "foreign" get_user_pages()

On 01/20/2016 06:35 PM, Dave Hansen wrote:
> Here's another revision taking Vlastimil's suggestions about
> keeping __get_user_pages_unlocked() as-is in to account.
> This does, indeed, look nicer.  Now, all the "__" variants
> take a full tsk/mm and flags.
> 
> He also noted that the two sites where we called gup with
> tsk=NULL were probably incorrectly changing behavior with respect
> to fault accounting.  Long-term, I wonder if we should just add
> a "FOLL_" flag to make that more explicit, but for now, I've
> fixed up those sites.
> 
> ---
> 
> From: Dave Hansen <dave.hansen@...ux.intel.com>
> 
> For protection keys, we need to understand whether protections
> should be enforced in software or not.  In general, we enforce
> protections when working on our own task, but not when on others.
> We call these "current" and "foreign" operations.
> 
> This patch introduces a new get_user_pages() variant:
> 
> 	get_user_pages_foreign()
> 
> The plain get_user_pages() can no longer be used on mm/tasks
> other than 'current/current->mm', which is by far the most common
> way it is called.  Using it makes a few of the call sites look a
> bit nicer.
> 
> In other words, get_user_pages_foreign() is a replacement for
> when get_user_pages() is called on non-current tsk/mm.
> 
> This also switches get_user_pages_(un)locked() over to be like
> get_user_pages() and not take a tsk/mm.  There is no
> get_user_pages_foreign_(un)locked().  If someone wants that
> behavior they just have to use "__" variant and pass in
> FOLL_FOREIGN explicitly.

Hm so this gets a bit ahead of patch "mm: add gup flag to indicate "foreign" mm
access", right? It might be cleaner to postpone passing FOLL_FOREIGN until then,
but not critical.

BTW doesn't that other patch miss passing FOLL_FOREIGN from
get_user_pages_foreign() or something? I see it only uses it from break_ksm(),
am I missing something?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ