Unnamed repository
Go to file
WANG Chao 75c9162996 makedumpfile: memset() in cyclic bitmap initialization introduce segment fault.
This is a backport of the following upstream commit:

commit 4404368
Author: WANG Chao <chaowang@redhat.com>
Date:   Wed Dec 18 22:34:43 2013 +0900

    [PATCH] memset() in cyclic bitmap initialization introduce segment fault.

    We are using memset() to improve performance when creating 1st and 2nd
    bitmap. After doing round up the pfn_start and round down pfn_end, it's
    possible that pfn_start_roundup is greater than pfn_end_round. A segment
    fault could happen in that case because memset is taking roughly the
    value of (pfn_end_round << 3 - pfn_start_roundup << 3 ), which is
    negative, as its third argument.

    So we can skip the memset if start is greater than end. It's safe
    because we will set bit for the round up part and also round down part.

    Actually this happens on my EFI virtual machine:

    cat /proc/iomem:
    00000000-00000fff : reserved
    00001000-0009ffff : System RAM
    000a0000-000bffff : PCI Bus 0000:00
    000f0000-000fffff : System ROM
    00100000-3d162017 : System RAM
      01000000-015cab9b : Kernel code
      015cab9c-019beb3f : Kernel data
      01b4f000-01da9fff : Kernel bss
      30000000-37ffffff : Crash kernel
    3d162018-3d171e57 : System RAM
    3d171e58-3d172017 : System RAM
    3d172018-3d17ae57 : System RAM
    3d17ae58-3dc10fff : System RAM
    3dc11000-3dc18fff : reserved
    3dc19000-3dc41fff : System RAM
    3dc42000-3ddcefff : reserved
    3ddcf000-3f7fefff : System RAM
    3f7ff000-3f856fff : reserved
    [..]

    gdb ./makedumpfile core
    (gdb) bt full
    [..]
     #1  0x000000000042775d in create_1st_bitmap_cyclic () at makedumpfile.c:4543
            i = 0x5
            pfn = 0x3d190
            phys_start = 0x3d18ee58
            phys_end = 0x3d18f018
            pfn_start = 0x3d18e
            pfn_end = 0x3d18f
            pfn_start_roundup = 0x3d190
            pfn_end_round = 0x3d188
            pfn_start_byte = 0x7a32
            pfn_end_byte = 0x7a31
    [..]
    (gdb) list makedumpfile.c:4543
    4538                                        return FALSE;
    4539
    4540                        pfn_start_byte = (pfn_start_roundup - info->cyclic_start_pfn) >> 3;
    4541                        pfn_end_byte = (pfn_end_round - info->cyclic_start_pfn) >> 3;
    4542
    4543                        memset(info->partial_bitmap2 + pfn_start_byte,
    4544                               0xff,
    4545                               pfn_end_byte - pfn_start_byte);
    4546
    4547                        for (pfn = pfn_end_round; pfn < pfn_end; ++pfn)

    Signed-off-by: WANG Chao <chaowang@redhat.com>

This patch fixes segment fault issues on the systems with very small
memory map range (less than 8 pages).

Signed-off-by: WANG Chao <chaowang@redhat.com>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
2014-01-29 16:31:04 +08:00
po Translation, Makefile: add make tgz option to auto pack po files 2013-12-24 14:25:23 +08:00
.gitignore Rebase makedumpfile-1.5.5 2014-01-28 13:04:36 +08:00
98-kexec.rules udev rules fix 2012-05-28 09:50:47 +08:00
dracut-kdump.sh kdump.sh: send fence kdump message to other nodes in the cluster 2014-01-29 16:20:06 +08:00
dracut-module-setup.sh module-setup.sh: do not add duplicate ip=xxx to 40ip.conf 2014-01-29 16:20:06 +08:00
dracut-monitor_dd_progress monitor-dd-progress fix 2013-06-25 16:45:59 +08:00
firstboot_kdump.py firstboot:fix reserve mem ui spinbox step size 2012-12-12 17:15:10 +08:00
kdump-in-cluster-environment.txt Add a kdump-in-cluster-environment.txt in RPM package 2014-01-29 16:20:06 +08:00
kdump-lib.sh kdump-lib: add common variables and function for fence kdump 2014-01-29 16:20:06 +08:00
kdump.conf kdump.conf: uncomment default core_collector line 2014-01-17 11:32:47 +08:00
kdump.conf.5 makedumpfile compression method default to lzo 2013-12-24 14:25:07 +08:00
kdump.init - Fix a syntax error in kdump init script 2010-06-13 21:54:34 +00:00
kdump.service kdump.service: Start kdump after network is online and remote fs is mounted 2013-09-27 10:07:13 +08:00
kdump.sysconfig do not mount root twice 2012-07-12 11:15:35 +08:00
kdump.sysconfig.i386 kdump.sysconfig: default to "nofail" mount 2013-09-27 15:45:24 +08:00
kdump.sysconfig.ia64 Mass Update of RHEL5 patches 2008-06-05 15:18:53 +00:00
kdump.sysconfig.ppc64 kdump.sysconfig: default to "nofail" mount 2013-09-27 15:45:24 +08:00
kdump.sysconfig.s390x s390x, sysconfig: Change maxcpus=1 to nr_cpus=1 for s390x 2014-01-22 12:52:02 +08:00
kdump.sysconfig.x86_64 Add acpi_no_memhotplug to kdump kernel 2014-01-29 16:25:57 +08:00
kdumpctl kdumpctl: rebuild kdump initramfs if cluster or fence_kdump config is changed. 2014-01-29 16:20:06 +08:00
kexec-kdump-howto.txt makedumpfile compression method default to lzo 2013-12-24 14:25:07 +08:00
kexec-tools-2.0.3-build-makedumpfile-eppic-shared-object.patch Rebase makedumpfile-1.5.5 2014-01-28 13:04:36 +08:00
kexec-tools-2.0.3-disable-kexec-test.patch Disable kexec_test 2012-01-21 16:56:07 +08:00
kexec-tools-2.0.4-kdump-x86-Process-multiple-Crash-kernel-in-proc-iome.patch kdump, x86: Process multiple Crash kernel in /proc/iomem 2013-10-29 13:17:31 +08:00
kexec-tools-2.0.4-kexec-i386-Add-cmdline_add_memmap_internal-to-reduce.patch Back port 2 revert commits 2013-09-27 17:01:24 +08:00
kexec-tools-2.0.4-makedumpfile-memset-in-cyclic-bitmap-initialization-introdu.patch makedumpfile: memset() in cyclic bitmap initialization introduce segment fault. 2014-01-29 16:31:04 +08:00
kexec-tools-2.0.4-Revert-kexec-include-reserved-e820-sections-in-crash.patch Back port 2 revert commits 2013-09-27 17:01:24 +08:00
kexec-tools-2.0.4-Revert-kexec-lengthen-the-kernel-command-line-image.patch Back port 2 revert commits 2013-09-27 17:01:24 +08:00
kexec-tools-2.0.4-vmcore-dmesg-struct_val_u64-not-casting-u64-to-u32.patch vmcore-dmesg: struct_val_u64() not casting u64 to u32 2014-01-17 11:32:48 +08:00
kexec-tools.spec makedumpfile: memset() in cyclic bitmap initialization introduce segment fault. 2014-01-29 16:31:04 +08:00
mkdumprd ssh: use ssh -n to redirect stdin from /dev/null 2014-01-17 11:32:47 +08:00
mkdumprd.8 Remove comma which is redundant 2013-02-16 15:19:41 +08:00
rhcrashkernel-param rhcrashkernel-param: echo crashkernel=auto for rhel7 2012-08-20 15:01:47 +08:00
sources Rebase makedumpfile-1.5.5 2014-01-28 13:04:36 +08:00
zanata-notes.txt Add a notes for zanata process 2012-12-05 01:23:09 -05:00