public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [Bugme-new] [Bug 8957] New: Exported functions and variables
@ 2007-08-30 17:44 Matti Linnanvuori
  2007-08-31 16:06 ` Satyam Sharma
  0 siblings, 1 reply; 7+ messages in thread
From: Matti Linnanvuori @ 2007-08-30 17:44 UTC (permalink / raw)
  To: linux-kernel; +Cc: bugme-daemon

I thought I had seen that bug. Module init function execution does not seem serialized enough, so the init function of one module seems to be able to be called in parallel with several other modules in turn being loaded, executing their init functions and even becoming live first class citizens.
Function sys_init_module in 
Linux 2.6.22.x and 2.6.23-rc4 kernel/module.c does not hold module_mutex when executing the init functions of the modules.




      __________________________________  
Alles was der Gesundheit und Entspannung dient. BE A BETTER MEDIZINMANN! www.yahoo.de/clever

^ permalink raw reply	[flat|nested] 7+ messages in thread
* [Bugme-new] [Bug 8957] New: Exported functions and variables
@ 2007-08-31 17:14 Matti Linnanvuori
  2007-08-31 17:28 ` Arjan van de Ven
  2007-08-31 23:49 ` Satyam Sharma
  0 siblings, 2 replies; 7+ messages in thread
From: Matti Linnanvuori @ 2007-08-31 17:14 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: bugme-daemon

It seems to me that kernel/module.c allows the whole kernel to use exported symbols during the execution of the init function if they are weak:
                        /* Ok if weak.  */
                          if (ELF_ST_BIND(sym[i].st_info) == STB_WEAK)
                                  break;
That seems a possible way to produce the scenario of this so-called bug.



      ________ 
Yahoo! Clever: Stellen Sie Fragen und finden Sie Antworten. Teilen Sie Ihr Wissen. www.yahoo.de/clever


^ permalink raw reply	[flat|nested] 7+ messages in thread
* [Bugme-new] [Bug 8957] New: Exported functions and variables
@ 2007-08-30 16:41 Matti Linnanvuori
  2007-08-30 16:56 ` Arjan van de Ven
  0 siblings, 1 reply; 7+ messages in thread
From: Matti Linnanvuori @ 2007-08-30 16:41 UTC (permalink / raw)
  To: linux-kernel; +Cc: bugme-daemon

I thought that the bug might happen when two kernel modules are being loaded. If module A is loaded and its code includes references to functions exported by module B, I thought module A could call those functions before the module_init function of module B has finished. I was not thinking about buggy calls to registering interface functions. I just thought that the kernel should not allow symbols exported by   EXPORT_SYMBOLto be visible to other modules before the module_init function is finished. One could code the exported functions so that they could be safely called by anyone while the module_init function is being called but that would be an unnecessary burden for coders. I think that a module should expose its functions and variables only by calling registering interface  functions before the module_init function is finished. So I think the design of the kernel modules is flawed if it allows anyone to call exported functions before the module_init
 function is finished.




      Heute schon einen Blick in die Zukunft von E-Mails wagen? Versuchen Sie´s mit dem neuen Yahoo! Mail. www.yahoo.de/mail

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-08-31 23:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-30 17:44 [Bugme-new] [Bug 8957] New: Exported functions and variables Matti Linnanvuori
2007-08-31 16:06 ` Satyam Sharma
  -- strict thread matches above, loose matches on Subject: below --
2007-08-31 17:14 Matti Linnanvuori
2007-08-31 17:28 ` Arjan van de Ven
2007-08-31 23:49 ` Satyam Sharma
2007-08-30 16:41 Matti Linnanvuori
2007-08-30 16:56 ` Arjan van de Ven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox