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, 25 Mar 2008 16:44:18 -0400
From:	Daniel Yeisley <dan.yeisley@...sys.com>
To:	Pekka Enberg <penberg@...helsinki.fi>
Cc:	linux-kernel@...r.kernel.org, akpm@...l.org,
	Christoph Lameter <clameter@....com>
Subject: Re: [PATCH] list_add corruption in slab.c

On Tue, 2008-03-25 at 20:45 +0200, Pekka Enberg wrote:
> Hi Daniel,
> 
> On Tue, Mar 25, 2008 at 6:57 PM, Daniel Yeisley <dan.yeisley@...sys.com> wrote:
> > I've been seeing list_add corruption in slab.c on the ES7000 since the
> >  2.6.24.1 kernel.  There are several places where the initkmem_list3
> >  array is access by [somevalue + node].  This also needs to be done in
> >  kmem_cache_init().
> >
> >  Signed-off-by: Dan Yeisley <dan.yeisley@...sys.com>
> >
> >  ---
> >  diff -Naur linux-2.6.25-rc5/mm/slab.c linux-2.6.25-rc5-new/mm/slab.c
> >  --- linux-2.6.25-rc5/mm/slab.c  2008-03-10 01:22:27.000000000 -0400
> >  +++ linux-2.6.25-rc5-new/mm/slab.c      2008-03-20 13:59:24.000000000 -0400
> >  @@ -1481,7 +1481,7 @@
> >         list_add(&cache_cache.next, &cache_chain);
> >         cache_cache.colour_off = cache_line_size();
> >         cache_cache.array[smp_processor_id()] = &initarray_cache.cache;
> >  -       cache_cache.nodelists[node] = &initkmem_list3[CACHE_CACHE];
> >  +       cache_cache.nodelists[node] = &initkmem_list3[CACHE_CACHE + node];
> 
> Good catch! You'd need to fix up the use of initkmem_list3 farther
> down in kmem_init_cache():
> 
> >        /* 5) Replace the bootstrap kmem_list3's */
> >        {
> >                int nid;
> >
> >                for_each_online_node(nid) {
> >                        init_list(&cache_cache, &initkmem_list3[CACHE_CACHE], nid);
> 
> Care to send a tested patch that fixes that as well?
> 
>                           Pekka

I actually saw that initkmem_list reference, but didn't change it since
my original patch fixed my list corruption.  Anyway, I made the changed
and tested it.  The system booted fine.

Signed-off-by: Dan Yeisley <dan.yeisley@...sys.com>

---
diff -Nuar linux-2.6.25-rc6/mm/slab.c linux-2.6.25-rc6-new/mm/slab.c
--- linux-2.6.25-rc6/mm/slab.c	2008-03-25 15:39:07.000000000 -0400
+++ linux-2.6.25-rc6-new/mm/slab.c	2008-03-25 15:13:01.000000000 -0400
@@ -1481,7 +1481,7 @@
 	list_add(&cache_cache.next, &cache_chain);
 	cache_cache.colour_off = cache_line_size();
 	cache_cache.array[smp_processor_id()] = &initarray_cache.cache;
-	cache_cache.nodelists[node] = &initkmem_list3[CACHE_CACHE];
+	cache_cache.nodelists[node] = &initkmem_list3[CACHE_CACHE + node];
 
 	/*
 	 * struct kmem_cache size depends on nr_node_ids, which
@@ -1602,7 +1602,7 @@
 		int nid;
 
 		for_each_online_node(nid) {
-			init_list(&cache_cache, &initkmem_list3[CACHE_CACHE], nid);
+			init_list(&cache_cache, &initkmem_list3[CACHE_CACHE + nid], nid);
 
 			init_list(malloc_sizes[INDEX_AC].cs_cachep,
 				  &initkmem_list3[SIZE_AC + nid], nid);

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