* [PATCH RT] Don't call mcount from vsyscall_fn's
@ 2007-06-19 2:41 Steven Rostedt
2007-06-19 8:41 ` Ingo Molnar
0 siblings, 1 reply; 2+ messages in thread
From: Steven Rostedt @ 2007-06-19 2:41 UTC (permalink / raw)
To: Ingo Molnar; +Cc: Thomas Gleixner, LKML, RT
This bit me in the butt.
I couldn't understand why my init app was segfaulting, with a kernel
address, but a user RIP and RSP. Well, the RIP I think was bogus, but
the kernel address was always the start of "mcount". Looking deeper, I
printed out what was in the RSP (even though it was a user stack). It
ended up showing me that the calling address was from the VDSO area.
Looking even further, I found the offending culprit, which was
vread_hpet.
Looking at the assembly dump, I saw the vread_hpet was calling mcount,
but I could not see it in the code. Nor could I see it in hpet.i (-E
option of compiling).
Well, I guess Ingo is a magician when it comes to compiler tricks, and
has the mcount being called by "every!!" function, unless you add the
"notrace" option.
This patch adds the notrace to vsyscall_fn, so that we don't have user
land apps calling mcount and crashing!
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Index: linux-2.6-rt-test/include/asm-x86_64/vsyscall.h
===================================================================
--- linux-2.6-rt-test.orig/include/asm-x86_64/vsyscall.h
+++ linux-2.6-rt-test/include/asm-x86_64/vsyscall.h
@@ -22,7 +22,7 @@ enum vsyscall_num {
/* Definitions for CONFIG_GENERIC_TIME definitions */
#define __section_vsyscall_gtod_data __attribute__ \
((unused, __section__ (".vsyscall_gtod_data"),aligned(16)))
-#define __vsyscall_fn __attribute__ ((unused,__section__(".vsyscall_fn")))
+#define __vsyscall_fn __attribute__ ((unused,__section__(".vsyscall_fn"))) notrace
#define VGETCPU_RDTSCP 1
#define VGETCPU_LSL 2
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH RT] Don't call mcount from vsyscall_fn's
2007-06-19 2:41 [PATCH RT] Don't call mcount from vsyscall_fn's Steven Rostedt
@ 2007-06-19 8:41 ` Ingo Molnar
0 siblings, 0 replies; 2+ messages in thread
From: Ingo Molnar @ 2007-06-19 8:41 UTC (permalink / raw)
To: Steven Rostedt; +Cc: Thomas Gleixner, LKML, RT
* Steven Rostedt <rostedt@goodmis.org> wrote:
> This bit me in the butt.
>
> I couldn't understand why my init app was segfaulting, with a kernel
> address, but a user RIP and RSP. Well, the RIP I think was bogus, but
> the kernel address was always the start of "mcount". Looking deeper,
> I printed out what was in the RSP (even though it was a user stack).
> It ended up showing me that the calling address was from the VDSO
> area. Looking even further, I found the offending culprit, which was
> vread_hpet.
>
> Looking at the assembly dump, I saw the vread_hpet was calling mcount,
> but I could not see it in the code. Nor could I see it in hpet.i (-E
> option of compiling).
>
> Well, I guess Ingo is a magician when it comes to compiler tricks, and
> has the mcount being called by "every!!" function, unless you add the
> "notrace" option.
>
> This patch adds the notrace to vsyscall_fn, so that we don't have user
> land apps calling mcount and crashing!
doh - applied. Thanks!
Ingo
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-06-19 8:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-19 2:41 [PATCH RT] Don't call mcount from vsyscall_fn's Steven Rostedt
2007-06-19 8:41 ` Ingo Molnar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).