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:	Tue, 31 Jul 2007 13:35:40 +0200
From:	Andi Kleen <ak@...e.de>
To:	"Huang, Ying" <ying.huang@...el.com>
Cc:	akpm@...ux-foundation.org, Yinghai Lu <yhlu.kernel@...il.com>,
	"Eric W. Biederman" <ebiederm@...ssion.com>,
	Randy Dunlap <randy.dunlap@...cle.com>,
	Chandramouli Narayanan <mouli@...ux.intel.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/5] x86_64 EFI support -v3: EFI boot support


>  static unsigned long dma_reserve __initdata;
> +/* Flag indicating EFI runtime executable code area */
> +static int efi_runtime_code_area;

We don't normally use globals to modify function behaviour.

>  
>  DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
>  
> @@ -199,7 +202,7 @@
>  static __meminit void unmap_low_page(void *adr)
>  { 
>  
> -	if (after_bootmem)
> +	if (after_bootmem || efi_runtime_code_area)
>  		return;
>  
>  	early_iounmap(adr, PAGE_SIZE);
> @@ -259,16 +262,21 @@
>  		pmd_t *pmd = pmd_page + pmd_index(address);
>  
>  		if (address >= end) {
> -			if (!after_bootmem)
> +			if (!after_bootmem && !efi_runtime_code_area)


This one seems also weird. Are you sure this doesn't remove _NX from
more than the intended area? 

>  				for (; i < PTRS_PER_PMD; i++, pmd++)
>  					set_pmd(pmd, __pmd(0));
>  			break;
>  		}
>  
> -		if (pmd_val(*pmd))
> +		if (pmd_val(*pmd) && !efi_runtime_code_area)
>  			continue;
>  
> -		entry = _PAGE_NX|_PAGE_PSE|_KERNPG_TABLE|_PAGE_GLOBAL|address;
> +		if (efi_runtime_code_area) {
> +			entry = pmd_val(*pmd);
> +			entry &= ~_PAGE_NX;
> +		} else
> +			entry = _PAGE_NX | _PAGE_PSE | _KERNPG_TABLE | \
> +				_PAGE_GLOBAL | address;

This doesn't look correct. PSE/KERNPG/GLOBAL/address surely need to be set
for EFI areas too.

The changes to this file are quite messy.
Perhaps it would be better if you just use change_page_attr() afterwards.
This would make it using 4K pages instead of 2MB, but that wouldn't be a catastrophe.

What exactly are you trying to do here? Just remove _NX for some areas?

-Andi

-
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