mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stephen Frost <sfrost@snowman.net>
To: Patrick McHardy <kaber@trash.net>
Cc: Amin Azez <azez@ufomechanic.net>,
	"David S. Miller" <davem@davemloft.net>,
	willy@w.ods.org, gcoady.lk@gmail.com, laforge@netfilter.org,
	netfilter-devel@lists.netfilter.org,
	linux-kernel@vger.kernel.org, marcelo@kvack.org
Subject: Re: [PATCH] fix mem-leak in netfilter
Date: Wed, 17 May 2006 09:14:15 -0400	[thread overview]
Message-ID: <20060517131415.GS7774@kenobi.snowman.net> (raw)
In-Reply-To: <446AC1FB.5070406@trash.net>

[-- Attachment #1: Type: text/plain, Size: 1374 bytes --]

* Patrick McHardy (kaber@trash.net) wrote:
> OK, updated patch attached. The TTL is now always kept up-to-date.

Yup, that looks good.  Unfortunately, it looks like the lru_list isn't
being kept track of correctly now.  Perhaps I'm reading it wrong but it
*looks* like recent_entry_init() is only initializing the lru_list for
the local entry but doesn't ever add it to the main table lru_list.  My
guess is you were expecting that to be done by recent_entry_update() but
it's never the case that recent_entry_update() is called directly after
recent_entry_init() due to the 'goto out' (my line 199).  Therefore I'm
afraid that a new entry is never added to the lru_list with the current
setup and if nothing is ever updated you'll end up in a bad situation.

I think you can just drop lines 198 & 199 and modify recent_entry_init()
to not put the initial stamp in.  This way, for a new entry to the list,
recent_entry_init() is called still on 195, the return value is updated
just like it would be for an existing entry, and recent_entry_update()
is called to handle adding the latest stamp and updating the lru_list.

Looking at list.h, I *think* that will work (wasn't sure if
list_move_tail() would be upset about the state of the e->lru_list
coming from INIT_LIST_HEAD but I think the __list_del will effectively
be a no-op and so it'll be fine).

	Thanks,

		Stephen

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  parent reply	other threads:[~2006-05-17 13:14 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-07  2:26 Jesper Juhl
2006-05-07  9:36 ` Willy Tarreau
2006-05-07 22:42   ` Grant Coady
2006-05-08  5:07     ` Willy Tarreau
2006-05-08  5:43       ` David S. Miller
2006-05-08  8:36         ` Amin Azez
2006-05-08  9:08           ` Juergen Kreileder
2006-05-12  7:40         ` Patrick McHardy
2006-05-12 11:09           ` Jesper Juhl
2006-05-12 11:33             ` Patrick McHardy
2006-05-12 12:13               ` Jesper Juhl
2006-05-12 12:40                 ` Willy Tarreau
2006-05-12 12:49                   ` Patrick McHardy
     [not found]               ` <446490BB.10801@ufomechanic.net>
2006-05-15  8:25                 ` Patrick McHardy
2006-05-15 14:28                   ` Stephen Frost
2006-05-15 18:49                     ` Patrick McHardy
2006-05-15 19:27                       ` Stephen Frost
2006-05-15 20:09                         ` Patrick McHardy
2006-05-15 20:41                           ` Stephen Frost
2006-05-15 20:45                             ` Patrick McHardy
2006-05-15 21:03                             ` Stephen Frost
2006-05-17  6:26                               ` Patrick McHardy
2006-05-17  6:59                                 ` David S. Miller
2006-05-17  7:19                                   ` Patrick McHardy
2006-05-17 10:55                                     ` Stephen Frost
2006-05-17  7:09                                 ` David S. Miller
2006-05-17  7:13                                   ` Roland Dreier
2006-05-17  7:19                                   ` Patrick McHardy
2006-05-17 13:14                                 ` Stephen Frost [this message]
2006-06-01 13:43                                 ` Andrew James Wade
2006-06-01 14:53                                   ` Patrick McHardy
2006-06-02 21:32                                     ` Andrew James Wade

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060517131415.GS7774@kenobi.snowman.net \
    --to=sfrost@snowman.net \
    --cc=azez@ufomechanic.net \
    --cc=davem@davemloft.net \
    --cc=gcoady.lk@gmail.com \
    --cc=kaber@trash.net \
    --cc=laforge@netfilter.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@kvack.org \
    --cc=netfilter-devel@lists.netfilter.org \
    --cc=willy@w.ods.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®