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]
Date:	Sun, 28 Jul 2013 13:28:38 +0400
From:	Pavel Emelyanov <xemul@...allels.com>
To:	Andy Lutomirski <luto@...capital.net>,
	Cyrill Gorcunov <gorcunov@...il.com>
CC:	Linux MM <linux-mm@...ck.org>, LKML <linux-kernel@...r.kernel.org>,
	"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 07/27/2013 11:29 PM, Pavel Emelyanov wrote:
> On 07/27/2013 12:55 AM, 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
>> (or whatever the next level is called) gets zapped?  (Also, what
>> happens if you unmap a file and map a different file there?)
> 
> The whole pte gets zapped on vma unmap, and in this case forgetting
> the soft-dirty bit completely is OK.

I mean -- soft-dirty bits denote changes in the vm area, if you remove
one, then it can be found out from the /proc/pid/maps file that the
vma has disappeared.

But one problem really went unnoticed here -- if we map a new vma in 
place of some old one with the same flags and prots. It looks like we 
need a vma soft-dirty mark, that is set on mmap and mremap, is cleared 
on soft dirty clear and is propagated into pte pagemap bits.

>> --Andy

Thanks,
Pavel
--
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