Re: [PATCH REPOST^3] Run IST traps from user mode preemptive onprocess stack

From: Ingo Molnar
Date: Tue May 06 2008 - 10:39:54 EST



* Andi Kleen <andi@xxxxxxxxxxxxxx> wrote:

[...]
> Well it was worked around, not properly fixed. This patch fixes it
> properly. The problem of the original workaround is that it wouldn't
> print the vma now in many cases because it couldn't take the
> semaphore.

huh? While this issue is dwarfed by the security hole your patch
introduces, you miss the whole point about debug printouts in case of
traps.

In practice we dont need to print out _anything_ from int3 traps (even
if they were unexpected) - user-space very much knows it has set a
breakpoint.

What we are interested in are the segmentation faults for example. Those
do get printed out correctly as segmentation faults do not go via IST
traps, they go via the normal process stack.

Furthermore, we _do_ print out the fault location even for int3 if we
are not preemptible. An example i just triggered on latest -git:

int3[2789] trap int3 ip:4004cd sp:7fff27501c50 error:0

And we do print out the vma information too in other, much more
interesting trap types such as unresolved page faults:

segfault[2652]: segfault at 0 ip 400471 sp 7fff05d42480 error 6 in segfault[400000+1000]

So what we do worst-case is that we do not do a find_vma() and we dont
print out the vma. Not a big deal at all for an int3 or a hw-breakpoint
trap ...

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/