All of lore.kernel.org
 help / color / mirror / Atom feed
* [Kernel-janitors] Re: 2.6.1: net/ipv4/fib_hash.c: check kmem_cache
@ 2004-02-17  9:55 Arnaldo Carvalho de Melo
  2004-02-17 10:54 ` [Kernel-janitors] Re: 2.6.1: net/ipv4/fib_hash.c: check kme Arnaldo Carvalho de Melo
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Arnaldo Carvalho de Melo @ 2004-02-17  9:55 UTC (permalink / raw)
  To: kernel-janitors

Em Tue, Feb 17, 2004 at 10:32:20AM +0100, Walter Harms escreveu:
> hi list,
> this patch is the same as before and fixes the
> problem acme found.
> must_free is only set if kmem_cache_create is realy used
> and only then freed.
> 
> background:
> fib_hash_init() can be called many times. if fn_hash_kmem
> is already set and kmalloc fails the wrong fn_hash_kmem is freed. I think this can only happen if
> CONFIG_IP_MULTIPLE_TABLES is set.
> 
> regards,
> walter
> 
> 
> --- linux-2.6.1/net/ipv4/fib_hash.c.org 2004-02-17 09:19:21.000000000 +0100
> +++ linux-2.6.1/net/ipv4/fib_hash.c     2004-02-17 10:20:08.000000000 +0100
> @@ -870,16 +870,23 @@
>  #endif
>  {
>         struct fib_table *tb;
> -
> -       if (fn_hash_kmem = NULL)
> +       int must_free=0;
> +       if (fn_hash_kmem = NULL) {
>                 fn_hash_kmem = kmem_cache_create("ip_fib_hash",
>                                                  sizeof(struct fib_node),
>                                                  0, SLAB_HWCACHE_ALIGN,
>                                                  NULL, NULL);
> +               if (!fn_hash_kmem)
> +               return NULL;
> +               must_free=1;

Funny code 8) Please let me know when must_free=1; will ever be reached...

In this case we can say "!Never Say Never" 8)

- Arnaldo
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors

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

end of thread, other threads:[~2004-02-24 22:58 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-17  9:55 [Kernel-janitors] Re: 2.6.1: net/ipv4/fib_hash.c: check kmem_cache Arnaldo Carvalho de Melo
2004-02-17 10:54 ` [Kernel-janitors] Re: 2.6.1: net/ipv4/fib_hash.c: check kme Arnaldo Carvalho de Melo
2004-02-17 17:24 ` Randy.Dunlap
2004-02-18 21:48 ` Francois Romieu
2004-02-19  0:32 ` Arnaldo Carvalho de Melo
2004-02-19  0:33 ` Francois Romieu
2004-02-19  1:30 ` Arnaldo Carvalho de Melo
2004-02-19 23:02 ` Re: [Kernel-janitors] Re: 2.6.1: net/ipv4/fib_hash.c: check Francois Romieu
2004-02-24 21:53 ` Randy.Dunlap
2004-02-24 22:58 ` Francois Romieu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.