Go to file
Philipp Rudo ca5a33855f s390: handle R_390_PLT32DBL reloc entries in machine_apply_elf_rel()
Resolves: bz2025860
Upstream: git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git

commit 186e7b0752d8fce1618fa37519671c834c46340e
Author: Alexander Egorenkov <egorenar@linux.ibm.com>
Date:   Wed Dec 15 18:48:53 2021 +0100

    s390: handle R_390_PLT32DBL reloc entries in machine_apply_elf_rel()

    Starting with gcc 11.3, the C compiler will generate PLT-relative function
    calls even if they are local and do not require it. Later on during linking,
    the linker will replace all PLT-relative calls to local functions with
    PC-relative ones. Unfortunately, the purgatory code of kexec/kdump is
    not being linked as a regular executable or shared library would have been,
    and therefore, all PLT-relative addresses remain in the generated purgatory
    object code unresolved. This in turn lets kexec-tools fail with
    "Unknown rela relocation: 0x14 0x73c0901c" for such relocation types.

    Furthermore, the clang C compiler has always behaved like described above
    and this commit should fix the purgatory code built with the latter.

    Because the purgatory code is no regular executable or shared library,
    contains only calls to local functions and has no PLT, all R_390_PLT32DBL
    relocation entries can be resolved just like a R_390_PC32DBL one.

    * https://refspecs.linuxfoundation.org/ELF/zSeries/lzsabi0_zSeries/x1633.html#AEN1699

    Relocation entries of purgatory code generated with gcc 11.3
    ------------------------------------------------------------

    $ readelf -r purgatory/purgatory.o

    Relocation section '.rela.text' at offset 0x6e8 contains 27 entries:
      Offset          Info           Type           Sym. Value    Sym. Name + Addend
    00000000000c  000300000013 R_390_PC32DBL     0000000000000000 .data + 2
    00000000001a  001000000014 R_390_PLT32DBL    0000000000000000 sha256_starts + 2
    000000000030  001100000014 R_390_PLT32DBL    0000000000000000 sha256_update + 2
    000000000046  001200000014 R_390_PLT32DBL    0000000000000000 sha256_finish + 2
    000000000050  000300000013 R_390_PC32DBL     0000000000000000 .data + 102
    00000000005a  001300000014 R_390_PLT32DBL    0000000000000000 memcmp + 2
    ...
    000000000118  001600000014 R_390_PLT32DBL    0000000000000000 setup_arch + 2
    00000000011e  000300000013 R_390_PC32DBL     0000000000000000 .data + 2
    00000000012c  000f00000014 R_390_PLT32DBL    0000000000000000 verify_sha256_digest + 2
    000000000142  001700000014 R_390_PLT32DBL    0000000000000000
    post_verification[...] + 2

    Relocation entries of purgatory code generated with gcc 11.2
    ------------------------------------------------------------

    $ readelf -r purgatory/purgatory.o

    Relocation section '.rela.text' at offset 0x6e8 contains 27 entries:
      Offset          Info           Type           Sym. Value    Sym. Name + Addend
    00000000000e  000300000013 R_390_PC32DBL     0000000000000000 .data + 2
    00000000001c  001000000013 R_390_PC32DBL     0000000000000000 sha256_starts + 2
    000000000036  001100000013 R_390_PC32DBL     0000000000000000 sha256_update + 2
    000000000048  001200000013 R_390_PC32DBL     0000000000000000 sha256_finish + 2
    000000000052  000300000013 R_390_PC32DBL     0000000000000000 .data + 102
    00000000005c  001300000013 R_390_PC32DBL     0000000000000000 memcmp + 2
    ...
    00000000011a  001600000013 R_390_PC32DBL     0000000000000000 setup_arch + 2
    000000000120  000300000013 R_390_PC32DBL     0000000000000000 .data + 122
    000000000130  000f00000013 R_390_PC32DBL     0000000000000000 verify_sha256_digest + 2
    000000000146  001700000013 R_390_PC32DBL     0000000000000000 post_verification[...] + 2

    Corresponding s390 kernel discussion:
    * https://lore.kernel.org/linux-s390/20211208105801.188140-1-egorenar@linux.ibm.com/T/#u

    Signed-off-by: Alexander Egorenkov <egorenar@linux.ibm.com>
    Reported-by: Tao Liu <ltao@redhat.com>
    Suggested-by: Philipp Rudo <prudo@redhat.com>
    Reviewed-by: Philipp Rudo <prudo@redhat.com>
    [hca@linux.ibm.com: changed commit message as requested by Philipp Rudo]
    Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
    Signed-off-by: Simon Horman <horms@verge.net.au>

v2:
   - Moved patch 601 -> 401

Signed-off-by: Philipp Rudo <prudo@redhat.com>
Acked-by: Coiby Xu <coxu@redhat.com>
2022-01-26 08:25:43 +08:00
tests selftest: Add early kdump test 2022-01-24 11:18:00 +08:00
.editorconfig kdump-lib-initramfs.sh: prepare to be a POSIX compatible lib 2021-09-14 03:25:46 +08:00
.gitignore .gitignore: Update to make it more generic 2016-05-16 10:15:01 +08:00
60-kdump.install Write to `/var/lib/kdump` if $KDUMP_BOOTDIR not writable 2021-04-19 16:11:17 +08:00
92-crashkernel.install reset kernel crashkernel for the special case where the kernel is updated right after kexec-tools 2022-01-05 09:40:24 +08:00
98-kexec.rules Make udev reload rules quiet during bootup 2018-12-06 17:44:03 +08:00
98-kexec.rules.ppc64 Stop reloading kdump service on CPU hotplug event for FADump 2021-03-10 16:24:42 +08:00
README README: Add a README file 2014-04-02 10:45:36 +08:00
crashkernel-howto.txt update crashkernel-howto 2022-01-05 09:40:24 +08:00
dracut-early-kdump-module-setup.sh dracut-early-kdump-module-setup.sh: install xargs and kdump-lib-initramfs.sh 2021-12-27 09:16:19 +08:00
dracut-early-kdump.sh dracut-early-kdump.sh: make it POSIX compatible 2021-09-15 23:11:37 +08:00
dracut-fadump-init-fadump.sh fadump-init: clean up mount points properly 2021-06-30 17:28:45 +08:00
dracut-fadump-module-setup.sh fadump: isolate fadump initramfs image within the default one 2021-06-29 21:35:58 +08:00
dracut-kdump-capture.service dracut-kdump-capture.service: Use OnFailureJobMode instead of deprecated OnFailureIsolate 2019-06-14 09:44:09 +08:00
dracut-kdump-emergency.service Merge kdump-error-handler.sh into kdump.sh 2021-09-14 03:25:54 +08:00
dracut-kdump-emergency.target kdump-emergency: fix "Transaction is destructive" emergency failure 2017-03-31 11:54:30 +08:00
dracut-kdump.sh Add header comment for POSIX compliant scripts 2021-09-15 23:11:37 +08:00
dracut-module-setup.sh ppc64/ppc64le: drop cpu online rule in 40-redhat.rules in kdump initramfs 2021-12-23 15:40:23 +08:00
dracut-monitor_dd_progress monitor-dd-progress fix 2013-06-25 16:45:59 +08:00
early-kdump-howto.txt Improves the early-kdump-howto.txt document in several points: 2020-03-12 23:31:34 +08:00
fadump-howto.txt Clear old crashkernl=auto in comment and doc 2021-08-05 17:54:20 +08:00
kdump-dep-generator.sh logger: source the logger file individually 2021-01-20 14:13:44 +08:00
kdump-in-cluster-environment.txt Add fence_kdump support for generic clusters 2014-04-03 14:43:06 +08:00
kdump-lib-initramfs.sh move variable FENCE_KDUMP_SEND from kdump-lib.sh to kdump-lib-initramfs.sh 2022-01-18 14:22:24 +08:00
kdump-lib.sh Revert "Remove trace_buf_size and trace_event from the kernel bootparameters of the kdump kernel" 2022-01-26 08:23:11 +08:00
kdump-logger.sh Add header comment for POSIX compliant scripts 2021-09-15 23:11:37 +08:00
kdump-migrate-action.sh kdump/ppc64: rebuild initramfs image after migration 2021-07-21 10:53:59 +08:00
kdump-restart.sh kdump/ppc64: rebuild initramfs image after migration 2021-07-21 10:53:59 +08:00
kdump-udev-throttler Make udev reload rules quiet during bootup 2018-12-06 17:44:03 +08:00
kdump.conf introduce the auto_reset_crashkernel option to kdump.conf 2022-01-05 09:40:24 +08:00
kdump.conf.5 introduce the auto_reset_crashkernel option to kdump.conf 2022-01-05 09:40:24 +08:00
kdump.service kdump.service: use ConditionKernelCommandLine=crashkernel 2020-10-27 12:22:36 -04:00
kdump.sysconfig Disable CMA in kdump 2nd kernel 2021-05-13 17:13:39 +08:00
kdump.sysconfig.aarch64 sysconfig: make kexec_file_load as default option on aarch64 2021-11-12 11:46:31 +08:00
kdump.sysconfig.i386 Disable CMA in kdump 2nd kernel 2021-05-13 17:13:39 +08:00
kdump.sysconfig.ppc64 Disable CMA in kdump 2nd kernel 2021-05-13 17:13:39 +08:00
kdump.sysconfig.ppc64le sysconfig: make kexec_file_load as default option on ppc64le 2021-11-12 11:47:27 +08:00
kdump.sysconfig.s390x kdump.sysconfig.s390: Remove "prot_virt" from kdump kernel cmdline 2021-07-20 15:57:05 +08:00
kdump.sysconfig.x86_64 Revert "Revert "x86_64: enable the kexec file load by default"" 2021-07-14 02:03:10 +08:00
kdumpctl fix "kdump: Invalid kdump config option auto_reset_crashkernel" error 2022-01-07 12:20:37 +08:00
kdumpctl.8 rewrite reset_crashkernel to support fadump and to used by RPM scriptlet 2022-01-05 09:40:24 +08:00
kexec-kdump-howto.txt Document/kexec-kdump-howto.txt: improve notes for kdump_pre and kdump_post scripts 2021-11-16 13:30:29 +08:00
kexec-tools-2.0.23-s390_handle_R_390_PLT32DBL_reloc_entries_in_machine_apply_elf_rel_.patch s390: handle R_390_PLT32DBL reloc entries in machine_apply_elf_rel() 2022-01-26 08:25:43 +08:00
kexec-tools.spec s390: handle R_390_PLT32DBL reloc entries in machine_apply_elf_rel() 2022-01-26 08:25:43 +08:00
live-image-kdump-howto.txt Revert "kdumpctl: filter 'root' kernel parameter when running in live images" 2017-04-11 16:03:12 +08:00
mkdumprd Set zstd as recommented for kexec-tools 2022-01-11 10:11:21 +08:00
mkdumprd.8 Doc: improve mkdumprd man page 2020-12-11 14:05:08 +08:00
mkfadumprd Set zstd as recommented for kexec-tools 2022-01-11 10:11:21 +08:00
sources Release 2.0.23-1 2021-11-08 14:42:45 +08:00
zanata-notes.txt Add a notes for zanata process 2012-12-05 01:23:09 -05:00

README

Adding a patch to kexec-tools
=============================
There is a mailing list kexec@lists.fedoraproject.org where all the dicussion
related to fedora kexec-tools happen. All the patches are posted there for
inclusion and committed to kexec-tools after review.

So if you want your patches to be included in fedora kexec-tools package,
post these to kexec@lists.fedoraproject.org.

One can subscribe to list and browse through archives here.

https://admin.fedoraproject.org/mailman/listinfo/kexec