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, 26 May 2009 05:21:57 -0400
From:	Christoph Hellwig <hch@...radead.org>
To:	Amerigo Wang <amwang@...hat.com>
Cc:	linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
	rusty@...tcorp.com.au, jdike@...toit.com, mingo@...e.hu
Subject: Re: [Patch 2/4] x86 module: merge the rest functions with macros

On Tue, May 26, 2009 at 04:35:22AM -0400, Amerigo Wang wrote:
> +#if defined(CONFIG_UML) || defined(CONFIG_X86_32)
> +void *module_alloc(unsigned long size)
> +{
> +	if (size == 0)
> +		return NULL;
> +	return vmalloc_exec(size);
> +}
> +#else /*X86_64*/
> +void *module_alloc(unsigned long size)
> +{
> +	struct vm_struct *area;
> +
> +	if (!size)
> +		return NULL;
> +	size = PAGE_ALIGN(size);
> +	if (size > MODULES_LEN)
> +		return NULL;
> +
> +	area = __get_vm_area(size, VM_ALLOC, MODULES_VADDR, MODULES_END);
> +	if (!area)
> +		return NULL;
> +
> +	return __vmalloc_area(area, GFP_KERNEL, PAGE_KERNEL_EXEC);
> +}
> +#endif

vmalloc_exec basically expands to the x86-64 version of that code, just
using VMALLOC_START/VMALLOC_END instead of MODULES_VADDR/MODULES_END.

So instead of having two variants it would be better to use the x86-64
unconditionally and define MODULES_VADDR/MODULES_END to
VMALLOC_START/VMALLOC_END to 32bit and uml.

And that part should be a patch of it's own, not mixed with others.

--
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