[PATCH] UBI: fix a horrible memory deallocation bug
Richard Genoud
richard.genoud at gmail.com
Mon Sep 3 10:43:45 EDT 2012
2012/9/3 Artem Bityutskiy <dedekind1 at gmail.com>:
> From: Artem Bityutskiy <artem.bityutskiy at linux.intel.com>
>
> UBI was mistakingly using 'kfree()' instead of 'kmem_cache_free()' when
> freeing "attach eraseblock" structures in vtbl.c. Thankfully, this happened
> only when we were doing auto-format, so many systems were unaffected. However,
> there are still many users affected.
>
> It is strange, but the system did not crash and nothing bad happened when
> the SLUB memory allocator was used. However, in case of SLOB we observed an
> crash right away.
>
> This problem was introduced in 2.6.39 by commit
> "6c1e875 UBI: add slab cache for ubi_scan_leb objects"
>
> Reported-by: Richard Genoud <richard.genoud at gmail.com>
> Cc: stable at vger.kernel.org [v2.6.39+]
> Signed-off-by: Artem Bityutskiy <artem.bityutskiy at linux.intel.com>
> ---
> drivers/mtd/ubi/vtbl.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
Tested ok, works like a charm !
Thanks !
More information about the linux-mtd
mailing list