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, 30 Apr 2007 07:01:33 +0200
From:	Borislav Petkov <bbpetkov@...oo.de>
To:	Andi Kleen <ak@...e.de>
Cc:	patches@...-64.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] [9/26] x86_64: Fix vmalloc_32 to really allocate <4GB on 64bit platforms

On Mon, Apr 30, 2007 at 01:46:18AM +0200, Andi Kleen wrote:
> 
> Ugly ifdef, but should handle all 64bit platforms that have suitable
> zones. On some like Altix it's probably impossible without IOMMU
> use to get memory <4GB this way,  but they have to live with that.
> Signed-off-by: Andi Kleen <ak@...e.de>
> 
> ---
>  mm/vmalloc.c |   12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> Index: linux/mm/vmalloc.c
> ===================================================================
> --- linux.orig/mm/vmalloc.c
> +++ linux/mm/vmalloc.c
> @@ -577,6 +577,14 @@ void *vmalloc_exec(unsigned long size)
>  	return __vmalloc(size, GFP_KERNEL | __GFP_HIGHMEM, PAGE_KERNEL_EXEC);
>  }
>  
> +#if defined(CONFIG_64BIT) && defined(CONFIG_ZONE_DMA32)
> +#define GFP_VMALLOC32 GFP_DMA32
> +#elif defined(CONFIG_64BIT) && defined(CONFIG_ZONE_DMA)
> +#define GFP_VMALLOC32 GFP_DMA
> +#else
> +#define GFP_VMALLOC32 GFP_KERNEL
> +#endif
> +

Isn't the following shorter:


Index: 2.6.21/mm/vmalloc.c
===================================================================
--- 2.6.21.orig/mm/vmalloc.c
+++ 2.6.21/mm/vmalloc.c
@@ -577,6 +577,15 @@ void *vmalloc_exec(unsigned long size)
 	return __vmalloc(size, GFP_KERNEL | __GFP_HIGHMEM, PAGE_KERNEL_EXEC);
 }

+#if defined(CONFIG_64BIT)
+  #if defined(CONFIG_ZONE_DMA32)
+  #define GFP_VMALLOC32 GFP_DMA32
+  #elif defined(CONFIG_ZONE_DMA)
+  #define GFP_VMALLOC32 GFP_DMA
+#else
+  #define GFP_VMALLOC32 GFP_KERNEL
+#endif
+
 /**
  *	vmalloc_32  -  allocate virtually contiguous memory (32bit addressable)
  *	@size:		allocation size
-- 
Regards/Gruß,
    Boris.
-
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