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]
Message-ID: <20080125180828.GB10993@elte.hu>
Date:	Fri, 25 Jan 2008 19:08:28 +0100
From:	Ingo Molnar <mingo@...e.hu>
To:	Jeremy Fitzhardinge <jeremy@...p.org>
Cc:	Harvey Harrison <harvey.harrison@...il.com>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Andi Kleen <ak@...e.de>
Subject: Re: [PATCH UPDATE] x86: ignore spurious faults


* Jeremy Fitzhardinge <jeremy@...p.org> wrote:

> Ingo Molnar wrote:
>> thanks, applied.
>>
>> it would be nice to expose this ability of the architecture to the core 
>> Linux kernel mprotect code as well, and let it skip on a TLB flush when 
>> doing a RO->RW transition.
>
> The usermode fault handler already effectively does this; this patch 
> just does it for kernel mode as well.  I don't know if mprotect takes 
> advantage of this.

spurious faults happen all the time on SMP, in the native kernel.

And what i mean is that Linux mprotect currently does not take advantage 
of x86's ability to just change the ptes, because there's no structured 
way to tell mm/mprotect.c that "it's safe to skip the TLB flush here". 

The flush happens in mm/mprotect.c's change_protection() function:

        flush_tlb_range(vma, start, end);

and that is unnecessary when we increase the protection rights, such as 
in a RO->RW change. (all that is needed is an smp_wmb() instead, to make 
sure all the pte modifications are visible when the syscall returns.)

and it's a really rare case these days that you can find an area where 
Linux does not make use of a hardware MMU feature - so we should fix 
this ;-)

	Ingo
--
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