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:	Mon, 11 Jul 2016 16:30:15 +0300
From:	"Kirill A. Shutemov" <kirill@...temov.name>
To:	Xishi Qiu <qiuxishi@...wei.com>
Cc:	alan@...rguk.ukuu.org.uk, Linux MM <linux-mm@...ck.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: a question about protection_map[]

On Mon, Jul 11, 2016 at 06:12:30PM +0800, Xishi Qiu wrote:
> Hi,
> 
> We can use mprotect to set read only or read/write.
> 
> mprotect_fixup()
> 	vma_set_page_prot()
> 		vm_pgprot_modify()
> 			vm_get_page_prot()
> 				protection_map[vm_flags & (VM_READ|VM_WRITE|VM_EXEC|VM_SHARED)]
> 
> The following code shows that prots from __P001(PROT_READ) and __P010(PROT_WRITE)
> are the same, so how does it distinguish read only or read/write from mprotect?

It doesn't.

Write protection will be removed by fault handler on next write access to
the page. Somewhat suboptiomal, but zero page implemenation relies on this
to work properly.

-- 
 Kirill A. Shutemov

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ