<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/module.c, branch v3.12</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.12</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v3.12'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2013-09-05T15:50:26Z</updated>
<entry>
<title>Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs</title>
<updated>2013-09-05T15:50:26Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2013-09-05T15:50:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=45d9a2220f6004b47c362cc7fc7cf9a73cb6353a'/>
<id>urn:sha1:45d9a2220f6004b47c362cc7fc7cf9a73cb6353a</id>
<content type='text'>
Pull vfs pile 1 from Al Viro:
 "Unfortunately, this merge window it'll have a be a lot of small piles -
  my fault, actually, for not keeping #for-next in anything that would
  resemble a sane shape ;-/

  This pile: assorted fixes (the first 3 are -stable fodder, IMO) and
  cleanups + %pd/%pD formats (dentry/file pathname, up to 4 last
  components) + several long-standing patches from various folks.

  There definitely will be a lot more (starting with Miklos'
  check_submount_and_drop() series)"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (26 commits)
  direct-io: Handle O_(D)SYNC AIO
  direct-io: Implement generic deferred AIO completions
  add formats for dentry/file pathnames
  kvm eventfd: switch to fdget
  powerpc kvm: use fdget
  switch fchmod() to fdget
  switch epoll_ctl() to fdget
  switch copy_module_from_fd() to fdget
  git simplify nilfs check for busy subtree
  ibmasmfs: don't bother passing superblock when not needed
  don't pass superblock to hypfs_{mkdir,create*}
  don't pass superblock to hypfs_diag_create_files
  don't pass superblock to hypfs_vm_create_files()
  oprofile: get rid of pointless forward declarations of struct super_block
  oprofilefs_create_...() do not need superblock argument
  oprofilefs_mkdir() doesn't need superblock argument
  don't bother with passing superblock to oprofile_create_stats_files()
  oprofile: don't bother with passing superblock to -&gt;create_files()
  don't bother passing sb to oprofile_create_files()
  coh901318: don't open-code simple_read_from_buffer()
  ...
</content>
</entry>
<entry>
<title>switch copy_module_from_fd() to fdget</title>
<updated>2013-09-04T03:04:44Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2013-08-30T16:41:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a2e0578be3652406b2ffd2eeb31cdbdffa325d64'/>
<id>urn:sha1:a2e0578be3652406b2ffd2eeb31cdbdffa325d64</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>module: Fix mod-&gt;mkobj.kobj potentially freed too early</title>
<updated>2013-09-03T07:05:47Z</updated>
<author>
<name>Li Zhong</name>
<email>zhong@linux.vnet.ibm.com</email>
</author>
<published>2013-09-03T07:03:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=942e443127e928a5631c3d5102aca8c8b3c2dd98'/>
<id>urn:sha1:942e443127e928a5631c3d5102aca8c8b3c2dd98</id>
<content type='text'>
DEBUG_KOBJECT_RELEASE helps to find the issue attached below.

After some investigation, it seems the reason is:
The mod-&gt;mkobj.kobj(ffffffffa01600d0 below) is freed together with mod
itself in free_module(). However, its children still hold references to
it, as the delay caused by DEBUG_KOBJECT_RELEASE. So when the
child(holders below) tries to decrease the reference count to its parent
in kobject_del(), BUG happens as it tries to access already freed memory.

This patch tries to fix it by waiting for the mod-&gt;mkobj.kobj to be
really released in the module removing process (and some error code
paths).

[ 1844.175287] kobject: 'holders' (ffff88007c1f1600): kobject_release, parent ffffffffa01600d0 (delayed)
[ 1844.178991] kobject: 'notes' (ffff8800370b2a00): kobject_release, parent ffffffffa01600d0 (delayed)
[ 1845.180118] kobject: 'holders' (ffff88007c1f1600): kobject_cleanup, parent ffffffffa01600d0
[ 1845.182130] kobject: 'holders' (ffff88007c1f1600): auto cleanup kobject_del
[ 1845.184120] BUG: unable to handle kernel paging request at ffffffffa01601d0
[ 1845.185026] IP: [&lt;ffffffff812cda81&gt;] kobject_put+0x11/0x60
[ 1845.185026] PGD 1a13067 PUD 1a14063 PMD 7bd30067 PTE 0
[ 1845.185026] Oops: 0000 [#1] PREEMPT
[ 1845.185026] Modules linked in: xfs libcrc32c [last unloaded: kprobe_example]
[ 1845.185026] CPU: 0 PID: 18 Comm: kworker/0:1 Tainted: G           O 3.11.0-rc6-next-20130819+ #1
[ 1845.185026] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2007
[ 1845.185026] Workqueue: events kobject_delayed_cleanup
[ 1845.185026] task: ffff88007ca51f00 ti: ffff88007ca5c000 task.ti: ffff88007ca5c000
[ 1845.185026] RIP: 0010:[&lt;ffffffff812cda81&gt;]  [&lt;ffffffff812cda81&gt;] kobject_put+0x11/0x60
[ 1845.185026] RSP: 0018:ffff88007ca5dd08  EFLAGS: 00010282
[ 1845.185026] RAX: 0000000000002000 RBX: ffffffffa01600d0 RCX: ffffffff8177d638
[ 1845.185026] RDX: ffff88007ca5dc18 RSI: 0000000000000000 RDI: ffffffffa01600d0
[ 1845.185026] RBP: ffff88007ca5dd18 R08: ffffffff824e9810 R09: ffffffffffffffff
[ 1845.185026] R10: ffff8800ffffffff R11: dead4ead00000001 R12: ffffffff81a95040
[ 1845.185026] R13: ffff88007b27a960 R14: ffff88007c1f1600 R15: 0000000000000000
[ 1845.185026] FS:  0000000000000000(0000) GS:ffffffff81a23000(0000) knlGS:0000000000000000
[ 1845.185026] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[ 1845.185026] CR2: ffffffffa01601d0 CR3: 0000000037207000 CR4: 00000000000006b0
[ 1845.185026] Stack:
[ 1845.185026]  ffff88007c1f1600 ffff88007c1f1600 ffff88007ca5dd38 ffffffff812cdb7e
[ 1845.185026]  0000000000000000 ffff88007c1f1640 ffff88007ca5dd68 ffffffff812cdbfe
[ 1845.185026]  ffff88007c974800 ffff88007c1f1640 ffff88007ff61a00 0000000000000000
[ 1845.185026] Call Trace:
[ 1845.185026]  [&lt;ffffffff812cdb7e&gt;] kobject_del+0x2e/0x40
[ 1845.185026]  [&lt;ffffffff812cdbfe&gt;] kobject_delayed_cleanup+0x6e/0x1d0
[ 1845.185026]  [&lt;ffffffff81063a45&gt;] process_one_work+0x1e5/0x670
[ 1845.185026]  [&lt;ffffffff810639e3&gt;] ? process_one_work+0x183/0x670
[ 1845.185026]  [&lt;ffffffff810642b3&gt;] worker_thread+0x113/0x370
[ 1845.185026]  [&lt;ffffffff810641a0&gt;] ? rescuer_thread+0x290/0x290
[ 1845.185026]  [&lt;ffffffff8106bfba&gt;] kthread+0xda/0xe0
[ 1845.185026]  [&lt;ffffffff814ff0f0&gt;] ? _raw_spin_unlock_irq+0x30/0x60
[ 1845.185026]  [&lt;ffffffff8106bee0&gt;] ? kthread_create_on_node+0x130/0x130
[ 1845.185026]  [&lt;ffffffff8150751a&gt;] ret_from_fork+0x7a/0xb0
[ 1845.185026]  [&lt;ffffffff8106bee0&gt;] ? kthread_create_on_node+0x130/0x130
[ 1845.185026] Code: 81 48 c7 c7 28 95 ad 81 31 c0 e8 9b da 01 00 e9 4f ff ff ff 66 0f 1f 44 00 00 55 48 89 e5 53 48 89 fb 48 83 ec 08 48 85 ff 74 1d &lt;f6&gt; 87 00 01 00 00 01 74 1e 48 8d 7b 38 83 6b 38 01 0f 94 c0 84
[ 1845.185026] RIP  [&lt;ffffffff812cda81&gt;] kobject_put+0x11/0x60
[ 1845.185026]  RSP &lt;ffff88007ca5dd08&gt;
[ 1845.185026] CR2: ffffffffa01601d0
[ 1845.185026] ---[ end trace 49a70afd109f5653 ]---

Signed-off-by: Li Zhong &lt;zhong@linux.vnet.ibm.com&gt;
Acked-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
</entry>
<entry>
<title>kernel/module.c: use scnprintf() instead of sprintf()</title>
<updated>2013-08-20T06:07:46Z</updated>
<author>
<name>Chen Gang</name>
<email>gang.chen@asianux.com</email>
</author>
<published>2013-08-20T06:04:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cc56ded3fdd365e07e03315379ee6612a68fd817'/>
<id>urn:sha1:cc56ded3fdd365e07e03315379ee6612a68fd817</id>
<content type='text'>
For some strings, they are permitted to be larger than PAGE_SIZE, so
need use scnprintf() instead of sprintf(), or it will cause issue.

One case is:

  if a module version is crazy defined (length more than PAGE_SIZE),
  'modinfo' command is still OK (print full contents),
  but for "cat /sys/modules/'modname'/version", will cause issue in kernel.

Signed-off-by: Chen Gang &lt;gang.chen@asianux.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
</entry>
<entry>
<title>module: Add NOARG flag for ops with param_set_bool_enable_only() set function</title>
<updated>2013-08-20T06:07:43Z</updated>
<author>
<name>Steven Rostedt</name>
<email>rostedt@goodmis.org</email>
</author>
<published>2013-08-20T06:03:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0ce814096f388f6801587f01c1c5ee1d04e746b3'/>
<id>urn:sha1:0ce814096f388f6801587f01c1c5ee1d04e746b3</id>
<content type='text'>
The ops that uses param_set_bool_enable_only() as its set function can
easily handle being used without an argument. There's no reason to
fail the loading of the module if it does not have one.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&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>2013-07-10T21:51:41Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2013-07-10T21:51:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8133633368760656c76b8302dbd4bfa20f887df6'/>
<id>urn:sha1:8133633368760656c76b8302dbd4bfa20f887df6</id>
<content type='text'>
Pull module updates from Rusty Russell:
 "Nothing interesting.  Except the most embarrassing bugfix ever.  But
  let's ignore that"

* tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
  module: cleanup call chain.
  module: do percpu allocation after uniqueness check.  No, really!
  modules: don't fail to load on unknown parameters.
  ABI: Clarify when /sys/module/MODULENAME is created
  There is no /sys/parameters
  module: don't modify argument of module_kallsyms_lookup_name()
</content>
</entry>
<entry>
<title>module: cleanup call chain.</title>
<updated>2013-07-03T00:45:10Z</updated>
<author>
<name>Rusty Russell</name>
<email>rusty@rustcorp.com.au</email>
</author>
<published>2013-07-03T00:36:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9eb76d7797b892a1dad4f2efb6f786681306dd13'/>
<id>urn:sha1:9eb76d7797b892a1dad4f2efb6f786681306dd13</id>
<content type='text'>
Fold alloc_module_percpu into percpu_modalloc().

Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
</entry>
<entry>
<title>module: do percpu allocation after uniqueness check.  No, really!</title>
<updated>2013-07-03T00:45:09Z</updated>
<author>
<name>Rusty Russell</name>
<email>rusty@rustcorp.com.au</email>
</author>
<published>2013-07-03T00:36:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8d8022e8aba85192e937f1f0f7450e256d66ae5c'/>
<id>urn:sha1:8d8022e8aba85192e937f1f0f7450e256d66ae5c</id>
<content type='text'>
v3.8-rc1-5-g1fb9341 was supposed to stop parallel kvm loads exhausting
percpu memory on large machines:

    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.

In my defence, it didn't actually say the patch did this.  Just that
we "can".

This patch actually *does* it.

Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Tested-by: Jim Hull &lt;jim.hull@hp.com&gt;
Cc: stable@kernel.org # 3.8
</content>
</entry>
<entry>
<title>modules: don't fail to load on unknown parameters.</title>
<updated>2013-07-02T06:08:21Z</updated>
<author>
<name>Rusty Russell</name>
<email>rusty@rustcorp.com.au</email>
</author>
<published>2013-07-02T06:05:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=54041d8a73337411b485ff76957fb106cb5d40d0'/>
<id>urn:sha1:54041d8a73337411b485ff76957fb106cb5d40d0</id>
<content type='text'>
Although parameters are supposed to be part of the kernel API, experimental
parameters are often removed.  In addition, downgrading a kernel might cause
previously-working modules to fail to load.

On balance, it's probably better to warn, and load the module anyway.
This may let through a typo, but at least the logs will show it.

Reported-by: Andy Lutomirski &lt;luto@amacapital.net&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
</entry>
<entry>
<title>module: don't modify argument of module_kallsyms_lookup_name()</title>
<updated>2013-07-02T06:08:18Z</updated>
<author>
<name>Mathias Krause</name>
<email>minipli@googlemail.com</email>
</author>
<published>2013-07-02T06:05:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4f6de4d51f4a3ab06a85e91e708cc89a513ef30c'/>
<id>urn:sha1:4f6de4d51f4a3ab06a85e91e708cc89a513ef30c</id>
<content type='text'>
If we pass a pointer to a const string in the form "module:symbol"
module_kallsyms_lookup_name() will try to split the string at the colon,
i.e., will try to modify r/o data. That will, in fact, fail on a kernel
with enabled CONFIG_DEBUG_RODATA.

Avoid modifying the passed string in module_kallsyms_lookup_name(),
modify find_module_all() instead to pass it the module name length.

Signed-off-by: Mathias Krause &lt;minipli@googlemail.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
</entry>
</feed>
