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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 27 Jul 2013 01:18:44 +0400
From:	Cyrill Gorcunov <gorcunov@...il.com>
To:	Andy Lutomirski <luto@...capital.net>
Cc:	Linux MM <linux-mm@...ck.org>, LKML <linux-kernel@...r.kernel.org>,
	Pavel Emelyanov <xemul@...allels.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Matt Mackall <mpm@...enic.com>,
	Xiao Guangrong <xiaoguangrong@...ux.vnet.ibm.com>,
	Marcelo Tosatti <mtosatti@...hat.com>,
	KOSAKI Motohiro <kosaki.motohiro@...il.com>,
	Stephen Rothwell <sfr@...b.auug.org.au>
Subject: Re: [PATCH] mm: Save soft-dirty bits on file pages

On Fri, Jul 26, 2013 at 01:55:04PM -0700, Andy Lutomirski wrote:
> On Fri, Jul 26, 2013 at 1:18 PM, Cyrill Gorcunov <gorcunov@...il.com> wrote:
> > Andy reported that if file page get reclaimed we loose soft-dirty bit
> > if it was there, so save _PAGE_BIT_SOFT_DIRTY bit when page address
> > get encoded into pte entry. Thus when #pf happens on such non-present
> > pte we can restore it back.
> >
> 
> Unless I'm misunderstanding this, it's saving the bit in the
> non-present PTE.  This sounds wrong -- what happens if the entire pmd

It's the same as encoding pgoff in pte entry (pte is not present),
but together with pgoff we save soft-bit status, later on #pf we decode
pgoff and restore softbit back if it was there, pte itself can't disappear
since it holds pgoff information.

> (or whatever the next level is called) gets zapped?  (Also, what
> happens if you unmap a file and map a different file there?)

If file pages are remapped to a new place we remember softdity
bit status previously has and propagate it to a new pte (as in
install_file_pte, old ptes are cleared).

If file unmapped then new one mapped, pmd/ptes are cleared
(including softbit) and it remains clear until new write
happens, if only i've not missed something obvious.
--
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