This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[Bug kprobes/2071] Probes on ISR with probes on task thread's prehandler crash the system
- From: "mhiramat at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: systemtap at sources dot redhat dot com
- Date: 17 Jan 2008 21:56:03 -0000
- Subject: [Bug kprobes/2071] Probes on ISR with probes on task thread's prehandler crash the system
- References: <20051220073112.2071.anil.s.keshavamurthy@intel.com>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From mhiramat at redhat dot com 2008-01-17 21:56 -------
As the result of investigation, I found a bug in restore_previous_kprobe().
This function and save_previous_kprobe() do FILO(stack) operation.
These functions work as like below;
save_previous_kprobe() // this pushes a value to stack
{
i = ++index;
stack[i-1] = val;
}
restore_previous_kprobe() // this pops a value from stack
{
i = --index; // (a)
val = stack[i]; // (b)
}
However, if an interrupt occurs between (a) and (b), and a kprobe
is hit in that interrupt, this overwrites previous stack[] entry.
restore_previous_kprobe() // this pops a value from stack
{
i = --index; // (a) (i == 0, index == 0)
--(interrupt)
save_previous_kprobe() // this pushes a value to stack
{
i = ++index; (i == 1, index == 1)
stack[i-1] = val2; (!!overwrite stack[0]!!)
}
restore_previous_kprobe() // this pops a value from stack
{
i = --index; (i == 0, index == 0)
val2 = stack[i]; (stack[0] == val2)
}
--
val = stack[i]; // (b) (val = val2)
}
Thus, the index must be decremented AFTER reading the value.
restore_previous_kprobe() // this pops a value from stack
{
i = index;
val = stack[i-1];
--index;
}
--
http://sourceware.org/bugzilla/show_bug.cgi?id=2071
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.