Gcore extension module for the crash utility
Go to file
HATAYAMA Daisuke a0cea9fcec coredump: fix segmentation fault caused by type mismatch
Backport from the upstream crash-gcore.

commit 1ba701c1d7bd94cc5a02f51652712acdcbf0875c
Author: Vincent Whitchurch <vincent.whitchurch@axis.com>
Date:   Tue Jun 21 09:15:33 2022 +0000

    coredump: fix segmentation fault caused by type mismatch

    crash gcore command on ARM sometimes results in segmentation fault:

        crash> gcore -v 0
        Segmentation fault (core dumped)

    This is caused by type mismatch of a variable paddr in function
    gcore_readmem_user() to hold a physical address, which is indicated by
    the following warning message:

     libgcore/gcore_coredump.c: In function ‘gcore_readmem_user’:
     libgcore/gcore_coredump.c:85:26: warning: passing argument 2 of
     ‘uvtop_quiet’ from incompatible pointer type
     [-Wincompatible-pointer-types]

        if (!uvtop_quiet(addr, &paddr)) {
                               ^~~~~~
     libgcore/gcore_coredump.c:71:49: note: expected ‘physaddr_t *’ {aka
     ‘long long unsigned int *’} but argument is of type ‘ulong *’ {aka ‘long
     unsigned int *’}

      static int uvtop_quiet(ulong vaddr, physaddr_t *paddr);
                                          ~~~~~~~~~~~~^~~~~

    On ARM, long unsigned int has 4 byte length, while physaddr_t has 8
    byte length. The mismatch causes overwriting of stack variables.

    Fix this by changing the type of the variable paddr to physaddr_t.

    Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>

Signed-off-by: HATAYAMA Daisuke <d.hatayama@fujitsu.com>
2022-07-26 15:13:44 +09:00
.gitignore Update to latest upstream release v2 2021-12-20 06:18:09 +09:00
crash-gcore-1.6.3-coredump-fix-segmentation-fault-caused-by-type-misma.patch coredump: fix segmentation fault caused by type mismatch 2022-07-26 15:13:44 +09:00
crash-gcore-1.6.3-coredump-use-MEMBER_-OFFSET-SIZE-instead-of-GCORE_-O.patch coredump: use MEMBER_{OFFSET, SIZE} instead of GCORE_{OFFSET, SIZE} 2022-07-26 15:13:32 +09:00
crash-gcore-1.6.3-gcore-defs-remove-definitions-and-initializations-fo.patch gcore, defs: remove definitions and initializations for saved_auxv entries of offset and size tables 2022-07-26 15:13:38 +09:00
crash-gcore-1.6.3-gcore-fix-memory-allocation-failure-during-processin.patch gcore: fix memory allocation failure during processing NT_AUXV note 2022-07-26 15:13:40 +09:00
crash-gcore-1.6.3-x86-Fix-failure-of-collecting-vsyscall-mapping-due-t.patch x86: Fix failure of collecting vsyscall mapping due to change of enum type of vsyscall_mode 2022-07-26 15:13:42 +09:00
crash-gcore-command.spec Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild 2022-07-20 23:43:32 +00:00
README.md Added the README 2021-02-17 14:38:01 +00:00
sources Update to latest upstream release v2 2021-12-20 06:18:09 +09:00

crash-gcore-command

The crash-gcore-command package