* [PATCH v3] Only print debug message when failed to serach for kernel symbol from /proc/kallsyms
@ 2017-03-03 3:52 Baoquan He
2017-03-03 4:05 ` Pratyush Anand
2017-03-06 1:46 ` Dave Young
0 siblings, 2 replies; 7+ messages in thread
From: Baoquan He @ 2017-03-03 3:52 UTC (permalink / raw)
To: horms; +Cc: panand, dyoung, kexec, Baoquan He
Kernel symbol page_offset_base could be unavailable when mm KASLR code is
not compiled in kernel. It's unappropriate to print out error message
when failed to search for page_offset_base from /proc/kallsyms. Seems now
there is not a way to find out if mm KASLR is compiled in or not. An
alternative approach is only printing out debug message in get_kernel_sym
if failed to search a expected kernel symbol.
Do it in this patch, a simple fix.
Signed-off-by: Baoquan He <bhe@redhat.com>
---
kexec/arch/i386/crashdump-x86.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
index 88aeee3..c4cf201 100644
--- a/kexec/arch/i386/crashdump-x86.c
+++ b/kexec/arch/i386/crashdump-x86.c
@@ -127,7 +127,7 @@ static unsigned long long get_kernel_sym(const char *symbol)
}
}
- fprintf(stderr, "Cannot get kernel %s symbol address\n", symbol);
+ dbgprintf("Cannot get kernel %s symbol address\n", symbol);
return 0;
}
--
2.5.5
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH v3] Only print debug message when failed to serach for kernel symbol from /proc/kallsyms
2017-03-03 3:52 [PATCH v3] Only print debug message when failed to serach for kernel symbol from /proc/kallsyms Baoquan He
@ 2017-03-03 4:05 ` Pratyush Anand
2017-03-06 1:46 ` Dave Young
1 sibling, 0 replies; 7+ messages in thread
From: Pratyush Anand @ 2017-03-03 4:05 UTC (permalink / raw)
To: Baoquan He, horms; +Cc: dyoung, kexec
On Friday 03 March 2017 09:22 AM, Baoquan He wrote:
> Kernel symbol page_offset_base could be unavailable when mm KASLR code is
> not compiled in kernel. It's unappropriate to print out error message
> when failed to search for page_offset_base from /proc/kallsyms. Seems now
> there is not a way to find out if mm KASLR is compiled in or not. An
> alternative approach is only printing out debug message in get_kernel_sym
> if failed to search a expected kernel symbol.
>
> Do it in this patch, a simple fix.
>
> Signed-off-by: Baoquan He <bhe@redhat.com>
Yes, a particular symbol can be kernel version dependent and may not be
available in all the kernel version.
Reviewed-by: Pratyush Anand <panand@redhat.com>
> ---
> kexec/arch/i386/crashdump-x86.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
> index 88aeee3..c4cf201 100644
> --- a/kexec/arch/i386/crashdump-x86.c
> +++ b/kexec/arch/i386/crashdump-x86.c
> @@ -127,7 +127,7 @@ static unsigned long long get_kernel_sym(const char *symbol)
> }
> }
>
> - fprintf(stderr, "Cannot get kernel %s symbol address\n", symbol);
> + dbgprintf("Cannot get kernel %s symbol address\n", symbol);
> return 0;
> }
>
>
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH v3] Only print debug message when failed to serach for kernel symbol from /proc/kallsyms
2017-03-03 3:52 [PATCH v3] Only print debug message when failed to serach for kernel symbol from /proc/kallsyms Baoquan He
2017-03-03 4:05 ` Pratyush Anand
@ 2017-03-06 1:46 ` Dave Young
2017-03-09 4:13 ` Philip Prindeville
1 sibling, 1 reply; 7+ messages in thread
From: Dave Young @ 2017-03-06 1:46 UTC (permalink / raw)
To: Baoquan He; +Cc: panand, horms, kexec, thgarnie
On 03/03/17 at 11:52am, Baoquan He wrote:
> Kernel symbol page_offset_base could be unavailable when mm KASLR code is
> not compiled in kernel. It's unappropriate to print out error message
> when failed to search for page_offset_base from /proc/kallsyms. Seems now
> there is not a way to find out if mm KASLR is compiled in or not. An
> alternative approach is only printing out debug message in get_kernel_sym
> if failed to search a expected kernel symbol.
>
> Do it in this patch, a simple fix.
>
> Signed-off-by: Baoquan He <bhe@redhat.com>
> ---
> kexec/arch/i386/crashdump-x86.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
> index 88aeee3..c4cf201 100644
> --- a/kexec/arch/i386/crashdump-x86.c
> +++ b/kexec/arch/i386/crashdump-x86.c
> @@ -127,7 +127,7 @@ static unsigned long long get_kernel_sym(const char *symbol)
> }
> }
>
> - fprintf(stderr, "Cannot get kernel %s symbol address\n", symbol);
> + dbgprintf("Cannot get kernel %s symbol address\n", symbol);
> return 0;
> }
>
> --
> 2.5.5
>
It looks reasonable to me:
Acked-by: Dave Young <dyoung@redhat.com>
Thanks
Dave
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH v3] Only print debug message when failed to serach for kernel symbol from /proc/kallsyms
2017-03-06 1:46 ` Dave Young
@ 2017-03-09 4:13 ` Philip Prindeville
2017-03-09 7:29 ` Baoquan He
0 siblings, 1 reply; 7+ messages in thread
From: Philip Prindeville @ 2017-03-09 4:13 UTC (permalink / raw)
To: Dave Young; +Cc: panand, horms, kexec, thgarnie, Baoquan He
Inline…
> On Mar 5, 2017, at 6:46 PM, Dave Young <dyoung@redhat.com> wrote:
>
> On 03/03/17 at 11:52am, Baoquan He wrote:
>> Kernel symbol page_offset_base could be unavailable when mm KASLR code is
>> not compiled in kernel. It's unappropriate to print out error message
I subscribed to the list the day after this patch went out… Anyway, change to “inappropriate”.
-Philip
>> when failed to search for page_offset_base from /proc/kallsyms. Seems now
>> there is not a way to find out if mm KASLR is compiled in or not. An
>> alternative approach is only printing out debug message in get_kernel_sym
>> if failed to search a expected kernel symbol.
>>
>> Do it in this patch, a simple fix.
>>
>> Signed-off-by: Baoquan He <bhe@redhat.com>
>> ---
>> kexec/arch/i386/crashdump-x86.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
>> index 88aeee3..c4cf201 100644
>> --- a/kexec/arch/i386/crashdump-x86.c
>> +++ b/kexec/arch/i386/crashdump-x86.c
>> @@ -127,7 +127,7 @@ static unsigned long long get_kernel_sym(const char *symbol)
>> }
>> }
>>
>> - fprintf(stderr, "Cannot get kernel %s symbol address\n", symbol);
>> + dbgprintf("Cannot get kernel %s symbol address\n", symbol);
>> return 0;
>> }
>>
>> --
>> 2.5.5
>>
>
> It looks reasonable to me:
>
> Acked-by: Dave Young <dyoung@redhat.com>
>
> Thanks
> Dave
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH v3] Only print debug message when failed to serach for kernel symbol from /proc/kallsyms
2017-03-09 4:13 ` Philip Prindeville
@ 2017-03-09 7:29 ` Baoquan He
2017-03-10 9:14 ` Simon Horman
0 siblings, 1 reply; 7+ messages in thread
From: Baoquan He @ 2017-03-09 7:29 UTC (permalink / raw)
To: Philip Prindeville; +Cc: panand, kexec, horms, Dave Young, thgarnie
On 03/08/17 at 09:13pm, Philip Prindeville wrote:
> Inline…
>
>
> > On Mar 5, 2017, at 6:46 PM, Dave Young <dyoung@redhat.com> wrote:
> >
> > On 03/03/17 at 11:52am, Baoquan He wrote:
> >> Kernel symbol page_offset_base could be unavailable when mm KASLR code is
> >> not compiled in kernel. It's unappropriate to print out error message
>
> I subscribed to the list the day after this patch went out… Anyway, change to “inappropriate”.
Indeed, not sure if Simon want a repost.
Thanks, nice catch!
>
> -Philip
>
>
> >> when failed to search for page_offset_base from /proc/kallsyms. Seems now
> >> there is not a way to find out if mm KASLR is compiled in or not. An
> >> alternative approach is only printing out debug message in get_kernel_sym
> >> if failed to search a expected kernel symbol.
> >>
> >> Do it in this patch, a simple fix.
> >>
> >> Signed-off-by: Baoquan He <bhe@redhat.com>
> >> ---
> >> kexec/arch/i386/crashdump-x86.c | 2 +-
> >> 1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/kexec/arch/i386/crashdump-x86.c b/kexec/arch/i386/crashdump-x86.c
> >> index 88aeee3..c4cf201 100644
> >> --- a/kexec/arch/i386/crashdump-x86.c
> >> +++ b/kexec/arch/i386/crashdump-x86.c
> >> @@ -127,7 +127,7 @@ static unsigned long long get_kernel_sym(const char *symbol)
> >> }
> >> }
> >>
> >> - fprintf(stderr, "Cannot get kernel %s symbol address\n", symbol);
> >> + dbgprintf("Cannot get kernel %s symbol address\n", symbol);
> >> return 0;
> >> }
> >>
> >> --
> >> 2.5.5
> >>
> >
> > It looks reasonable to me:
> >
> > Acked-by: Dave Young <dyoung@redhat.com>
> >
> > Thanks
> > Dave
>
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH v3] Only print debug message when failed to serach for kernel symbol from /proc/kallsyms
2017-03-09 7:29 ` Baoquan He
@ 2017-03-10 9:14 ` Simon Horman
2017-03-10 9:23 ` Baoquan He
0 siblings, 1 reply; 7+ messages in thread
From: Simon Horman @ 2017-03-10 9:14 UTC (permalink / raw)
To: Baoquan He; +Cc: panand, kexec, Philip Prindeville, Dave Young, thgarnie
On Thu, Mar 09, 2017 at 03:29:45PM +0800, Baoquan He wrote:
> On 03/08/17 at 09:13pm, Philip Prindeville wrote:
> > Inline…
> >
> >
> > > On Mar 5, 2017, at 6:46 PM, Dave Young <dyoung@redhat.com> wrote:
> > >
> > > On 03/03/17 at 11:52am, Baoquan He wrote:
> > >> Kernel symbol page_offset_base could be unavailable when mm KASLR code is
> > >> not compiled in kernel. It's unappropriate to print out error message
> >
> > I subscribed to the list the day after this patch went out… Anyway, change to “inappropriate”.
>
> Indeed, not sure if Simon want a repost.
No need, I have fixed up the change log and applied the patch.
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v3] Only print debug message when failed to serach for kernel symbol from /proc/kallsyms
2017-03-10 9:14 ` Simon Horman
@ 2017-03-10 9:23 ` Baoquan He
0 siblings, 0 replies; 7+ messages in thread
From: Baoquan He @ 2017-03-10 9:23 UTC (permalink / raw)
To: Simon Horman; +Cc: panand, kexec, Philip Prindeville, Dave Young, thgarnie
On 03/10/17 at 10:14am, Simon Horman wrote:
> On Thu, Mar 09, 2017 at 03:29:45PM +0800, Baoquan He wrote:
> > On 03/08/17 at 09:13pm, Philip Prindeville wrote:
> > > Inline…
> > >
> > >
> > > > On Mar 5, 2017, at 6:46 PM, Dave Young <dyoung@redhat.com> wrote:
> > > >
> > > > On 03/03/17 at 11:52am, Baoquan He wrote:
> > > >> Kernel symbol page_offset_base could be unavailable when mm KASLR code is
> > > >> not compiled in kernel. It's unappropriate to print out error message
> > >
> > > I subscribed to the list the day after this patch went out… Anyway, change to “inappropriate”.
> >
> > Indeed, not sure if Simon want a repost.
>
> No need, I have fixed up the change log and applied the patch.
Thanks, Simon!
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2017-03-10 9:23 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-03 3:52 [PATCH v3] Only print debug message when failed to serach for kernel symbol from /proc/kallsyms Baoquan He
2017-03-03 4:05 ` Pratyush Anand
2017-03-06 1:46 ` Dave Young
2017-03-09 4:13 ` Philip Prindeville
2017-03-09 7:29 ` Baoquan He
2017-03-10 9:14 ` Simon Horman
2017-03-10 9:23 ` Baoquan He
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox