Re: 4.4-rc5: ugly warn on: 5 W+X pages found

Borislav Petkov
2015-12-15T21:34:09Z

On Tue, Dec 15, 2015 at 09:58:35PM +0100, Pavel Machek wrote:
> [ 0.000000] Base memory trampoline at [c009b000] 9b000 size 16384
> [ 0.000000] ------------[ cut here ]------------
> [ 0.000000] WARNING: CPU: 0 PID: 0 at
> ./arch/x86/include/asm/pgtable.h:357 kernel_physical_mapping_init+0x
> 256/0x395()
> [ 0.000000] Modules linked in:
> [ 0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 4.4.0-rc5+ #137
> [ 0.000000] Hardware name: LENOVO 17097HU/17097HU, BIOS 7BETD8WW
> (2.19 ) 03/31/2011
> [ 0.000000] 00000000 00000000 c4e63e90 c42baaf8 00000000 c4e63eac
> c404066b 00000165
> [ 0.000000] c4f134da 00000000 00000000 00000000 c4e63ebc c404070f
> 00000009 00000000
> [ 0.000000] c4e63f18 c4f134da c4e63f00 00000000 00000000 00000000
> 00000000 00000000
> [ 0.000000] Call Trace:
> [ 0.000000] [<c42baaf8>] dump_stack+0x41/0x59
> [ 0.000000] [<c404066b>] warn_slowpath_common+0x6b/0xa0
> [ 0.000000] [<c4f134da>] ?
> kernel_physical_mapping_init+0x256/0x395
> [ 0.000000] [<c404070f>] warn_slowpath_null+0xf/0x20
> [ 0.000000] [<c4f134da>] kernel_physical_mapping_init+0x256/0x395
> [ 0.000000] [<c4a4de21>] init_memory_mapping+0x191/0x300
> [ 0.000000] [<c4f12d96>] init_mem_mapping+0xe7/0x1f3

Looks like the ISA range to me:

init_mem_mapping:

...

/* the ISA range is always mapped regardless of memory holes */
init_memory_mapping(0, ISA_END_ADDRESS);

Does that kernel_physical_mapping_init() even pay attention to
__supported_pte_mask and thus _PAGE_NX? I don't see it.

Hmm, not really:

pgprot_t init_prot = __pgprot(PTE_IDENT_ATTR | _PAGE_PSE);

...

prot = PAGE_KERNEL_LARGE_EXEC;

...

--
Regards/Gruss,
Boris.

ECO tip #101: Trim your mails when you reply.