Backport from the upstream crash-gcore.
commit 4cb65a0d9168778d120920418b968d05da10989f
Author: HATAYAMA Daisuke <d.hatayama@fujitsu.com>
Date: Fri Feb 25 04:59:48 2022 -0500
gcore: fix memory allocation failure during processing NT_AUXV note
For crash dumps generated using kernel-4.18.0-365.el8 or later on
CentOS stream 8, crash gcore command fails as follows:
crash> gcore -v 7 -f 128 10604
gcore: Opening file core.10604.test-dumpfilter ...
gcore: done.
gcore: Writing ELF header ...
gcore: done.
gcore: Retrieving and writing note information ...
gcore: zero-size memory allocation! (called from 7fd558ce1e05)
Failed.
This memory allocation failure occurs in fill_auxv_note() that creates
NT_AUXV note due to saved_auxv entries of size and offset tables are
somehow 0.
This is because during the merge of the upstream kernel commit
1c33bb0507508af24fd754dd7123bd8e997fab2f (x86/elf: Support a new ELF
aux vector AT_MINSIGSTKSZ), location of saved_auxv of struct mm_struct
has been moved as workaround in order to avoid kABI breakage.
Fix this by using RHEL-specific location for saved_auxv if there is
member rh_reserved_saved_auxv in struct mm_struct.
Signed-off-by: HATAYAMA Daisuke <d.hatayama@fujitsu.com>
Signed-off-by: HATAYAMA Daisuke <d.hatayama@fujitsu.com>
Backport from the upstream crash-gcore.
commit 6f4357340807f70bd1999f0b88435361c583f0b9
Author: HATAYAMA Daisuke <d.hatayama@fujitsu.com>
Date: Fri Feb 25 04:51:06 2022 -0500
gcore, defs: remove definitions and initializations for saved_auxv entries of offset and size tables
saved_auxv entries of offset and size tables are now not used in the
source code by the previous commit. Let's remove definitions and
initializations for them.
Signed-off-by: HATAYAMA Daisuke <d.hatayama@fujitsu.com>
Signed-off-by: HATAYAMA Daisuke <d.hatayama@fujitsu.com>
Backport from the upstream crash-gcore.
commit 4731ebf085fe6322ba8c7ca14918d3cab2186cf0
Author: HATAYAMA Daisuke <d.hatayama@fujitsu.com>
Date: Fri Feb 25 04:45:37 2022 -0500
coredump: use MEMBER_{OFFSET, SIZE} instead of GCORE_{OFFSET, SIZE}
fill_auxv_note() and compat_fill_auxv_note() is called just once each
time gcore command is invoked because each process has just one
NT_AUXV. This means using MEMBER_{OFFSET, SIZE} is enough; using
GCORE_{OFFSET, SIZE} is overkill.
Signed-off-by: HATAYAMA Daisuke <d.hatayama@fujitsu.com>
Signed-off-by: HATAYAMA Daisuke <d.hatayama@fujitsu.com>
This commit retries the update to the latest upstream release because
the previous commit didn't update the tarball.
Signed-off-by: HATAYAMA Daisuke <d.hatayama@fujitsu.com>
Signed-off-by: HATAYAMA Daisuke <d.hatayama@fujitsu.com>