lkml.org 
[lkml]   [2005]   [Sep]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [BUG] module-init-tools
On 9/19/05, Ustyugov Roman <dr_unique@ymg.ru> wrote:
> Hello!
>
> I found a bug in module-init-tools.
>
> 'lsmod' shows a wrong module name, when module name complied with some
> "define" at one of kernel header files.
>
> For example,
>
> File "current.c"
> =======================
> #include <linux/kernel.h>
> #include <linux/module.h>
>
> int init_module(void) {
>
> return 0;
> }
>
> void cleanup_module() {
> }
>
> MODULE_LICENSE("GPL");
> =======================
>
> Makefile:
>
> =======================
> obj-m += current.o
> =======================
>
> Make this module and type commands:
>
> insmod current.ko
> lsmod
>
> And we can see:
>
> Module Size Used by
> get_current() 1152 0 <---- Oops, must be 'current'
> smbfs 61432 2
> hfsplus 56708 0
> nls_cp866 5120 1
> nls_iso8859_1 4096 0
> nls_cp437 5760 0
> vfat 12800 0
> fat 37916 1 vfat
> nls_utf8 2048 1
> .....
>
> File <asm/current.h>:
>
> ===================
> ...
> #define current get_current()
> ...
> ===================
>
> Try to remove module:
>
> romanu:/current # rmmod current
> ERROR: Module current does not exist in /proc/modules
> romanu:/current # rmmod -v "get_current()"
> rmmod get_current(), wait=no
> romanu:/current #
>
> I can't remove module with 'rmmod current',
> but can with
> rmmod "get_current()"
>
> Is it a bug?

Yes, it's a bug. But it's a bad idea too to use well known kernel
symbols as module names.
--
Coywolf Qi Hunt
http://sosdg.org/~coywolf/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-09-19 13:35    [W:0.177 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site