public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Coywolf Qi Hunt <coywolf@gmail.com>
To: Ustyugov Roman <dr_unique@ymg.ru>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [BUG] module-init-tools
Date: Mon, 19 Sep 2005 19:30:19 +0800	[thread overview]
Message-ID: <2cd57c90050919043041ed5cc@mail.gmail.com> (raw)
In-Reply-To: <200509191432.58736.dr_unique@ymg.ru>

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/

  reply	other threads:[~2005-09-19 11:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-19 10:32 [BUG] module-init-tools Ustyugov Roman
2005-09-19 11:30 ` Coywolf Qi Hunt [this message]
2005-09-19 11:54   ` Ustyugov Roman
2005-09-19 13:21 ` Coywolf Qi Hunt
     [not found] ` <3b8510d8050920000560aeb39e@mail.gmail.com>
     [not found]   ` <3b8510d805092000116c6a9c33@mail.gmail.com>
2005-09-20  7:24     ` Ustyugov Roman
     [not found]       ` <3b8510d8050920002661c08f48@mail.gmail.com>
     [not found]         ` <3b8510d805092000346c27270f@mail.gmail.com>
2005-09-20  7:43           ` Thayumanavar Sachithanantham
2005-09-20  8:13             ` [BUG] kbuild Ustyugov Roman
2005-09-20  8:51               ` Thayumanavar Sachithanantham
2005-09-20  9:32                 ` [PATCH] kbuild: using well known kernel symbols as module names Ustyugov Roman
2005-09-20  9:32                   ` Thayumanavar Sachithanantham

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=2cd57c90050919043041ed5cc@mail.gmail.com \
    --to=coywolf@gmail.com \
    --cc=dr_unique@ymg.ru \
    --cc=linux-kernel@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