public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* ubi: Error freeing ubi->vtbl while unloading
@ 2007-06-15 10:01 Vinit Agnihotri
  2007-06-17 12:49 ` Artem Bityutskiy
  0 siblings, 1 reply; 4+ messages in thread
From: Vinit Agnihotri @ 2007-06-15 10:01 UTC (permalink / raw)
  To: linux-mtd

I downloaded latest git & backported ubi to make it work in linux
kernel 2.6.18.3.

Machine details
 AMD opteron 64bit SMP, linux kernel version 2.6.18.3

However while unloading ubi I discovered slab corruption. Ths problem
is as follows.

ubi->vtbl is allocated using vmalloc() in vtbl.c empty_create_lvol(),
but it is freed in build.c with kfree()

Heres a patch that makes a fix

--- build.c	2007-06-07 14:54:49.000000000 +0530
+++ build.c	2007-06-15 15:22:32.000000000 +0530
@@ -369,7 +369,7 @@
 out_wl:
 	ubi_wl_close(ubi);
 out_vtbl:
-	kfree(ubi->vtbl);
+	vfree(ubi->vtbl);
 out_si:
 	ubi_scan_destroy_si(si);
 	return err;
@@ -629,7 +629,7 @@
 out_detach:
 	ubi_eba_close(ubi);
 	ubi_wl_close(ubi);
-	kfree(ubi->vtbl);
+	vfree(ubi->vtbl);
 out_free:
 	kfree(ubi);
 out_mtd:


-- I feel free now

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ubi: Error freeing ubi->vtbl while unloading
  2007-06-15 10:01 ubi: Error freeing ubi->vtbl while unloading Vinit Agnihotri
@ 2007-06-17 12:49 ` Artem Bityutskiy
  2007-06-18  0:59   ` Josh Boyer
  0 siblings, 1 reply; 4+ messages in thread
From: Artem Bityutskiy @ 2007-06-17 12:49 UTC (permalink / raw)
  To: Vinit Agnihotri; +Cc: linux-mtd

On Fri, 2007-06-15 at 15:31 +0530, Vinit Agnihotri wrote:
> I downloaded latest git & backported ubi to make it work in linux
> kernel 2.6.18.3.
> 
> Machine details
>  AMD opteron 64bit SMP, linux kernel version 2.6.18.3
> 
> However while unloading ubi I discovered slab corruption. Ths problem
> is as follows.
> 
> ubi->vtbl is allocated using vmalloc() in vtbl.c empty_create_lvol(),
> but it is freed in build.c with kfree()

Thanks, fixed the patch, added Signed-off-by and committed. 

-- 
Best regards,
Artem Bityutskiy (Битюцкий Артём)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ubi: Error freeing ubi->vtbl while unloading
  2007-06-17 12:49 ` Artem Bityutskiy
@ 2007-06-18  0:59   ` Josh Boyer
  2007-06-18  6:45     ` Artem Bityutskiy
  0 siblings, 1 reply; 4+ messages in thread
From: Josh Boyer @ 2007-06-18  0:59 UTC (permalink / raw)
  To: dedekind; +Cc: linux-mtd, Vinit Agnihotri

On 6/17/07, Artem Bityutskiy <dedekind@infradead.org> wrote:
> On Fri, 2007-06-15 at 15:31 +0530, Vinit Agnihotri wrote:
> > I downloaded latest git & backported ubi to make it work in linux
> > kernel 2.6.18.3.
> >
> > Machine details
> >  AMD opteron 64bit SMP, linux kernel version 2.6.18.3
> >
> > However while unloading ubi I discovered slab corruption. Ths problem
> > is as follows.
> >
> > ubi->vtbl is allocated using vmalloc() in vtbl.c empty_create_lvol(),
> > but it is freed in build.c with kfree()
>
> Thanks, fixed the patch, added Signed-off-by and committed.

You added Vinit's sign off, which was missing in the first place.  Not
that I really care, but you shouldn't do that for other people.  Since
you had to fix the patch anyway, you could have done a "Reported-By:"
or something similar and it wouldn't have raised my paranoia flags at
all.

josh

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ubi: Error freeing ubi->vtbl while unloading
  2007-06-18  0:59   ` Josh Boyer
@ 2007-06-18  6:45     ` Artem Bityutskiy
  0 siblings, 0 replies; 4+ messages in thread
From: Artem Bityutskiy @ 2007-06-18  6:45 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linux-mtd, Vinit Agnihotri

Josh,

On Sun, 2007-06-17 at 19:59 -0500, Josh Boyer wrote:
> You added Vinit's sign off, which was missing in the first place.  Not
> that I really care, but you shouldn't do that for other people.  Since
> you had to fix the patch anyway, you could have done a "Reported-By:"
> or something similar and it wouldn't have raised my paranoia flags at
> all.

fair point, I'll take this into account next time, thanks.

-- 
Best regards,
Artem Bityutskiy (Битюцкий Артём)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-06-18  6:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-15 10:01 ubi: Error freeing ubi->vtbl while unloading Vinit Agnihotri
2007-06-17 12:49 ` Artem Bityutskiy
2007-06-18  0:59   ` Josh Boyer
2007-06-18  6:45     ` Artem Bityutskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox