lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTinq5APN4CXWAGj9sTFiTf4Cn1_mDaJSrAOh=t+N@mail.gmail.com>
Date:	Mon, 23 Aug 2010 09:44:26 -0400
From:	Brian Gerst <brgerst@...il.com>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	aijazbaig1@...il.com, netfilter-devel@...r.kernel.org,
	jengelh@...ozas.de, linux-kernel@...r.kernel.org
Subject: Re: help needed with EXPORT_SYMBOL

On Mon, Aug 23, 2010 at 9:17 AM, Peter Zijlstra <peterz@...radead.org> wrote:
> On Mon, 2010-08-23 at 07:48 -0400, Brian Gerst wrote:
>>
>> Use an exported function pointer in the main kernel as a hook that the
>> module sets when it is loaded.  Note, you must use module_get and
>> module_put around the call to the module to prevent it from unloading
>> while in use.
>
> Please don't do any such thing, its impossible to use correctly.
>
> Suppose there are two modular users, A and B.
>
> Both have something like:
>
> extern void (*fptr)(void);
>
> static void (*old_fptr)(void);
>
> static void func(void)
> {
>        /* foo */
>        if (old_fptr)
>                old_fptr();
> }
>
> module_init()
> {
>        old_fptr = fptr;
>        fptr = A_func;
> }
>
> Then you load A, load B and unload A, then guess what happens?
>

The assumption was that there was a single module using that hook.
For multiple users you'd need to use a register function that adds the
module to a linked list.

--
Brian Gerst
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ