Re: Possible memory leak in xfrm_policy_insert

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



   From: Herbert Xu <herbert@gondor.apana.org.au>
   Date: Sun, 1 Jun 2003 17:07:17 +1000
   
   And here is a patch to fix the leak in the flow cache.  They used
   to be pol_put's before the move.

I understand the bug, but I'd prefer to fix it in some other way.

The idea is to make flow cache completely stateless and to know as
little about objects as possible.  In this view the flow cache does
not kill objects, it merely get/put references to them.

So what we might need to do instead is to create a policy garbage
collection list, xfrm_policy_kill() adds entries to here and a
periodic timer checks the entries for zero refcount.

This points out a flaw in the flow cache (regardless of your
scheme or mine), namely that until something causes flow cache
to shrink the policies can hang around forever.  (Ie. is no further
packets go through the system, the freeing engine hangs)

Therefore this is my bug and my problem.  I will take care of this.

I need to add a forceful flush mechanism to the flow cache that will
destroy all such references.  Let us name this interface:

void flow_cache_flush(struct flowi *key);

It is defined to delete all flow cache entries matching given key.
It must be called after the tables that the "flow_resolve_t" callback
for this object will search.  This means we'd invoke it from
xfrm_policy_kill() or similar.
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux