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]
Message-ID: <AANLkTi=6+NdnkjAQhxE-PYKOpnoy6zV6z-JGR0u2tqPT@mail.gmail.com>
Date:	Thu, 13 Jan 2011 10:58:40 -0800
From:	Hugh Dickins <hughd@...gle.com>
To:	Linus Torvalds <torvalds@...ux-foundation.org>
Cc:	Gleb Natapov <gleb@...hat.com>, Rik van Riel <riel@...hat.com>,
	Avi Kivity <avi@...hat.com>,
	Marcelo Tosatti <mtosatti@...hat.com>,
	linux-kernel <linux-kernel@...r.kernel.org>,
	KVM list <kvm@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [GIT PULL] KVM updates for the 2.6.38 merge window

On Thu, Jan 13, 2011 at 7:43 AM, Linus Torvalds
<torvalds@...ux-foundation.org> wrote:
> On Thu, Jan 13, 2011 at 4:53 AM, Gleb Natapov <gleb@...hat.com> wrote:
>>
>> I implemented get_user_pages_nowait() on top of your patch. In my testing
>> it works as expected when used inside KVM. Does this looks OK to you?
>
> It looks reasonable, although I suspect the subtle behavior wrt the
> mmap_sem means that you should not expose the magic bare
> FAULT_FLAG_ALLOW_RETRY flag to the __get_user_pages() thing. It's just
> too easy to introduce bugs, methinks.
>
> So I'd suggest
>
>  - drop FOLL_RETRY
>
>  -  make FOLL_NOWAIT set both (FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_NOWAIT)
>
> and that way the get_user_pages() thing will never release the
> mmap_sem, and you never have any subtle locking issues for that
> particular interface.
>
> But some other VM person should look at it too.

I haven't been following and am not really looking yet, but should
express a preference: that Gleb keep it as he had it (if that works),
rather than making FOLL_NOWAIT do a combination.

A couple of months ago I needed to add a FOLL flag myself, and made a
patch to use the same space for FOLL flags and FAULT_FLAGs, to end
such ugliness as you see in this patch:

+                                       ((foll_flags & FOLL_WRITE) ?
+                                       FAULT_FLAG_WRITE : 0) |
+                                       ((foll_flags & FOLL_RETRY) ?
+                                       FAULT_FLAG_ALLOW_RETRY : 0) |
+                                       ((foll_flags & FOLL_NOWAIT) ?
+                                       FAULT_FLAG_RETRY_NOWAIT : 0));

But I missed my window, I think several have been added since, with
more on the way: I intend to put it together again for mmotm once the
dust has settled a little.

__get_user_pages already has wrappers for friendly usage, I think it's
okay for the wrappers to have special knowledge of what's needed.

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