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, 22 Nov 2010 09:07:10 +0100
From:	Ingo Molnar <mingo@...e.hu>
To:	Lin Ming <ming.m.lin@...el.com>
Cc:	Matthieu Castet <castet.matthieu@...e.fr>,
	Siarhei Liakh <sliakh.lkml@...il.com>,
	Xuxian Jiang <jiang@...ncsu.edu>,
	Arjan van de Ven <arjan@...radead.org>,
	Andi Kleen <andi@...stfloor.org>,
	lkml <linux-kernel@...r.kernel.org>
Subject: Re: -tip tree resume fail, bisect to 5bd5a45(x86: Add NX protection
 for kernel data)


* Lin Ming <ming.m.lin@...el.com> wrote:

> Hi, all
> 
> Current -tip tree(92c883a) fail to resume after suspend to mem.
> Bisect to commit 5bd5a45(x86: Add NX protection for kernel data).
> 
> commit 5bd5a452662bc37c54fb6828db1a3faf87e6511c
> Author: Matthieu Castet <castet.matthieu@...e.fr>
> Date:   Tue Nov 16 22:31:26 2010 +0100
> 
>     x86: Add NX protection for kernel data
> 
> 
> I did some debug and found the regression is caused by below line.
> 
> -       set_memory_nx(rodata_start, (end - rodata_start) >> PAGE_SHIFT);
> +       set_memory_nx(rodata_start, (kernel_end - rodata_start) >> PAGE_SHIFT);
> 
> In my machine,
> rodata_start=0xffffffff81a00000, end=0xffffffff81e00000, kernel_end=0xffffffff82200000
> 
> Without this commit, kernel page table dumps
> 
> ---[ High Kernel Mapping ]---
> ....
> 0xffffffff81a00000-0xffffffff81c00000           2M     ro         PSE GLB NX pmd
> 0xffffffff81c00000-0xffffffff81d91000        1604K     ro             GLB NX pte
> 0xffffffff81d91000-0xffffffff81e00000         444K     ro             GLB NX pte
> 0xffffffff81e00000-0xffffffff82000000           2M     RW         PSE GLB x  pmd
> 0xffffffff82000000-0xffffffff8200c000          48K     RW             GLB x  pte
> 0xffffffff8200c000-0xffffffff82100000         976K     RW             GLB x  pte
> 0xffffffff82100000-0xffffffff82200000           1M     RW             GLB x  pte
> .....
> 
> With this commit, kernel page table dumps
> 
> ---[ High Kernel Mapping ]---
> ....
> 0xffffffff81a00000-0xffffffff81c00000           2M     ro         PSE GLB NX pmd
> 0xffffffff81c00000-0xffffffff81d91000        1604K     ro             GLB NX pte
> 0xffffffff81d91000-0xffffffff81e00000         444K     ro             GLB NX pte
> 0xffffffff81e00000-0xffffffff82000000           2M     RW         PSE GLB NX pmd
> 0xffffffff82000000-0xffffffff8200c000          48K     RW             GLB NX pte
> 0xffffffff8200c000-0xffffffff82100000         976K     RW             GLB NX pte
> 0xffffffff82100000-0xffffffff82200000           1M     RW             GLB NX pte
> .....
> 
> The only difference is 0xffffffff81e00000(end) to 0xffffffff82200000(kernel_end) is set to NX.
> 
> I guess this range code is used by resume wakeup code. So setting it to NX causes problem.
> 
> Any idea?

Yeah, the resume area is a trampoline, it needs to be executable.

Thanks,

	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