<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/module.c, branch v3.8</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v3.8</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v3.8'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2013-01-21T04:22:58Z</updated>
<entry>
<title>module: fix missing module_mutex unlock</title>
<updated>2013-01-21T04:22:58Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2013-01-21T04:22:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ee61abb3223e28a1a14a8429c0319755d20d3e40'/>
<id>urn:sha1:ee61abb3223e28a1a14a8429c0319755d20d3e40</id>
<content type='text'>
Commit 1fb9341ac348 ("module: put modules in list much earlier") moved
some of the module initialization code around, and in the process
changed the exit paths too.  But for the duplicate export symbol error
case the change made the ddebug_cleanup path jump to after the module
mutex unlock, even though it happens with the mutex held.

Rusty has some patches to split this function up into some helper
functions, hopefully the mess of complex goto targets will go away
eventually.

Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Cc: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux</title>
<updated>2013-01-21T00:44:28Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2013-01-21T00:44:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=226364766f936d249e408de03821468c1bf11dda'/>
<id>urn:sha1:226364766f936d249e408de03821468c1bf11dda</id>
<content type='text'>
Pull module fixes and a virtio block fix from Rusty Russell:
 "Various minor fixes, but a slightly more complex one to fix the
  per-cpu overload problem introduced recently by kvm id changes."

* tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
  module: put modules in list much earlier.
  module: add new state MODULE_STATE_UNFORMED.
  module: prevent warning when finit_module a 0 sized file
  virtio-blk: Don't free ida when disk is in use
</content>
</entry>
<entry>
<title>module, async: async_synchronize_full() on module init iff async is used</title>
<updated>2013-01-16T17:05:33Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2013-01-16T02:52:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=774a1221e862b343388347bac9b318767336b20b'/>
<id>urn:sha1:774a1221e862b343388347bac9b318767336b20b</id>
<content type='text'>
If the default iosched is built as module, the kernel may deadlock
while trying to load the iosched module on device probe if the probing
was running off async.  This is because async_synchronize_full() at
the end of module init ends up waiting for the async job which
initiated the module loading.

 async A				modprobe

 1. finds a device
 2. registers the block device
 3. request_module(default iosched)
					4. modprobe in userland
					5. load and init module
					6. async_synchronize_full()

Async A waits for modprobe to finish in request_module() and modprobe
waits for async A to finish in async_synchronize_full().

Because there's no easy to track dependency once control goes out to
userland, implementing properly nested flushing is difficult.  For
now, make module init perform async_synchronize_full() iff module init
has queued async jobs as suggested by Linus.

This avoids the described deadlock because iosched module doesn't use
async and thus wouldn't invoke async_synchronize_full().  This is
hacky and incomplete.  It will deadlock if async module loading nests;
however, this works around the known problem case and seems to be the
best of bad options.

For more details, please refer to the following thread.

  http://thread.gmane.org/gmane.linux.kernel/1420814

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Reported-by: Alex Riesen &lt;raa.lkml@gmail.com&gt;
Tested-by: Ming Lei &lt;ming.lei@canonical.com&gt;
Tested-by: Alex Riesen &lt;raa.lkml@gmail.com&gt;
Cc: Arjan van de Ven &lt;arjan@linux.intel.com&gt;
Cc: Jens Axboe &lt;axboe@kernel.dk&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>module: put modules in list much earlier.</title>
<updated>2013-01-12T02:57:46Z</updated>
<author>
<name>Rusty Russell</name>
<email>rusty@rustcorp.com.au</email>
</author>
<published>2013-01-12T02:57:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1fb9341ac34825aa40354e74d9a2c69df7d2c304'/>
<id>urn:sha1:1fb9341ac34825aa40354e74d9a2c69df7d2c304</id>
<content type='text'>
Prarit's excellent bug report:
&gt; In recent Fedora releases (F17 &amp; F18) some users have reported seeing
&gt; messages similar to
&gt;
&gt; [   15.478160] kvm: Could not allocate 304 bytes percpu data
&gt; [   15.478174] PERCPU: allocation failed, size=304 align=32, alloc from
&gt; reserved chunk failed
&gt;
&gt; during system boot.  In some cases, users have also reported seeing this
&gt; message along with a failed load of other modules.
&gt;
&gt; What is happening is systemd is loading an instance of the kvm module for
&gt; each cpu found (see commit e9bda3b).  When the module load occurs the kernel
&gt; currently allocates the modules percpu data area prior to checking to see
&gt; if the module is already loaded or is in the process of being loaded.  If
&gt; the module is already loaded, or finishes load, the module loading code
&gt; releases the current instance's module's percpu data.

Now we have a new state MODULE_STATE_UNFORMED, we can insert the
module into the list (and thus guarantee its uniqueness) before we
allocate the per-cpu region.

Reported-by: Prarit Bhargava &lt;prarit@redhat.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Tested-by: Prarit Bhargava &lt;prarit@redhat.com&gt;
</content>
</entry>
<entry>
<title>module: add new state MODULE_STATE_UNFORMED.</title>
<updated>2013-01-12T02:57:05Z</updated>
<author>
<name>Rusty Russell</name>
<email>rusty@rustcorp.com.au</email>
</author>
<published>2013-01-12T01:08:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0d21b0e3477395e7ff2acc269f15df6e6a8d356d'/>
<id>urn:sha1:0d21b0e3477395e7ff2acc269f15df6e6a8d356d</id>
<content type='text'>
You should never look at such a module, so it's excised from all paths
which traverse the modules list.

We add the state at the end, to avoid gratuitous ABI break (ksplice).

Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
</entry>
<entry>
<title>module: prevent warning when finit_module a 0 sized file</title>
<updated>2013-01-03T00:40:32Z</updated>
<author>
<name>Sasha Levin</name>
<email>sasha.levin@oracle.com</email>
</author>
<published>2013-01-03T00:39:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=52441fa8f2f1ccc9fa97607c6ccf8b46b9fd15ae'/>
<id>urn:sha1:52441fa8f2f1ccc9fa97607c6ccf8b46b9fd15ae</id>
<content type='text'>
If we try to finit_module on a file sized 0 bytes vmalloc will
scream and spit out a warning.

Since modules have to be bigger than 0 bytes anyways we can just
check that beforehand and avoid the warning.

Signed-off-by: Sasha Levin &lt;sasha.levin@oracle.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
</entry>
<entry>
<title>Merge tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux</title>
<updated>2012-12-19T15:55:08Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2012-12-19T15:55:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7a684c452e2589f3ddd7e2d466b4f747d3715ad9'/>
<id>urn:sha1:7a684c452e2589f3ddd7e2d466b4f747d3715ad9</id>
<content type='text'>
Pull module update from Rusty Russell:
 "Nothing all that exciting; a new module-from-fd syscall for those who
  want to verify the source of the module (ChromeOS) and/or use standard
  IMA on it or other security hooks."

* tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
  MODSIGN: Fix kbuild output when using default extra_certificates
  MODSIGN: Avoid using .incbin in C source
  modules: don't hand 0 to vmalloc.
  module: Remove a extra null character at the top of module-&gt;strtab.
  ASN.1: Use the ASN1_LONG_TAG and ASN1_INDEFINITE_LENGTH constants
  ASN.1: Define indefinite length marker constant
  moduleparam: use __UNIQUE_ID()
  __UNIQUE_ID()
  MODSIGN: Add modules_sign make target
  powerpc: add finit_module syscall.
  ima: support new kernel module syscall
  add finit_module syscall to asm-generic
  ARM: add finit_module syscall to ARM
  security: introduce kernel_module_from_file hook
  module: add flags arg to sys_finit_module()
  module: add syscall to load module from fd
</content>
</entry>
<entry>
<title>kernel: remove reference to feature-removal-schedule.txt</title>
<updated>2012-12-18T01:15:12Z</updated>
<author>
<name>Tao Ma</name>
<email>boyu.mt@taobao.com</email>
</author>
<published>2012-12-17T23:59:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8ec7d50f1ed2b072d23ce810f86df09ee0568d4b'/>
<id>urn:sha1:8ec7d50f1ed2b072d23ce810f86df09ee0568d4b</id>
<content type='text'>
In commit 9c0ece069b32 ("Get rid of Documentation/feature-removal.txt"),
Linus removed feature-removal-schedule.txt from Documentation, but there
is still some reference to this file.  So remove them.

Signed-off-by: Tao Ma &lt;boyu.mt@taobao.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>modules: don't hand 0 to vmalloc.</title>
<updated>2012-12-14T02:36:43Z</updated>
<author>
<name>Rusty Russell</name>
<email>rusty@rustcorp.com.au</email>
</author>
<published>2012-12-10T23:08:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=82fab442f5322b016f72891c0db2436c6a6c20b7'/>
<id>urn:sha1:82fab442f5322b016f72891c0db2436c6a6c20b7</id>
<content type='text'>
In commit d0a21265dfb5fa8a David Rientjes unified various archs'
module_alloc implementation (including x86) and removed the graduitous
shortcut for size == 0.

Then, in commit de7d2b567d040e3b, Joe Perches added a warning for
zero-length vmallocs, which can happen without kallsyms on modules
with no init sections (eg. zlib_deflate).

Fix this once and for all; the module code has to handle zero length
anyway, so get it right at the caller and remove the now-gratuitous
checks within the arch-specific module_alloc implementations.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=42608
Reported-by: Conrad Kostecki &lt;ConiKost@gmx.de&gt;
Cc: David Rientjes &lt;rientjes@google.com&gt;
Cc: Joe Perches &lt;joe@perches.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
</entry>
<entry>
<title>module: Remove a extra null character at the top of module-&gt;strtab.</title>
<updated>2012-12-14T02:36:43Z</updated>
<author>
<name>Satoru Takeuchi</name>
<email>takeuchi_satoru@jp.fujitsu.com</email>
</author>
<published>2012-12-05T01:59:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=54523ec71f8ce99accae97c74152f14f261f7e18'/>
<id>urn:sha1:54523ec71f8ce99accae97c74152f14f261f7e18</id>
<content type='text'>
There is a extra null character('\0') at the top of module-&gt;strtab for
each module. Commit 59ef28b introduced this bug and this patch fixes it.

Live dump log of the current linus git kernel(HEAD is 2844a4870):
============================================================================
crash&gt; mod | grep loop
ffffffffa01db0a0  loop             16689  (not loaded)  [CONFIG_KALLSYMS]
crash&gt; module.core_symtab ffffffffa01db0a0
  core_symtab = 0xffffffffa01db320crash&gt; rd 0xffffffffa01db320 12
ffffffffa01db320:  0000005500000001 0000000000000000   ....U...........
ffffffffa01db330:  0000000000000000 0002007400000002   ............t...
ffffffffa01db340:  ffffffffa01d8000 0000000000000038   ........8.......
ffffffffa01db350:  001a00640000000e ffffffffa01daeb0   ....d...........
ffffffffa01db360:  00000000000000a0 0002007400000019   ............t...
ffffffffa01db370:  ffffffffa01d8068 000000000000001b   h...............
crash&gt; module.core_strtab ffffffffa01db0a0
  core_strtab = 0xffffffffa01dbb30 ""
crash&gt; rd 0xffffffffa01dbb30 4
ffffffffa01dbb30:  615f70616d6b0000 66780063696d6f74   ..kmap_atomic.xf
ffffffffa01dbb40:  73636e75665f7265 72665f646e696600   er_funcs.find_fr
============================================================================

We expect Just first one byte of '\0', but actually first two bytes
are '\0'. Here is The relationship between symtab and strtab.

	symtab_idx	strtab_idx	symbol
	-----------------------------------------------
	0		0x1		"\0" # startab_idx should be 0
	1		0x2		"kmap_atomic"
	2		0xe		"xfer_funcs"
	3		0x19		"find_fr..."

By applying this patch, it becomes as follows.

	symtab_idx	strtab_idx	symbol
	-----------------------------------------------
	0		0x0		"\0"	# extra byte is removed
	1		0x1		"kmap_atomic"
	2		0xd		"xfer_funcs"
	3		0x18		"find_fr..."

Signed-off-by: Satoru Takeuchi &lt;takeuchi_satoru@jp.fujitsu.com&gt;
Cc: Masaki Kimura &lt;masaki.kimura.kz@hitachi.com&gt;
Cc: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
</entry>
</feed>
