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-next>] [day] [month] [year] [list]
Date:	Wed, 27 Jan 2016 14:39:58 -0500
From:	Johannes Weiner <hannes@...xchg.org>
To:	Andy Lutomirski <luto@...nel.org>, Hugh Dickins <hughd@...gle.com>,
	Andrew Morton <akpm@...ux-foundation.org>
Cc:	linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: [PATCH] mm: do not let vdso pages into LRU rotation

Hi,

I noticed that vdso pages are faulted and unmapped as if they were
regular file pages. And I'm guessing this is so that the vdso mappings
are able to use the generic COW code in memory.c.

However, it's a little unsettling that zap_pte_range() makes decisions
based on PageAnon() and the page even reaches mark_page_accessed(), as
that function makes several assumptions about the page being a regular
LRU user page. It seems this isn't crashing today by sheer luck, but I
am working on code that does when page_is_file_cache() returns garbage.

I'm using this hack to work around it:

diff --git a/mm/memory.c b/mm/memory.c
index c387430f06c3..f0537c500150 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1121,7 +1121,8 @@ again:
 					set_page_dirty(page);
 				}
 				if (pte_young(ptent) &&
-				    likely(!(vma->vm_flags & VM_SEQ_READ)))
+				    likely(!(vma->vm_flags & VM_SEQ_READ)) &&
+				    !PageReserved(page))
 					mark_page_accessed(page);
 				rss[MM_FILEPAGES]--;
 			}

but I think we need a cleaner (and more robust) solution there to make
it clearer that these pages are not regularly managed pages.

Could the VDSO be a VM_MIXEDMAP to keep the initial unmanaged pages
out of the VM while allowing COW into regular anonymous pages?

Are there other requirements of the VDSO that I might be missing?

Any feedback would be greatly appreciated.

Thanks!
Johannes

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ