lkml.org 
[lkml]   [2021]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/1] mm: restore full accuracy in COW page reuse
On Sat, Jan 09, 2021 at 09:54:05PM -0500, Andrea Arcangeli wrote:
> Hello,
>
> On Sat, Jan 09, 2021 at 07:44:35PM -0500, Andrea Arcangeli wrote:
> > allowing a child to corrupt memory in the parent. That's a problem
> > that could happen not-maliciously too. So the scenario described
>
> I updated the above partly quoted sentence since in the previous
> version it didn't have full accuracy:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/andrea/aa.git/commit/?id=fc5a76b1c14e5e6cdc64ece306fc03773662d98a
>
> "However since a single transient GUP pin on a tail page, would elevate
> the page_count for all other tail pages (unlike the mapcount which is
> subpage granular), the COW page reuse inaccuracy would then cross
> different vmas and the effect would happen at a distance in vma of
> different processes. A single GUP pin taken on a subpage mapped in a
> different process could trigger 511 false positive COWs copies in the
> local process, after a fork()."
>
> This a best effort to try to document all side effects, but it'd be
> great to hear from Kirill too on the above detail to have
> confirmation.

Yes, this side effect is possible. But I wouldn't worry about too much. If
it routinely happens in a real workloads (I doubt it does), the workload
can tune it with MADV_NOHUGEPAGE/MADV_DONTFORK/MADV_WIPEONFORK or
something.

--
Kirill A. Shutemov

\
 
 \ /
  Last update: 2021-01-11 15:15    [W:0.935 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site