This is the mail archive of the
ecos-bugs@sources.redhat.com
mailing list for the eCos project.
[Bug 1000170] SuperH context switch code vulnerable to stack corruption by ISR
- From: bugzilla at ecoscentric dot com
- To: ecos-bugs at sources dot redhat dot com
- Date: Mon, 18 Apr 2005 14:52:22 +0100 (BST)
- Subject: [Bug 1000170] SuperH context switch code vulnerable to stack corruption by ISR
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1000170
------- Additional Comments From nickg@ecoscentric.com 2005-18-04 14:52 -------
Context switching should be able to happen while interrupts are enabled. In
normal running the kernel switches thread contexts without disabling interrupts.
It is therefore important that the context switch code be interrupt safe.
Particularly duing hal_cpu_int_merge which is where any pending interrupts will
get delivered. It should be fine to temporarily use the stack of the old thread
while dealing with any new interrupts that occur, the scheduler lock will be
non-zero so no further context switching will happen and we will just come
straight back here to carry on restoring state.
I'm surprised that this code has lasted in this state as long as it has without
causing a problem. Probably a combination of the facts that the SH architecture
is not as widely used as the others, and the fact that the window for the bug to
manifest itself is very small.
So, as far as I can see this patch is correct and should be applied to CVS.
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.