<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/kernel/kprobes.c, branch linux-2.6.27.y</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>kprobes: Fix locking imbalance in kretprobes</title>
<updated>2009-05-02T17:24:37+00:00</updated>
<author>
<name>Ananth N Mavinakayanahalli</name>
<email>ananth@in.ibm.com</email>
</author>
<published>2009-03-18T11:36:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=e2627e220fe64f2a7e501b512719e7b7be73466b'/>
<id>e2627e220fe64f2a7e501b512719e7b7be73466b</id>
<content type='text'>
commit f02b8624fedca39886b0eef770dca70c2f0749b3 upstream.

Fix locking imbalance in kretprobes:

=====================================
[ BUG: bad unlock balance detected! ]
-------------------------------------
kthreadd/2 is trying to release lock (&amp;rp-&gt;lock) at:
[&lt;c06b3080&gt;] pre_handler_kretprobe+0xea/0xf4
but there are no more locks to release!

other info that might help us debug this:
1 lock held by kthreadd/2:
 #0:  (rcu_read_lock){..--}, at: [&lt;c06b2b24&gt;] __atomic_notifier_call_chain+0x0/0x5a

stack backtrace:
Pid: 2, comm: kthreadd Not tainted 2.6.29-rc8 #1
Call Trace:
 [&lt;c06ae498&gt;] ? printk+0xf/0x17
 [&lt;c06b3080&gt;] ? pre_handler_kretprobe+0xea/0xf4
 [&lt;c044ce6c&gt;] print_unlock_inbalance_bug+0xc3/0xce
 [&lt;c0444d4b&gt;] ? clocksource_read+0x7/0xa
 [&lt;c04450a4&gt;] ? getnstimeofday+0x5f/0xf6
 [&lt;c044a9ca&gt;] ? register_lock_class+0x17/0x293
 [&lt;c044b72c&gt;] ? mark_lock+0x1e/0x30b
 [&lt;c0448956&gt;] ? tick_dev_program_event+0x4a/0xbc
 [&lt;c0498100&gt;] ? __slab_alloc+0xa5/0x415
 [&lt;c06b2fbe&gt;] ? pre_handler_kretprobe+0x28/0xf4
 [&lt;c06b3080&gt;] ? pre_handler_kretprobe+0xea/0xf4
 [&lt;c044cf1b&gt;] lock_release_non_nested+0xa4/0x1a5
 [&lt;c06b3080&gt;] ? pre_handler_kretprobe+0xea/0xf4
 [&lt;c044d15d&gt;] lock_release+0x141/0x166
 [&lt;c06b07dd&gt;] _spin_unlock_irqrestore+0x19/0x50
 [&lt;c06b3080&gt;] pre_handler_kretprobe+0xea/0xf4
 [&lt;c06b20b5&gt;] kprobe_exceptions_notify+0x1c9/0x43e
 [&lt;c06b2b02&gt;] notifier_call_chain+0x26/0x48
 [&lt;c06b2b5b&gt;] __atomic_notifier_call_chain+0x37/0x5a
 [&lt;c06b2b24&gt;] ? __atomic_notifier_call_chain+0x0/0x5a
 [&lt;c06b2b8a&gt;] atomic_notifier_call_chain+0xc/0xe
 [&lt;c0442d0d&gt;] notify_die+0x2d/0x2f
 [&lt;c06b0f9c&gt;] do_int3+0x1f/0x71
 [&lt;c06b0e84&gt;] int3+0x2c/0x34
 [&lt;c042d476&gt;] ? do_fork+0x1/0x288
 [&lt;c040221b&gt;] ? kernel_thread+0x71/0x79
 [&lt;c043ed1b&gt;] ? kthread+0x0/0x60
 [&lt;c043ed1b&gt;] ? kthread+0x0/0x60
 [&lt;c04040b8&gt;] ? kernel_thread_helper+0x0/0x10
 [&lt;c043ec7f&gt;] kthreadd+0xac/0x148
 [&lt;c043ebd3&gt;] ? kthreadd+0x0/0x148
 [&lt;c04040bf&gt;] kernel_thread_helper+0x7/0x10

Signed-off-by: Ananth N Mavinakayanahalli &lt;ananth@in.ibm.com&gt;
Tested-by: Bharata B Rao &lt;bharata@linux.vnet.ibm.com&gt;
Cc: Masami Hiramatsu &lt;mhiramat@redhat.com&gt;
Cc: Jim Keniston &lt;jkenisto@us.ibm.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
LKML-Reference: &lt;20090318113621.GB4129@in.ibm.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit f02b8624fedca39886b0eef770dca70c2f0749b3 upstream.

Fix locking imbalance in kretprobes:

=====================================
[ BUG: bad unlock balance detected! ]
-------------------------------------
kthreadd/2 is trying to release lock (&amp;rp-&gt;lock) at:
[&lt;c06b3080&gt;] pre_handler_kretprobe+0xea/0xf4
but there are no more locks to release!

other info that might help us debug this:
1 lock held by kthreadd/2:
 #0:  (rcu_read_lock){..--}, at: [&lt;c06b2b24&gt;] __atomic_notifier_call_chain+0x0/0x5a

stack backtrace:
Pid: 2, comm: kthreadd Not tainted 2.6.29-rc8 #1
Call Trace:
 [&lt;c06ae498&gt;] ? printk+0xf/0x17
 [&lt;c06b3080&gt;] ? pre_handler_kretprobe+0xea/0xf4
 [&lt;c044ce6c&gt;] print_unlock_inbalance_bug+0xc3/0xce
 [&lt;c0444d4b&gt;] ? clocksource_read+0x7/0xa
 [&lt;c04450a4&gt;] ? getnstimeofday+0x5f/0xf6
 [&lt;c044a9ca&gt;] ? register_lock_class+0x17/0x293
 [&lt;c044b72c&gt;] ? mark_lock+0x1e/0x30b
 [&lt;c0448956&gt;] ? tick_dev_program_event+0x4a/0xbc
 [&lt;c0498100&gt;] ? __slab_alloc+0xa5/0x415
 [&lt;c06b2fbe&gt;] ? pre_handler_kretprobe+0x28/0xf4
 [&lt;c06b3080&gt;] ? pre_handler_kretprobe+0xea/0xf4
 [&lt;c044cf1b&gt;] lock_release_non_nested+0xa4/0x1a5
 [&lt;c06b3080&gt;] ? pre_handler_kretprobe+0xea/0xf4
 [&lt;c044d15d&gt;] lock_release+0x141/0x166
 [&lt;c06b07dd&gt;] _spin_unlock_irqrestore+0x19/0x50
 [&lt;c06b3080&gt;] pre_handler_kretprobe+0xea/0xf4
 [&lt;c06b20b5&gt;] kprobe_exceptions_notify+0x1c9/0x43e
 [&lt;c06b2b02&gt;] notifier_call_chain+0x26/0x48
 [&lt;c06b2b5b&gt;] __atomic_notifier_call_chain+0x37/0x5a
 [&lt;c06b2b24&gt;] ? __atomic_notifier_call_chain+0x0/0x5a
 [&lt;c06b2b8a&gt;] atomic_notifier_call_chain+0xc/0xe
 [&lt;c0442d0d&gt;] notify_die+0x2d/0x2f
 [&lt;c06b0f9c&gt;] do_int3+0x1f/0x71
 [&lt;c06b0e84&gt;] int3+0x2c/0x34
 [&lt;c042d476&gt;] ? do_fork+0x1/0x288
 [&lt;c040221b&gt;] ? kernel_thread+0x71/0x79
 [&lt;c043ed1b&gt;] ? kthread+0x0/0x60
 [&lt;c043ed1b&gt;] ? kthread+0x0/0x60
 [&lt;c04040b8&gt;] ? kernel_thread_helper+0x0/0x10
 [&lt;c043ec7f&gt;] kthreadd+0xac/0x148
 [&lt;c043ebd3&gt;] ? kthreadd+0x0/0x148
 [&lt;c04040bf&gt;] kernel_thread_helper+0x7/0x10

Signed-off-by: Ananth N Mavinakayanahalli &lt;ananth@in.ibm.com&gt;
Tested-by: Bharata B Rao &lt;bharata@linux.vnet.ibm.com&gt;
Cc: Masami Hiramatsu &lt;mhiramat@redhat.com&gt;
Cc: Jim Keniston &lt;jkenisto@us.ibm.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
LKML-Reference: &lt;20090318113621.GB4129@in.ibm.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>kprobes: remove redundant config check</title>
<updated>2008-07-25T17:53:30+00:00</updated>
<author>
<name>Abhishek Sagar</name>
<email>sagar.abhishek@gmail.com</email>
</author>
<published>2008-07-25T08:46:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=8b6dd986823a8d92ed9f54baa5cef8604d9d9d44'/>
<id>8b6dd986823a8d92ed9f54baa5cef8604d9d9d44</id>
<content type='text'>
I noticed that there's a CONFIG_KPROBES check inside kernel/kprobes.c,
which is redundant.

Signed-off-by: Abhishek Sagar &lt;sagar.abhishek@gmail.com&gt;
Acked-by: Masami Hiramatsu &lt;mhiramat@redhat.com&gt;
Cc: Ananth N Mavinakayanahalli &lt;ananth@in.ibm.com&gt;
Cc: Anil S Keshavamurthy &lt;anil.s.keshavamurthy@intel.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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I noticed that there's a CONFIG_KPROBES check inside kernel/kprobes.c,
which is redundant.

Signed-off-by: Abhishek Sagar &lt;sagar.abhishek@gmail.com&gt;
Acked-by: Masami Hiramatsu &lt;mhiramat@redhat.com&gt;
Cc: Ananth N Mavinakayanahalli &lt;ananth@in.ibm.com&gt;
Cc: Anil S Keshavamurthy &lt;anil.s.keshavamurthy@intel.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kprobes: improve kretprobe scalability with hashed locking</title>
<updated>2008-07-25T17:53:30+00:00</updated>
<author>
<name>Srinivasa D S</name>
<email>srinivasa@in.ibm.com</email>
</author>
<published>2008-07-25T08:46:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=ef53d9c5e4da147ecaa43c44c5e5945eb83970a2'/>
<id>ef53d9c5e4da147ecaa43c44c5e5945eb83970a2</id>
<content type='text'>
Currently list of kretprobe instances are stored in kretprobe object (as
used_instances,free_instances) and in kretprobe hash table.  We have one
global kretprobe lock to serialise the access to these lists.  This causes
only one kretprobe handler to execute at a time.  Hence affects system
performance, particularly on SMP systems and when return probe is set on
lot of functions (like on all systemcalls).

Solution proposed here gives fine-grain locks that performs better on SMP
system compared to present kretprobe implementation.

Solution:

 1) Instead of having one global lock to protect kretprobe instances
    present in kretprobe object and kretprobe hash table.  We will have
    two locks, one lock for protecting kretprobe hash table and another
    lock for kretporbe object.

 2) We hold lock present in kretprobe object while we modify kretprobe
    instance in kretprobe object and we hold per-hash-list lock while
    modifying kretprobe instances present in that hash list.  To prevent
    deadlock, we never grab a per-hash-list lock while holding a kretprobe
    lock.

 3) We can remove used_instances from struct kretprobe, as we can
    track used instances of kretprobe instances using kretprobe hash
    table.

Time duration for kernel compilation ("make -j 8") on a 8-way ppc64 system
with return probes set on all systemcalls looks like this.

cacheline              non-cacheline             Un-patched kernel
aligned patch 	       aligned patch
===============================================================================
real    9m46.784s       9m54.412s                  10m2.450s
user    40m5.715s       40m7.142s                  40m4.273s
sys     2m57.754s       2m58.583s                  3m17.430s
===========================================================

Time duration for kernel compilation ("make -j 8) on the same system, when
kernel is not probed.
=========================
real    9m26.389s
user    40m8.775s
sys     2m7.283s
=========================

Signed-off-by: Srinivasa DS &lt;srinivasa@in.ibm.com&gt;
Signed-off-by: Jim Keniston &lt;jkenisto@us.ibm.com&gt;
Acked-by: Ananth N Mavinakayanahalli &lt;ananth@in.ibm.com&gt;
Cc: Anil S Keshavamurthy &lt;anil.s.keshavamurthy@intel.com&gt;
Cc: David S. Miller &lt;davem@davemloft.net&gt;
Cc: Masami Hiramatsu &lt;mhiramat@redhat.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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently list of kretprobe instances are stored in kretprobe object (as
used_instances,free_instances) and in kretprobe hash table.  We have one
global kretprobe lock to serialise the access to these lists.  This causes
only one kretprobe handler to execute at a time.  Hence affects system
performance, particularly on SMP systems and when return probe is set on
lot of functions (like on all systemcalls).

Solution proposed here gives fine-grain locks that performs better on SMP
system compared to present kretprobe implementation.

Solution:

 1) Instead of having one global lock to protect kretprobe instances
    present in kretprobe object and kretprobe hash table.  We will have
    two locks, one lock for protecting kretprobe hash table and another
    lock for kretporbe object.

 2) We hold lock present in kretprobe object while we modify kretprobe
    instance in kretprobe object and we hold per-hash-list lock while
    modifying kretprobe instances present in that hash list.  To prevent
    deadlock, we never grab a per-hash-list lock while holding a kretprobe
    lock.

 3) We can remove used_instances from struct kretprobe, as we can
    track used instances of kretprobe instances using kretprobe hash
    table.

Time duration for kernel compilation ("make -j 8") on a 8-way ppc64 system
with return probes set on all systemcalls looks like this.

cacheline              non-cacheline             Un-patched kernel
aligned patch 	       aligned patch
===============================================================================
real    9m46.784s       9m54.412s                  10m2.450s
user    40m5.715s       40m7.142s                  40m4.273s
sys     2m57.754s       2m58.583s                  3m17.430s
===========================================================

Time duration for kernel compilation ("make -j 8) on the same system, when
kernel is not probed.
=========================
real    9m26.389s
user    40m8.775s
sys     2m7.283s
=========================

Signed-off-by: Srinivasa DS &lt;srinivasa@in.ibm.com&gt;
Signed-off-by: Jim Keniston &lt;jkenisto@us.ibm.com&gt;
Acked-by: Ananth N Mavinakayanahalli &lt;ananth@in.ibm.com&gt;
Cc: Anil S Keshavamurthy &lt;anil.s.keshavamurthy@intel.com&gt;
Cc: David S. Miller &lt;davem@davemloft.net&gt;
Cc: Masami Hiramatsu &lt;mhiramat@redhat.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kernel/kprobes.c: Made kprobe_blacklist static.</title>
<updated>2008-07-10T17:13:51+00:00</updated>
<author>
<name>Daniel Guilak</name>
<email>guilak@linux.vnet.ibm.com</email>
</author>
<published>2008-07-10T16:38:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=544304b200c3869bc1312bcf941c4cf04d65b56c'/>
<id>544304b200c3869bc1312bcf941c4cf04d65b56c</id>
<content type='text'>
Signed-off-by: Daniel Guilak &lt;daniel@danielguilak.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Daniel Guilak &lt;daniel@danielguilak.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kprobes: fix error checking of batch registration</title>
<updated>2008-06-13T01:05:40+00:00</updated>
<author>
<name>Masami Hiramatsu</name>
<email>mhiramat@redhat.com</email>
</author>
<published>2008-06-12T22:21:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=67dddaad5d8b8c5ee5b96a7e2f6cb0faad703865'/>
<id>67dddaad5d8b8c5ee5b96a7e2f6cb0faad703865</id>
<content type='text'>
Fix error checking routine to catch an error which occurs in first
__register_*probe().

Signed-off-by: Masami Hiramatsu &lt;mhiramat@redhat.com&gt;
Cc: Ananth N Mavinakayanahalli &lt;ananth@in.ibm.com&gt;
Cc: Jim Keniston &lt;jkenisto@us.ibm.com&gt;
Cc: David Miller &lt;davem@davemloft.net&gt;
Cc: Anil S Keshavamurthy &lt;anil.s.keshavamurthy@intel.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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix error checking routine to catch an error which occurs in first
__register_*probe().

Signed-off-by: Masami Hiramatsu &lt;mhiramat@redhat.com&gt;
Cc: Ananth N Mavinakayanahalli &lt;ananth@in.ibm.com&gt;
Cc: Jim Keniston &lt;jkenisto@us.ibm.com&gt;
Cc: David Miller &lt;davem@davemloft.net&gt;
Cc: Anil S Keshavamurthy &lt;anil.s.keshavamurthy@intel.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kprobes: add (un)register_jprobes for batch registration</title>
<updated>2008-04-28T15:58:32+00:00</updated>
<author>
<name>Masami Hiramatsu</name>
<email>mhiramat@redhat.com</email>
</author>
<published>2008-04-28T09:14:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=26b31c1908e02a316edfba08080373342e662c14'/>
<id>26b31c1908e02a316edfba08080373342e662c14</id>
<content type='text'>
Introduce unregister_/register_jprobes() for jprobe batch registration.

Signed-off-by: Masami Hiramatsu &lt;mhiramat@redhat.com&gt;
Cc: Ananth N Mavinakayanahalli &lt;ananth@in.ibm.com&gt;
Cc: Jim Keniston &lt;jkenisto@us.ibm.com&gt;
Cc: Prasanna S Panchamukhi &lt;prasanna@in.ibm.com&gt;
Cc: Shaohua Li &lt;shaohua.li@intel.com&gt;
Cc: David Miller &lt;davem@davemloft.net&gt;
Cc: "Frank Ch. Eigler" &lt;fche@redhat.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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Introduce unregister_/register_jprobes() for jprobe batch registration.

Signed-off-by: Masami Hiramatsu &lt;mhiramat@redhat.com&gt;
Cc: Ananth N Mavinakayanahalli &lt;ananth@in.ibm.com&gt;
Cc: Jim Keniston &lt;jkenisto@us.ibm.com&gt;
Cc: Prasanna S Panchamukhi &lt;prasanna@in.ibm.com&gt;
Cc: Shaohua Li &lt;shaohua.li@intel.com&gt;
Cc: David Miller &lt;davem@davemloft.net&gt;
Cc: "Frank Ch. Eigler" &lt;fche@redhat.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kprobes: add (un)register_kretprobes for batch registration</title>
<updated>2008-04-28T15:58:32+00:00</updated>
<author>
<name>Masami Hiramatsu</name>
<email>mhiramat@redhat.com</email>
</author>
<published>2008-04-28T09:14:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=4a296e07c3a410c09b9155da4c2fa84a07964f38'/>
<id>4a296e07c3a410c09b9155da4c2fa84a07964f38</id>
<content type='text'>
Introduce unregister_/register_kretprobes() for kretprobe batch registration.

Signed-off-by: Masami Hiramatsu &lt;mhiramat@redhat.com&gt;
Cc: Ananth N Mavinakayanahalli &lt;ananth@in.ibm.com&gt;
Cc: Jim Keniston &lt;jkenisto@us.ibm.com&gt;
Cc: Prasanna S Panchamukhi &lt;prasanna@in.ibm.com&gt;
Cc: Shaohua Li &lt;shaohua.li@intel.com&gt;
Cc: David Miller &lt;davem@davemloft.net&gt;
Cc: "Frank Ch. Eigler" &lt;fche@redhat.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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Introduce unregister_/register_kretprobes() for kretprobe batch registration.

Signed-off-by: Masami Hiramatsu &lt;mhiramat@redhat.com&gt;
Cc: Ananth N Mavinakayanahalli &lt;ananth@in.ibm.com&gt;
Cc: Jim Keniston &lt;jkenisto@us.ibm.com&gt;
Cc: Prasanna S Panchamukhi &lt;prasanna@in.ibm.com&gt;
Cc: Shaohua Li &lt;shaohua.li@intel.com&gt;
Cc: David Miller &lt;davem@davemloft.net&gt;
Cc: "Frank Ch. Eigler" &lt;fche@redhat.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kprobes: add (un)register_kprobes for batch registration</title>
<updated>2008-04-28T15:58:32+00:00</updated>
<author>
<name>Masami Hiramatsu</name>
<email>mhiramat@redhat.com</email>
</author>
<published>2008-04-28T09:14:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=9861668f747895608cea425f8457989d8dd2edf2'/>
<id>9861668f747895608cea425f8457989d8dd2edf2</id>
<content type='text'>
Introduce unregister_/register_kprobes() for kprobe batch registration.  This
can reduce waiting time for synchronized_sched() when a lot of probes have to
be unregistered at once.

Signed-off-by: Masami Hiramatsu &lt;mhiramat@redhat.com&gt;
Cc: Ananth N Mavinakayanahalli &lt;ananth@in.ibm.com&gt;
Cc: Jim Keniston &lt;jkenisto@us.ibm.com&gt;
Cc: Prasanna S Panchamukhi &lt;prasanna@in.ibm.com&gt;
Cc: Shaohua Li &lt;shaohua.li@intel.com&gt;
Cc: David Miller &lt;davem@davemloft.net&gt;
Cc: "Frank Ch. Eigler" &lt;fche@redhat.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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Introduce unregister_/register_kprobes() for kprobe batch registration.  This
can reduce waiting time for synchronized_sched() when a lot of probes have to
be unregistered at once.

Signed-off-by: Masami Hiramatsu &lt;mhiramat@redhat.com&gt;
Cc: Ananth N Mavinakayanahalli &lt;ananth@in.ibm.com&gt;
Cc: Jim Keniston &lt;jkenisto@us.ibm.com&gt;
Cc: Prasanna S Panchamukhi &lt;prasanna@in.ibm.com&gt;
Cc: Shaohua Li &lt;shaohua.li@intel.com&gt;
Cc: David Miller &lt;davem@davemloft.net&gt;
Cc: "Frank Ch. Eigler" &lt;fche@redhat.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kprobes: prevent probing of preempt_schedule()</title>
<updated>2008-04-28T15:58:32+00:00</updated>
<author>
<name>Srinivasa Ds</name>
<email>srinivasa@in.ibm.com</email>
</author>
<published>2008-04-28T09:14:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=3d8d996e0ca5b4093203d3f050b0f70b5c949ae8'/>
<id>3d8d996e0ca5b4093203d3f050b0f70b5c949ae8</id>
<content type='text'>
Prohibit users from probing preempt_schedule().  One way of prohibiting the
user from probing functions is by marking such functions with __kprobes.  But
this method doesn't work for those functions, which are already marked to
different section like preempt_schedule() (belongs to __sched section).  So we
use blacklist approach to refuse user from probing these functions.

In blacklist approach we populate the blacklisted function's starting address
and its size in kprobe_blacklist structure.  Then we verify the user specified
address against start and end of the blacklisted function.  So any attempt to
register probe on blacklisted functions will be rejected.

[akpm@linux-foundation.org: build fix]
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Srinivasa DS &lt;srinivasa@in.ibm.com&gt;
Signed-off-by: Ananth N Mavinakayanahalli &lt;ananth@in.ibm.com&gt;
Signed-off-by: Jim Keniston &lt;jkenisto@us.ibm.com&gt;
Cc: Dave Hansen &lt;haveblue@us.ibm.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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Prohibit users from probing preempt_schedule().  One way of prohibiting the
user from probing functions is by marking such functions with __kprobes.  But
this method doesn't work for those functions, which are already marked to
different section like preempt_schedule() (belongs to __sched section).  So we
use blacklist approach to refuse user from probing these functions.

In blacklist approach we populate the blacklisted function's starting address
and its size in kprobe_blacklist structure.  Then we verify the user specified
address against start and end of the blacklisted function.  So any attempt to
register probe on blacklisted functions will be rejected.

[akpm@linux-foundation.org: build fix]
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Srinivasa DS &lt;srinivasa@in.ibm.com&gt;
Signed-off-by: Ananth N Mavinakayanahalli &lt;ananth@in.ibm.com&gt;
Signed-off-by: Jim Keniston &lt;jkenisto@us.ibm.com&gt;
Cc: Dave Hansen &lt;haveblue@us.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kprobes: fix a null pointer bug in register_kretprobe()</title>
<updated>2008-03-05T00:35:19+00:00</updated>
<author>
<name>Masami Hiramatsu</name>
<email>mhiramat@redhat.com</email>
</author>
<published>2008-03-04T22:29:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b2a5cd6938879b5bcfef0a73c28fea84c49519c2'/>
<id>b2a5cd6938879b5bcfef0a73c28fea84c49519c2</id>
<content type='text'>
Fix a bug in regiseter_kretprobe() which does not check rp-&gt;kp.symbol_name ==
NULL before calling kprobe_lookup_name.

For maintainability, this introduces kprobe_addr helper function which
resolves addr field.  It is used by register_kprobe and register_kretprobe.

Signed-off-by: Masami Hiramatsu &lt;mhiramat@redhat.com&gt;
Cc: Ananth N Mavinakayanahalli &lt;ananth@in.ibm.com&gt;
Cc: Jim Keniston &lt;jkenisto@us.ibm.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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix a bug in regiseter_kretprobe() which does not check rp-&gt;kp.symbol_name ==
NULL before calling kprobe_lookup_name.

For maintainability, this introduces kprobe_addr helper function which
resolves addr field.  It is used by register_kprobe and register_kretprobe.

Signed-off-by: Masami Hiramatsu &lt;mhiramat@redhat.com&gt;
Cc: Ananth N Mavinakayanahalli &lt;ananth@in.ibm.com&gt;
Cc: Jim Keniston &lt;jkenisto@us.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
