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]
Message-ID: <20090111230430.GA17873@cmpxchg.org>
Date:	Mon, 12 Jan 2009 00:04:30 +0100
From:	Johannes Weiner <hannes@...xchg.org>
To:	Ivan Kokshaysky <ink@...assic.park.msu.ru>
Cc:	Nick Piggin <npiggin@...e.de>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Richard Henderson <rth@...ddle.net>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] alpha: fix vmalloc breakage

On Thu, Jan 08, 2009 at 02:01:44AM +0300, Ivan Kokshaysky wrote:
> On alpha, we have to map some stuff in the VMALLOC space very
> early in the boot process (to make SRM console callbacks work
> and so on, see arch/alpha/mm/init.c). For old VM allocator,
> we just manually placed a vm_struct onto the global vmlist
> and this worked for ages.
> Unfortunately, the new allocator isn't aware of this, so it constantly
> tries to allocate the VM space which is already in use, making vmalloc
> on alpha defunct.
> 
> This patch forces KVA to import vmlist entries on init.
> 
> Signed-off-by: Ivan Kokshaysky <ink@...assic.park.msu.ru>
> ---
>  mm/vmalloc.c |   13 +++++++++++++
>  1 files changed, 13 insertions(+), 0 deletions(-)
> 
> diff --git a/mm/vmalloc.c b/mm/vmalloc.c
> index c5db9a7..0dd9c2e 100644
> --- a/mm/vmalloc.c
> +++ b/mm/vmalloc.c
> @@ -24,6 +24,7 @@
>  #include <linux/rbtree.h>
>  #include <linux/radix-tree.h>
>  #include <linux/rcupdate.h>
> +#include <linux/bootmem.h>
>  
>  #include <asm/atomic.h>
>  #include <asm/uaccess.h>
> @@ -984,6 +985,8 @@ EXPORT_SYMBOL(vm_map_ram);
>  
>  void __init vmalloc_init(void)
>  {
> +	struct vmap_area *va;
> +	struct vm_struct *tmp;
>  	int i;
>  
>  	for_each_possible_cpu(i) {
> @@ -996,6 +999,16 @@ void __init vmalloc_init(void)
>  		vbq->nr_dirty = 0;
>  	}
>  
> +	/* Import existing vmlist entries. */
> +	for (tmp = vmlist; tmp; tmp = tmp->next) {
> +		va = alloc_bootmem(sizeof(struct vmap_area));
> +		if (!va)
> +			break;

You don't need this check, alloc_bootmem() panics when it fails.

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