Re: [PATCH] Fix for the invalid linux_banner pointer issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, Kazu
Thank you for the comment.
On Fri, Sep 16, 2022 at 3:42 PM HAGIO KAZUHITO(萩尾 一仁) <k-hagio-ab@xxxxxxx> wrote:
On 2022/09/16 15:00, Lianbo Jiang wrote:
> Currently, crash may fail with the following error:
>
>    # ./crash vmlinux /var/crash/127.0.0.1-2022-09-15-09:31:55/vmcore -s
>    WARNING: invalid linux_banner pointer: 65762078756e694c
>    crash: vmlinux and /var/crash/127.0.0.1-2022-09-15-09:31:55/vmcore do not match!
>
> The reason is that the type of symbols in the data segment may be
> defined as 'D' or 'd'. The crash only handled the type 'D', but it
> didn't deal with the type 'd'. For example:
>
>    # nm vmlinux |grep linux_banner
>    ffffffff827cfa80 d linux_banner
>
> Let's add the type 'd' recognition to solve such issue.

Thank you for the fix, the patch diff looks good.

I've searched for a vmlinux that its symbol type is 'd', but not found.
Do you know what makes it 'd'?  It would be better to add the cause to
the commit log, for future reference.

 
The kernel package(vmlinux) is built on x86 _64 machines by clang, the type of symbol 'linux_banner' is defined as 'd' instead of 'D', but for gcc, usually it is the type 'D'.

Hope this helps.
 
Thanks.
Lianbo

Thanks,
Kazu

>
> Signed-off-by: Lianbo Jiang <lijiang@xxxxxxxxxx>
> ---
>   kernel.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel.c b/kernel.c
> index a521ef30cdb0..aa030e8097ea 100644
> --- a/kernel.c
> +++ b/kernel.c
> @@ -1060,7 +1060,7 @@ verify_version(void)
>       if (!(sp = symbol_search("linux_banner")))
>               error(FATAL, "linux_banner symbol does not exist?\n");
>       else if ((sp->type == 'R') || (sp->type == 'r') ||
> -             (THIS_KERNEL_VERSION >= LINUX(2,6,11) && sp->type == 'D') ||
> +             (THIS_KERNEL_VERSION >= LINUX(2,6,11) && (sp->type == 'D' || sp->type == 'd')) ||
>                (machine_type("ARM") && sp->type == 'T') ||
>                (machine_type("ARM64")))
>               linux_banner = symbol_value("linux_banner");
--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://listman.redhat.com/mailman/listinfo/crash-utility
Contribution Guidelines: https://github.com/crash-utility/crash/wiki

[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux