* [PATCH v2] x86, kaslr: export offset in VMCOREINFO ELF notes
@ 2014-01-23 17:31 Kees Cook
2014-01-25 7:47 ` Ingo Molnar
` (2 more replies)
0 siblings, 3 replies; 11+ messages in thread
From: Kees Cook @ 2014-01-23 17:31 UTC (permalink / raw)
To: crash-utility
Cc: linux-kernel, Dave Anderson, Andrew Honig, Eugene Surovegin,
Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, Yinghai Lu
From: Eugene Surovegin <surovegin@google.com>
Include kASLR offset in VMCOREINFO ELF notes to assist in debugging.
Signed-off-by: Eugene Surovegin <surovegin@google.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
---
v2:
- make sure "From:" got sent correctly
---
arch/x86/kernel/machine_kexec_64.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c
index 4eabc160696f..679cef0791cd 100644
--- a/arch/x86/kernel/machine_kexec_64.c
+++ b/arch/x86/kernel/machine_kexec_64.c
@@ -279,5 +279,7 @@ void arch_crash_save_vmcoreinfo(void)
VMCOREINFO_SYMBOL(node_data);
VMCOREINFO_LENGTH(node_data, MAX_NUMNODES);
#endif
+ vmcoreinfo_append_str("KERNELOFFSET=%lx\n",
+ (unsigned long)&_text - __START_KERNEL);
}
--
1.7.9.5
--
Kees Cook
Chrome OS Security
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v2] x86, kaslr: export offset in VMCOREINFO ELF notes
2014-01-23 17:31 [PATCH v2] x86, kaslr: export offset in VMCOREINFO ELF notes Kees Cook
@ 2014-01-25 7:47 ` Ingo Molnar
2014-01-27 14:15 ` Adrian Hunter
2014-02-21 20:25 ` Kees Cook
2014-02-26 1:06 ` [tip:x86/urgent] " tip-bot for Eugene Surovegin
2 siblings, 1 reply; 11+ messages in thread
From: Ingo Molnar @ 2014-01-25 7:47 UTC (permalink / raw)
To: Kees Cook, Adrian Hunter
Cc: crash-utility, linux-kernel, Dave Anderson, Andrew Honig,
Eugene Surovegin, Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
x86, Yinghai Lu, Linus Torvalds
* Kees Cook <keescook@chromium.org> wrote:
> From: Eugene Surovegin <surovegin@google.com>
>
> Include kASLR offset in VMCOREINFO ELF notes to assist in debugging.
>
> Signed-off-by: Eugene Surovegin <surovegin@google.com>
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
> v2:
> - make sure "From:" got sent correctly
> ---
> arch/x86/kernel/machine_kexec_64.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c
> index 4eabc160696f..679cef0791cd 100644
> --- a/arch/x86/kernel/machine_kexec_64.c
> +++ b/arch/x86/kernel/machine_kexec_64.c
> @@ -279,5 +279,7 @@ void arch_crash_save_vmcoreinfo(void)
> VMCOREINFO_SYMBOL(node_data);
> VMCOREINFO_LENGTH(node_data, MAX_NUMNODES);
> #endif
> + vmcoreinfo_append_str("KERNELOFFSET=%lx\n",
> + (unsigned long)&_text - __START_KERNEL);
> }
I've Cc:-ed Adrian Hunter, who has sent the following kaslr fixes for
perf yesterday:
http://lkml.org/lkml/2014/1/24/220
Adrian, is this patch the right solution from the perf tooling
perspective?
Thanks,
Ingo
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2] x86, kaslr: export offset in VMCOREINFO ELF notes
2014-01-25 7:47 ` Ingo Molnar
@ 2014-01-27 14:15 ` Adrian Hunter
2014-01-27 15:25 ` Ingo Molnar
0 siblings, 1 reply; 11+ messages in thread
From: Adrian Hunter @ 2014-01-27 14:15 UTC (permalink / raw)
To: Ingo Molnar
Cc: Kees Cook, crash-utility, linux-kernel, Dave Anderson,
Andrew Honig, Eugene Surovegin, Thomas Gleixner, Ingo Molnar,
H. Peter Anvin, x86, Yinghai Lu, Linus Torvalds
On 25/01/14 09:47, Ingo Molnar wrote:
>
> * Kees Cook <keescook@chromium.org> wrote:
>
>> From: Eugene Surovegin <surovegin@google.com>
>>
>> Include kASLR offset in VMCOREINFO ELF notes to assist in debugging.
>>
>> Signed-off-by: Eugene Surovegin <surovegin@google.com>
>> Signed-off-by: Kees Cook <keescook@chromium.org>
>> ---
>> v2:
>> - make sure "From:" got sent correctly
>> ---
>> arch/x86/kernel/machine_kexec_64.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c
>> index 4eabc160696f..679cef0791cd 100644
>> --- a/arch/x86/kernel/machine_kexec_64.c
>> +++ b/arch/x86/kernel/machine_kexec_64.c
>> @@ -279,5 +279,7 @@ void arch_crash_save_vmcoreinfo(void)
>> VMCOREINFO_SYMBOL(node_data);
>> VMCOREINFO_LENGTH(node_data, MAX_NUMNODES);
>> #endif
>> + vmcoreinfo_append_str("KERNELOFFSET=%lx\n",
>> + (unsigned long)&_text - __START_KERNEL);
>> }
>
> I've Cc:-ed Adrian Hunter, who has sent the following kaslr fixes for
> perf yesterday:
>
> http://lkml.org/lkml/2014/1/24/220
>
> Adrian, is this patch the right solution from the perf tooling
> perspective?
perf tools isn't a consumer of VMCOREINFO although I see VMCOREINFO already
has _stext which would be enough for many purposes.
>
> Thanks,
>
> Ingo
>
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2] x86, kaslr: export offset in VMCOREINFO ELF notes
2014-01-27 14:15 ` Adrian Hunter
@ 2014-01-27 15:25 ` Ingo Molnar
2014-01-27 15:56 ` Adrian Hunter
0 siblings, 1 reply; 11+ messages in thread
From: Ingo Molnar @ 2014-01-27 15:25 UTC (permalink / raw)
To: Adrian Hunter
Cc: Kees Cook, crash-utility, linux-kernel, Dave Anderson,
Andrew Honig, Eugene Surovegin, Thomas Gleixner, Ingo Molnar,
H. Peter Anvin, x86, Yinghai Lu, Linus Torvalds,
Arnaldo Carvalho de Melo, Peter Zijlstra, Namhyung Kim,
David Ahern, Frederic Weisbecker, Jiri Olsa
* Adrian Hunter <adrian.hunter@intel.com> wrote:
> On 25/01/14 09:47, Ingo Molnar wrote:
> >
> > * Kees Cook <keescook@chromium.org> wrote:
> >
> >> From: Eugene Surovegin <surovegin@google.com>
> >>
> >> Include kASLR offset in VMCOREINFO ELF notes to assist in debugging.
> >>
> >> Signed-off-by: Eugene Surovegin <surovegin@google.com>
> >> Signed-off-by: Kees Cook <keescook@chromium.org>
> >> ---
> >> v2:
> >> - make sure "From:" got sent correctly
> >> ---
> >> arch/x86/kernel/machine_kexec_64.c | 2 ++
> >> 1 file changed, 2 insertions(+)
> >>
> >> diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c
> >> index 4eabc160696f..679cef0791cd 100644
> >> --- a/arch/x86/kernel/machine_kexec_64.c
> >> +++ b/arch/x86/kernel/machine_kexec_64.c
> >> @@ -279,5 +279,7 @@ void arch_crash_save_vmcoreinfo(void)
> >> VMCOREINFO_SYMBOL(node_data);
> >> VMCOREINFO_LENGTH(node_data, MAX_NUMNODES);
> >> #endif
> >> + vmcoreinfo_append_str("KERNELOFFSET=%lx\n",
> >> + (unsigned long)&_text - __START_KERNEL);
> >> }
> >
> > I've Cc:-ed Adrian Hunter, who has sent the following kaslr fixes for
> > perf yesterday:
> >
> > http://lkml.org/lkml/2014/1/24/220
> >
> > Adrian, is this patch the right solution from the perf tooling
> > perspective?
>
> perf tools isn't a consumer of VMCOREINFO although I see VMCOREINFO
> already has _stext which would be enough for many purposes.
Yes - but let me explain where I'm coming from: I'd like the recent
KASLR related perf /proc/kcore based annotation bug to be fixed
properly.
Currently I'm not sure about the status of it. In your fixes
submission:
Date: Fri, 24 Jan 2014 17:10:10 +0200
From: Adrian Hunter <adrian.hunter@intel.com>
Subject: [PATCH 0/8] perf tools: kaslr fixes
you mentioned the following:
"- mustn't use kcore if the kernel has moved"
Does this that /proc/kcore annotation will not work if KASLR is
active?
If yes then given that I expect most distros to turn on KASLR this
would essentially make /proc/kcore useless on a large set of Linux
systems. That would be suboptimal.
Thanks,
Ingo
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2] x86, kaslr: export offset in VMCOREINFO ELF notes
2014-01-27 15:25 ` Ingo Molnar
@ 2014-01-27 15:56 ` Adrian Hunter
2014-01-27 16:19 ` Peter Zijlstra
0 siblings, 1 reply; 11+ messages in thread
From: Adrian Hunter @ 2014-01-27 15:56 UTC (permalink / raw)
To: Ingo Molnar
Cc: Kees Cook, crash-utility, linux-kernel, Dave Anderson,
Andrew Honig, Eugene Surovegin, Thomas Gleixner, Ingo Molnar,
H. Peter Anvin, x86, Yinghai Lu, Linus Torvalds,
Arnaldo Carvalho de Melo, Peter Zijlstra, Namhyung Kim,
David Ahern, Frederic Weisbecker, Jiri Olsa
On 27/01/14 17:25, Ingo Molnar wrote:
>
> * Adrian Hunter <adrian.hunter@intel.com> wrote:
>
>> On 25/01/14 09:47, Ingo Molnar wrote:
>>>
>>> * Kees Cook <keescook@chromium.org> wrote:
>>>
>>>> From: Eugene Surovegin <surovegin@google.com>
>>>>
>>>> Include kASLR offset in VMCOREINFO ELF notes to assist in debugging.
>>>>
>>>> Signed-off-by: Eugene Surovegin <surovegin@google.com>
>>>> Signed-off-by: Kees Cook <keescook@chromium.org>
>>>> ---
>>>> v2:
>>>> - make sure "From:" got sent correctly
>>>> ---
>>>> arch/x86/kernel/machine_kexec_64.c | 2 ++
>>>> 1 file changed, 2 insertions(+)
>>>>
>>>> diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c
>>>> index 4eabc160696f..679cef0791cd 100644
>>>> --- a/arch/x86/kernel/machine_kexec_64.c
>>>> +++ b/arch/x86/kernel/machine_kexec_64.c
>>>> @@ -279,5 +279,7 @@ void arch_crash_save_vmcoreinfo(void)
>>>> VMCOREINFO_SYMBOL(node_data);
>>>> VMCOREINFO_LENGTH(node_data, MAX_NUMNODES);
>>>> #endif
>>>> + vmcoreinfo_append_str("KERNELOFFSET=%lx\n",
>>>> + (unsigned long)&_text - __START_KERNEL);
>>>> }
>>>
>>> I've Cc:-ed Adrian Hunter, who has sent the following kaslr fixes for
>>> perf yesterday:
>>>
>>> http://lkml.org/lkml/2014/1/24/220
>>>
>>> Adrian, is this patch the right solution from the perf tooling
>>> perspective?
>>
>> perf tools isn't a consumer of VMCOREINFO although I see VMCOREINFO
>> already has _stext which would be enough for many purposes.
>
> Yes - but let me explain where I'm coming from: I'd like the recent
> KASLR related perf /proc/kcore based annotation bug to be fixed
> properly.
>
> Currently I'm not sure about the status of it. In your fixes
> submission:
>
> Date: Fri, 24 Jan 2014 17:10:10 +0200
> From: Adrian Hunter <adrian.hunter@intel.com>
> Subject: [PATCH 0/8] perf tools: kaslr fixes
>
> you mentioned the following:
>
> "- mustn't use kcore if the kernel has moved"
>
> Does this that /proc/kcore annotation will not work if KASLR is
> active?
No. In fact annotation works now with kcore. Linus' problem was with vmlinux.
Kcore won't be used with kaslr in the case:
1. record data with 'perf record'
2. reboot
3. use annotation on the previously recorded data
As I noted in the commit message, you can still use kcore if you made a copy
(with perf buildid-cache) at the time the data was recorded.
>
> If yes then given that I expect most distros to turn on KASLR this
> would essentially make /proc/kcore useless on a large set of Linux
> systems. That would be suboptimal.
>
> Thanks,
>
> Ingo
>
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2] x86, kaslr: export offset in VMCOREINFO ELF notes
2014-01-27 15:56 ` Adrian Hunter
@ 2014-01-27 16:19 ` Peter Zijlstra
2014-01-27 16:22 ` Peter Zijlstra
0 siblings, 1 reply; 11+ messages in thread
From: Peter Zijlstra @ 2014-01-27 16:19 UTC (permalink / raw)
To: Adrian Hunter
Cc: Ingo Molnar, Kees Cook, crash-utility, linux-kernel,
Dave Anderson, Andrew Honig, Eugene Surovegin, Thomas Gleixner,
Ingo Molnar, H. Peter Anvin, x86, Yinghai Lu, Linus Torvalds,
Arnaldo Carvalho de Melo, Namhyung Kim, David Ahern,
Frederic Weisbecker, Jiri Olsa
On Mon, Jan 27, 2014 at 05:56:38PM +0200, Adrian Hunter wrote:
> No. In fact annotation works now with kcore. Linus' problem was with vmlinux.
>
> Kcore won't be used with kaslr in the case:
> 1. record data with 'perf record'
> 2. reboot
> 3. use annotation on the previously recorded data
>
> As I noted in the commit message, you can still use kcore if you made a copy
> (with perf buildid-cache) at the time the data was recorded.
Not that I care much about this particular case; but you could also save
the offset at record time and do double offset correction assuming its
still the same kernel you booted into but at a different location.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2] x86, kaslr: export offset in VMCOREINFO ELF notes
2014-01-27 16:19 ` Peter Zijlstra
@ 2014-01-27 16:22 ` Peter Zijlstra
2014-01-27 18:41 ` Andrew Honig
0 siblings, 1 reply; 11+ messages in thread
From: Peter Zijlstra @ 2014-01-27 16:22 UTC (permalink / raw)
To: Adrian Hunter
Cc: Ingo Molnar, Kees Cook, linux-kernel, Dave Anderson,
Andrew Honig, Eugene Surovegin, Thomas Gleixner, Ingo Molnar,
H. Peter Anvin, x86, Yinghai Lu, Linus Torvalds,
Arnaldo Carvalho de Melo, Namhyung Kim, David Ahern,
Frederic Weisbecker, Jiri Olsa
Do _NOT_ cross post to moderated lists!!
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2] x86, kaslr: export offset in VMCOREINFO ELF notes
2014-01-27 16:22 ` Peter Zijlstra
@ 2014-01-27 18:41 ` Andrew Honig
2014-01-27 19:33 ` Peter Zijlstra
0 siblings, 1 reply; 11+ messages in thread
From: Andrew Honig @ 2014-01-27 18:41 UTC (permalink / raw)
To: Peter Zijlstra
Cc: Adrian Hunter, Ingo Molnar, Kees Cook, linux-kernel,
Dave Anderson, Eugene Surovegin, Thomas Gleixner, Ingo Molnar,
H. Peter Anvin, x86, Yinghai Lu, Linus Torvalds,
Arnaldo Carvalho de Melo, Namhyung Kim, David Ahern,
Frederic Weisbecker, Jiri Olsa
The purpose of this patch to make it easier for processing offline
kdump files for crash analysis. For context on the see this thread
for a patch in progress
(http://www.mail-archive.com/crash-utility@redhat.com/msg04640.html)
_stext doesn't quite work for this purpose because in my testing it
doesn't exactly match the kaslr offset, for some reason _stext is a
few hundred bytes after the kaslr offset. The number doesn't appear
consistent and I would prefer not to take a dependency on that.
On Mon, Jan 27, 2014 at 8:22 AM, Peter Zijlstra <peterz@infradead.org> wrote:
>
>
> Do _NOT_ cross post to moderated lists!!
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2] x86, kaslr: export offset in VMCOREINFO ELF notes
2014-01-27 18:41 ` Andrew Honig
@ 2014-01-27 19:33 ` Peter Zijlstra
0 siblings, 0 replies; 11+ messages in thread
From: Peter Zijlstra @ 2014-01-27 19:33 UTC (permalink / raw)
To: Andrew Honig
Cc: Adrian Hunter, Ingo Molnar, Kees Cook, linux-kernel,
Dave Anderson, Eugene Surovegin, Thomas Gleixner, Ingo Molnar,
H. Peter Anvin, x86, Yinghai Lu, Linus Torvalds,
Arnaldo Carvalho de Melo, Namhyung Kim, David Ahern,
Frederic Weisbecker, Jiri Olsa
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2] x86, kaslr: export offset in VMCOREINFO ELF notes
2014-01-23 17:31 [PATCH v2] x86, kaslr: export offset in VMCOREINFO ELF notes Kees Cook
2014-01-25 7:47 ` Ingo Molnar
@ 2014-02-21 20:25 ` Kees Cook
2014-02-26 1:06 ` [tip:x86/urgent] " tip-bot for Eugene Surovegin
2 siblings, 0 replies; 11+ messages in thread
From: Kees Cook @ 2014-02-21 20:25 UTC (permalink / raw)
To: H. Peter Anvin
Cc: Dave Anderson, Andrew Honig, Eugene Surovegin, Thomas Gleixner,
Ingo Molnar, x86, Yinghai Lu, LKML
On Thu, Jan 23, 2014 at 9:31 AM, Kees Cook <keescook@chromium.org> wrote:
> From: Eugene Surovegin <surovegin@google.com>
>
> Include kASLR offset in VMCOREINFO ELF notes to assist in debugging.
>
> Signed-off-by: Eugene Surovegin <surovegin@google.com>
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
> v2:
> - make sure "From:" got sent correctly
> ---
> arch/x86/kernel/machine_kexec_64.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c
> index 4eabc160696f..679cef0791cd 100644
> --- a/arch/x86/kernel/machine_kexec_64.c
> +++ b/arch/x86/kernel/machine_kexec_64.c
> @@ -279,5 +279,7 @@ void arch_crash_save_vmcoreinfo(void)
> VMCOREINFO_SYMBOL(node_data);
> VMCOREINFO_LENGTH(node_data, MAX_NUMNODES);
> #endif
> + vmcoreinfo_append_str("KERNELOFFSET=%lx\n",
> + (unsigned long)&_text - __START_KERNEL);
> }
>
> --
> 1.7.9.5
Ping on this patch. The crash-utils folks would like to be using this feature.
-Kees
--
Kees Cook
Chrome OS Security
^ permalink raw reply [flat|nested] 11+ messages in thread
* [tip:x86/urgent] x86, kaslr: export offset in VMCOREINFO ELF notes
2014-01-23 17:31 [PATCH v2] x86, kaslr: export offset in VMCOREINFO ELF notes Kees Cook
2014-01-25 7:47 ` Ingo Molnar
2014-02-21 20:25 ` Kees Cook
@ 2014-02-26 1:06 ` tip-bot for Eugene Surovegin
2 siblings, 0 replies; 11+ messages in thread
From: tip-bot for Eugene Surovegin @ 2014-02-26 1:06 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, surovegin, hpa, mingo, keescook, tglx, hpa
Commit-ID: b6085a865762236bb84934161273cdac6dd11c2d
Gitweb: http://git.kernel.org/tip/b6085a865762236bb84934161273cdac6dd11c2d
Author: Eugene Surovegin <surovegin@google.com>
AuthorDate: Thu, 23 Jan 2014 09:31:20 -0800
Committer: H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Tue, 25 Feb 2014 16:57:47 -0800
x86, kaslr: export offset in VMCOREINFO ELF notes
Include kASLR offset in VMCOREINFO ELF notes to assist in debugging.
[ hpa: pushing this for v3.14 to avoid having a kernel version with
kASLR where we can't debug output. ]
Signed-off-by: Eugene Surovegin <surovegin@google.com>
Link: http://lkml.kernel.org/r/20140123173120.GA25474@www.outflux.net
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
arch/x86/kernel/machine_kexec_64.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c
index 4eabc16..679cef0 100644
--- a/arch/x86/kernel/machine_kexec_64.c
+++ b/arch/x86/kernel/machine_kexec_64.c
@@ -279,5 +279,7 @@ void arch_crash_save_vmcoreinfo(void)
VMCOREINFO_SYMBOL(node_data);
VMCOREINFO_LENGTH(node_data, MAX_NUMNODES);
#endif
+ vmcoreinfo_append_str("KERNELOFFSET=%lx\n",
+ (unsigned long)&_text - __START_KERNEL);
}
^ permalink raw reply related [flat|nested] 11+ messages in thread
end of thread, other threads:[~2014-02-26 1:07 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-23 17:31 [PATCH v2] x86, kaslr: export offset in VMCOREINFO ELF notes Kees Cook
2014-01-25 7:47 ` Ingo Molnar
2014-01-27 14:15 ` Adrian Hunter
2014-01-27 15:25 ` Ingo Molnar
2014-01-27 15:56 ` Adrian Hunter
2014-01-27 16:19 ` Peter Zijlstra
2014-01-27 16:22 ` Peter Zijlstra
2014-01-27 18:41 ` Andrew Honig
2014-01-27 19:33 ` Peter Zijlstra
2014-02-21 20:25 ` Kees Cook
2014-02-26 1:06 ` [tip:x86/urgent] " tip-bot for Eugene Surovegin
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).