2004-06-17 16:30:46

by Greg KH

[permalink] [raw]
Subject: [PATCH] remove EXPORT_SYMBOL(kallsyms_lookup)

Hi,

Distros have started to ship kernels with this patch, as it seems that
some unnamed binary module authors are already abusing this function (as
well as some open source modules, like the openib code.) I could not
find any valid reason why this symbol should be exported, so here's a
patch against 2.6.7 that removes it.

Signed-off-by: Greg Kroah-Hartman <[email protected]>

thanks,

greg k-h


diff -Nru a/kernel/kallsyms.c b/kernel/kallsyms.c
--- a/kernel/kallsyms.c Thu Jun 17 09:26:17 2004
+++ b/kernel/kallsyms.c Thu Jun 17 09:26:17 2004
@@ -320,5 +320,4 @@
}
__initcall(kallsyms_init);

-EXPORT_SYMBOL(kallsyms_lookup);
EXPORT_SYMBOL(__print_symbol);


2004-06-17 17:32:51

by Oleg Drokin

[permalink] [raw]
Subject: Re: [PATCH] remove EXPORT_SYMBOL(kallsyms_lookup)

Hello!

Greg KH <[email protected]> wrote:
GK> Distros have started to ship kernels with this patch, as it seems that
GK> some unnamed binary module authors are already abusing this function (as
GK> well as some open source modules, like the openib code.) I could not
GK> find any valid reason why this symbol should be exported, so here's a

What if some extra carefully written code detects some (non fatal) problem in
itself and decides to dump a decoded backtrace to some internal log buffer,
user will find this later and will send a bugreport to developers?
(yes, there are problems with simply doing dump_stack()).
Or perhaps we need dump_stack version that will print the dump into a
supplied buffer then?

Bye,
Oleg

2004-06-17 17:52:12

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH] remove EXPORT_SYMBOL(kallsyms_lookup)

On Thu, Jun 17, 2004 at 08:31:10PM +0300, Oleg Drokin wrote:
> Hello!
>
> Greg KH <[email protected]> wrote:
> GK> Distros have started to ship kernels with this patch, as it seems that
> GK> some unnamed binary module authors are already abusing this function (as
> GK> well as some open source modules, like the openib code.) I could not
> GK> find any valid reason why this symbol should be exported, so here's a
>
> What if some extra carefully written code detects some (non fatal) problem in
> itself and decides to dump a decoded backtrace to some internal log buffer,
> user will find this later and will send a bugreport to developers?

Do you have an example of code in the current kernel tree that does
this? If not, then feel free to bring up the discussion about exporting
this symbol at that point in time :)

> (yes, there are problems with simply doing dump_stack()).
> Or perhaps we need dump_stack version that will print the dump into a
> supplied buffer then?

That might be useful.

thanks,

greg k-h

2004-06-17 19:29:13

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [PATCH] remove EXPORT_SYMBOL(kallsyms_lookup)

On Thu, Jun 17, 2004 at 08:31:10PM +0300, Oleg Drokin wrote:
> user will find this later and will send a bugreport to developers?
> (yes, there are problems with simply doing dump_stack()).
> Or perhaps we need dump_stack version that will print the dump into a
> supplied buffer then?

Yes, please please please! ;-)

2004-06-17 20:15:14

by Dave Kleikamp

[permalink] [raw]
Subject: Re: [PATCH] remove EXPORT_SYMBOL(kallsyms_lookup)

On Thu, 2004-06-17 at 12:31, Oleg Drokin wrote:

> Or perhaps we need dump_stack version that will print the dump into a
> supplied buffer then?

That would make it easy to implement /proc/<num>/stack. I think that
would be useful.
--
David Kleikamp
IBM Linux Technology Center