Only force RO in the advisory protection checks when all pages in the range are RO. Previously it would trigger when any page in the range was ro. I believe this will make try_preserve_large_page much safer to use. Signed-off-by: Andi Kleen <ak@suse.de> --- arch/x86/mm/pageattr.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) Index: linux/arch/x86/mm/pageattr.c =================================================================== --- linux.orig/arch/x86/mm/pageattr.c +++ linux/arch/x86/mm/pageattr.c @@ -193,14 +193,16 @@ advised_static_prot(pgprot_t prot, unsig pgprot_t forbidden = __pgprot(0); /* The .rodata section needs to be read-only */ - if (within_range(start, end, (unsigned long)__start_rodata, - (unsigned long)__end_rodata)) + if (within_range((unsigned long)__start_rodata, + (unsigned long)__end_rodata, + start, end)) pgprot_val(forbidden) |= _PAGE_RW; /* * Do the same for the x86-64 high kernel mapping */ - if (within_range(start, end, virt_to_highmap(__start_rodata), - virt_to_highmap(__end_rodata))) + if (within_range(virt_to_highmap(__start_rodata), + virt_to_highmap(__end_rodata), + start, end)) pgprot_val(forbidden) |= _PAGE_RW; prot = __pgprot(pgprot_val(prot) & ~pgprot_val(forbidden)); --
| Greg Kroah-Hartman | [PATCH 001/196] Chinese: Add the known_regression URI to the HOWTO |
| Linus Torvalds | Linux 2.6.21-rc1 |
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| pageexec | Re: [stable] Linux 2.6.25.10 |
| Linus Torvalds | Re: [GIT]: Networking |
| Gerrit Renker | [PATCH 15/37] dccp: Set per-connection CCIDs via socket options |
| Natalie Protasevich | [BUG] New Kernel Bugs |
| Jarek Poplawski | [PATCH take 2] pkt_sched: Protect gen estimators under est_lock. |
git: | |
