public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Harald Welte <laforge@netfilter.org>
To: linux-ia64@vger.kernel.org
Subject: Re: [netfilter-core] strict rejection of init -> core references causes problems
Date: Fri, 09 Jul 2004 08:01:27 +0000	[thread overview]
Message-ID: <20040709080127.GA3168@sunbeam2> (raw)
In-Reply-To: <16622.17154.117052.31601@napali.hpl.hp.com>

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

On Fri, Jul 09, 2004 at 12:02:26AM -0700, David Mosberger wrote:
> Tony,
> 
> To recap, with that patch applied, calls from the core section of a
> module to an init section are rejected because that's in general a
> dangerous thing to do (the called code may be gone by the time the
> call gets executed).

This breaks almost all netfilter modules, indeed.

> I'm not terribly familiar with the netfilter code, but I think the
> problem there comes from the fact that some code is shared between
> init and exit handlers and that shared code ends up in the module
> core.

that's exactly the case.  Since we have fairly long initialization
functions (allocating/initializing dozens of ressources, where each one
can fail), we share the code for partial and full de-initialization
between the failing module_init() routine and the module_exit() routine.

Initially Rusty wrote the modules like this, and I very much agree with
this decision to not replicate the same code in module_init() and
_exit() functions. (which would have to be kept in sync every time some
item is added to the initialization chain).

> it's common practice, I suppose we don't have much choice but to allow
> calls from core to init sections again.  Perhaps someone from the
> netfilter team could comment?

I wuold very much appreciate if this was still possible in the future.

> 	--david

-- 
- Harald Welte <laforge@netfilter.org>             http://www.netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie

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

  reply	other threads:[~2004-07-09  8:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-09  7:02 strict rejection of init -> core references causes problems David Mosberger
2004-07-09  8:01 ` Harald Welte [this message]
2004-07-09 15:59 ` Luck, Tony
2004-07-09 18:36 ` [netfilter-core] " David Mosberger
2004-07-09 18:46 ` Luck, Tony
2004-07-09 18:52 ` [netfilter-core] " Harald Welte
2004-07-09 19:19 ` Luck, Tony
2004-07-10  7:15 ` Harald Welte
2004-07-12 14:36 ` [netfilter-core] strict rejection of init -> core references Jean-Marc Saffroy

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=20040709080127.GA3168@sunbeam2 \
    --to=laforge@netfilter.org \
    --cc=linux-ia64@vger.kernel.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