[PATCH v2 0/3] Preparing for running kexec-tools tests from dracut
by Coiby Xu
kexec-tools heavily depends on dracut and occasionally breaks
because the change of dracut.
I'm now adding kdump test [1] to dracut which will clone kexec-tools'
rawhide branch and run kexec-tools' basic functionality tests.
This patch set prepares kexec-tools for running its tests from dracut.
[1] https://github.com/coiby/dracut/tree/kexec_tools_tests
v1 -> v2:
- s/DRACUT_RPMs/EXTRA_RPMS [Kairui]
Coiby Xu (3):
selftest: Fix bug of collecting test RPMs from argument
selftest: add EXTRA_RPMs so dracut RPMs can be installed onto the
image to run the tests
selftest: replace qemu-kvm with one based on dracut's run-qemu
tests/Makefile | 2 +-
.../scripts/build-scripts/test-base-image.sh | 2 +-
tests/scripts/run-qemu | 23 +++++++++++++++++++
tests/scripts/test-lib.sh | 2 +-
4 files changed, 26 insertions(+), 3 deletions(-)
create mode 100755 tests/scripts/run-qemu
--
2.31.0
3 years, 1 month
[PATCH] mkdumprd: prompt the user to install nfs-utils when mounting NFS fs failed
by Coiby Xu
When nfs-utils is not installed, mounting as NFS fs would fail.
Currently, the error message is not user-friendly,
mount: /tmp/mkdumprd.HyPGpS/target: bad option; for several filesystems (e.g. nfs, cifs) you might need a /sbin/mount.<type> helper program.
kdump: Failed to mount on xxx for kdump preflight check.
kdump: mkdumprd: failed to make kdump initrd
Prompt the user to install nfs-utilsa in the error message,
kdump: Failed to mount on xxx for kdump preflight check. Please make sure nfs-utils has been installed.
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
---
mkdumprd | 24 ++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
diff --git a/mkdumprd b/mkdumprd
index c34b79c..50ebdc8 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -185,6 +185,26 @@ check_save_path_fs()
fi
}
+mount_failure()
+{
+ local _target=$1
+ local _mnt=$2
+ local _fstype=$3
+ local msg="Failed to mount $_target"
+
+ if [ -n "$_mnt" ]; then
+ msg="$msg on $_mnt"
+ fi
+
+ msg="$msg for kdump preflight check."
+
+ if [[ $_fstype = "nfs" ]]; then
+ msg="$msg Please make sure nfs-utils has been installed."
+ fi
+
+ perror_exit "$msg"
+}
+
check_user_configured_target()
{
local _target=$1 _cfg_fs_type=$2 _mounted
@@ -210,7 +230,7 @@ check_user_configured_target()
if ! is_mounted "$_mnt"; then
if [[ $_opt = *",noauto"* ]]; then
mount $_mnt
- [ $? -ne 0 ] && perror_exit "Failed to mount $_target on $_mnt for kdump preflight check."
+ [ $? -ne 0 ] && mount_failure "$_target" "$_mnt" "$_fstype"
_mounted=$_mnt
else
perror_exit "Dump target \"$_target\" is neither mounted nor configured as \"noauto\""
@@ -220,7 +240,7 @@ check_user_configured_target()
_mnt=$MKDUMPRD_TMPMNT
mkdir -p $_mnt
mount $_target $_mnt -t $_fstype -o defaults
- [ $? -ne 0 ] && perror_exit "Failed to mount $_target for kdump preflight check."
+ [ $? -ne 0 ] && mount_failure "$_target" "" "$_fstype"
_mounted=$_mnt
fi
--
2.30.0
3 years, 1 month
[PATCH 0/3] Preparing for running kexec-tools from dracut
by Coiby Xu
kexec-tools heavily depends on dracut and occasionally breaks
because the change of dracut.
I'm now adding kdump test [1] to dracut which will clone kexec-tools'
rawhide branch and run kexec-tools' basic functionality tests.
This patch set prepares kexec-tools for running the tests by dracut.
[1] https://github.com/coiby/dracut/tree/kexec_tools_tests
Coiby Xu (3):
selftest: Fix bug of collecting test RPMs from argument
selftest: add DRACUT_RPMs so dracut RPMs can be installed onto the
image to run the tests
selftest: replace qemu-kvm with one based on dracut's run-qemu
tests/Makefile | 2 +-
.../scripts/build-scripts/test-base-image.sh | 2 +-
tests/scripts/run-qemu | 23 +++++++++++++++++++
tests/scripts/test-lib.sh | 2 +-
4 files changed, 26 insertions(+), 3 deletions(-)
create mode 100755 tests/scripts/run-qemu
--
2.30.1
3 years, 1 month
[PATCH] Doc: improve the kexec-kdump-howto.txt documentation
by Lianbo Jiang
Because there are some duplicated contents, this will remove the
infrequently used options descriptions from the "kexec-kdump-howto.txt",
only add the "KDUMP_COMMANDLINE_REMOVE" and "KDUMP_COMMANDLINE_APPEND".
Signed-off-by: Lianbo Jiang <lijiang(a)redhat.com>
---
kexec-kdump-howto.txt | 76 ++++++++++---------------------------------
1 file changed, 18 insertions(+), 58 deletions(-)
diff --git a/kexec-kdump-howto.txt b/kexec-kdump-howto.txt
index 88af6078ae6e..776e90f137f2 100644
--- a/kexec-kdump-howto.txt
+++ b/kexec-kdump-howto.txt
@@ -524,60 +524,20 @@ to send over the necessary ssh key file. Restart the kdump service via
Advanced Setups
===============
-About /etc/sysconfig/kdump
-------------------------------
-
-Currently, there are a few options in /etc/sysconfig/kdump, which are
-usually used to control the behavior of kdump kernel. Basically, all of
-these options have default values, usually we do not need to change them,
-but sometimes, we may modify them in order to better control the behavior
-of kdump kernel such as debug, etc.
-
--KDUMP_BOOTDIR
+Kdump boot directory
+--------------------
Usually kdump kernel is the same as 1st kernel. So kdump will try to find
kdump kernel under /boot according to /proc/cmdline. E.g we execute below
command and get an output:
cat /proc/cmdline
BOOT_IMAGE=/xxx/vmlinuz-3.yyy.zzz root=xxxx .....
+Then kdump kernel will be /boot/xxx/vmlinuz-3.yyy.zzz.
+However a variable KDUMP_BOOTDIR in /etc/sysconfig/kdump is provided to
+user if kdump kernel is put in a different directory.
-Then kdump kernel will be /boot/xxx/vmlinuz-3.yyy.zzz. However, this option
-is provided to user if kdump kernel is put in a different directory.
-
--KDUMP_IMG
-
-This represents the image type used for kdump. The default value is "vmlinuz".
-
--KDUMP_IMG_EXT
-
-This represents the images extension. Relocatable kernels don't have one.
-Currently, it is a null string by default.
-
--KEXEC_ARGS
-
-Any additional kexec arguments required. For example:
-KEXEC_ARGS="--elf32-core-headers".
-
-In most situations, this should be left empty. But, sometimes we hope to get
-additional kexec loading debugging information, we can add the '-d' option
-for the debugging.
-
--KDUMP_KERNELVER
-
-This is a kernel version string for the kdump kernel. If the version is not
-specified, the init script will try to find a kdump kernel with the same
-version number as the running kernel.
-
--KDUMP_COMMANDLINE
-
-The value of 'KDUMP_COMMANDLINE' will be passed to kdump kernel as command
-line parameters, this will likely match the contents of the grub kernel line.
-
-In general, if a command line is not specified, which means that it is a null
-string such as KDUMP_COMMANDLINE="", the default will be taken automatically
-from the '/proc/cmdline'.
-
--KDUMP_COMMANDLINE_REMOVE
+KDUMP_COMMANDLINE_REMOVE
+------------------------
This option allows us to remove arguments from the current kdump command line.
If we don't specify any parameters for the KDUMP_COMMANDLINE, it will inherit
@@ -586,29 +546,29 @@ default kernel parameters could affect kdump, furthermore, that could cause
the failure of kdump kernel boot.
In addition, the option is also helpful to debug the kdump kernel, we can use
-this option to change kdump kernel command line.
+this option to change kdump kernel command line. For example:
-For more kernel parameters, please refer to kernel document.
+KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swiotlb"
--KDUMP_COMMANDLINE_APPEND
+For more kernel parameters, please refer to kernel document:
+Documentation/admin-guide/kernel-parameters.txt.
+
+KDUMP_COMMANDLINE_APPEND
+------------------------
This option allows us to append arguments to the current kdump command line
after processed by the KDUMP_COMMANDLINE_REMOVE. For kdump kernel, some
specific modules require to be disabled like the mce, cgroup, numa, hest_disable,
etc. Those modules may waste memory or kdump kernel doesn't need them,
-furthermore, there may affect kdump kernel boot.
+furthermore, there may affect kdump kernel boot. For example:
+
+KDUMP_COMMANDLINE_APPEND="cgroup_disable=memory"
Just like above option, it can be used to disable or enable some kernel
modules so that we can exclude any errors for kdump kernel, this is very
meaningful for debugging.
--KDUMP_STDLOGLVL | KDUMP_SYSLOGLVL | KDUMP_KMSGLOGLVL
-
-These variables are used to control the kdump log level in the first kernel.
-In the second kernel, kdump will use the rd.kdumploglvl option to set the log
-level in the above KDUMP_COMMANDLINE_APPEND.
-
-Logging levels: no logging(0), error(1), warn(2), info(3), debug(4)
+For the rest of options, refer to the "/etc/sysconfig/kdump".
Kdump Post-Capture Executable
-----------------------------
--
2.29.2
3 years, 1 month
[PATCH v2 0/2] Fix failure to dump vmcore to nfs target for s390x RHEL9
by Coiby Xu
On s390x RHEL9, vmcore can't be dumped to a nfs target for the following
reasons,
1. ifcfg is retired and we can't get znet config info from
/etc/sysconfig/network-scripts any more.
2. ipcalc is not installed by default, thus static route info can't
be generated correctly.
3. rpc-statd.service can't be started because of a bug in dracut
These two patches address the first two issues and the third issue has
been addressed by Kairui [1].
[1] https://github.com/dracutdevs/dracut/pull/1063
Changes since v1:
- use regex to extract value from nmcli output and avoid using array to
simplify code [Kairui]
- take care of the case that nmcli could output
"802-3-ethernet.s390-nettype: --"
Coiby Xu (2):
read znet config from nmcli directly
add dependency on ipcalc
dracut-module-setup.sh | 41 +++++++++++++++++++++++++++++++++++++----
kexec-tools.spec | 1 +
2 files changed, 38 insertions(+), 4 deletions(-)
--
2.30.1
3 years, 1 month
[PATCH] mkdumprd: support using an fs overlay for building initrd
by Kairui Song
Currently kdump simply uses dracut and pulls all the required binaries
from the host directly. This keep things simple as kdump is using same
binaries and libs from the system of fisrt kernel.
But some binaries, like systemd, is growing too large, which increase
the memory usage by a lot, and most of its features are never used
in kdump. So it's more reasonable to use a rebuilt-minimized version.
So for such binaries, introduce a "build root" overlay here. Before
calling dracut to build initramfs, setup an overlay to let the build
root override current rootfs, so dracut can just work as usual, but the
binaries used are from the "build root".
All binaries/libs that need to be rebuild for smaller size can be put in
the build root.
---
kexec-tools.spec | 1 +
mkdumprd | 20 +++++++++++++++++++-
2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/kexec-tools.spec b/kexec-tools.spec
index 91bc0f3..1a06b62 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -171,6 +171,7 @@ mkdir -p $RPM_BUILD_ROOT%{_unitdir}
mkdir -p -m755 $RPM_BUILD_ROOT%{_bindir}
mkdir -p -m755 $RPM_BUILD_ROOT%{_libdir}
mkdir -p -m755 $RPM_BUILD_ROOT%{_prefix}/lib/kdump
+mkdir -p -m755 $RPM_BUILD_ROOT%{_prefix}/lib/kdump/buildroot
install -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/kdumpctl
install -m 755 build/sbin/kexec $RPM_BUILD_ROOT/usr/sbin/kexec
diff --git a/mkdumprd b/mkdumprd
index c34b79c..5f8d2da 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -23,6 +23,7 @@ if [ $? -ne 0 ]; then
exit 1
fi
+KDUMP_BUILDROOT="/usr/lib/kdump/buildroot"
conf_file="/etc/kdump.conf"
SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa"
SAVE_PATH=$(get_save_path)
@@ -33,12 +34,14 @@ dracut_args="--add kdumpbase --quiet --hostonly --hostonly-cmdline --hostonly-i1
readonly MKDUMPRD_TMPDIR="$(mktemp -d -t mkdumprd.XXXXXX)"
[ -d "$MKDUMPRD_TMPDIR" ] || perror_exit "dracut: mktemp -p -d -t dracut.XXXXXX failed."
+readonly MKDUMPRD_TMPROOT="$MKDUMPRD_TMPDIR/root"
readonly MKDUMPRD_TMPMNT="$MKDUMPRD_TMPDIR/target"
trap '
ret=$?;
is_mounted $MKDUMPRD_TMPMNT && umount -f $MKDUMPRD_TMPMNT;
[[ -d $MKDUMPRD_TMPDIR ]] && rm --one-file-system -rf -- "$MKDUMPRD_TMPDIR";
+ [[ -d $MKDUMPRD_TMPROOT ]] && rm --one-file-system -rf -- "$MKDUMPRD_TMPROOT";
exit $ret;
' EXIT
@@ -460,7 +463,22 @@ if ! is_fadump_capable; then
add_dracut_arg "--no-hostonly-default-device"
fi
-echo "$dracut_args $@" | xargs dracut
+if [ -n "$(ls -A1 $KDUMP_BUILDROOT | grep -E "etc|usr")" ]; then
+ # Run in a new namespace, so overlay on root is safe
+ # everything is automatically cleaned up upon exit
+ export KDUMP_BUILDROOT
+ export MKDUMPRD_TMPROOT
+ export dracut_args="$dracut_args $@"
+
+ cp -r /usr/lib/kdump/buildroot $MKDUMPRD_TMPROOT
+ unshare --mount bash -c '
+ for _d in etc usr; do
+ [ -d "$MKDUMPRD_TMPROOT/$_d" ] && mount overlay -t overlay -o ro,lowerdir=$MKDUMPRD_TMPROOT/$_d:/$_d /$_d;
+ done
+ echo "$dracut_args $@" | xargs -t dracut;'
+else
+ echo "$dracut_args $@" | xargs -t dracut
+fi
_rc=$?
sync
--
2.29.2
3 years, 1 month
[PATCH v2] GDB: prevent overflow in the rl_set_screen_size()
by Lianbo Jiang
Currently, crash uses the system readline library to build the packages,
and the readline in system has been upgraded from 8.0 to 8.1, the gdb has
an old version, which can not play with the newer readline.
GDB calls rl_set_screen_size() in readline and may pass the INT_MAX to
the rl_set_screen_size(), however, the rl_set_screen_size() internally
multiplies the number of rows and columns, which causes a signed integer
overflow.
To avoid this issue, let's reduce the "infinite" rows and columns before
calling the rl_set_screen_size().
Signed-off-by: Lianbo Jiang <lijiang(a)redhat.com>
---
Changes since v1:
[1] add the fix(in the gdb/utils.c) to the end of gdb-7.6.patch
crash.spec | 2 +
...t-overflow-in-the-rl_set_screen_size.patch | 60 +++++++++++++++++++
2 files changed, 62 insertions(+)
create mode 100644 gdb-prevent-overflow-in-the-rl_set_screen_size.patch
diff --git a/crash.spec b/crash.spec
index 8252b7baf7e6..7721e26eba79 100644
--- a/crash.spec
+++ b/crash.spec
@@ -34,6 +34,7 @@ Patch13: 0010-Fix-dev-d-option-on-Linux-5.11-rc1-and-later-kernels.patch
Patch14: 0011-Fix-kmem-v-option-on-Linux-5.11-rc1-and-later-kernel.patch
Patch15: 0012-mod-Show-the-base-address-of-module.patch
Patch16: 0013-xen-increase-__PHYSICAL_MASK_SHIFT_XEN-to-52.patch
+Patch17: gdb-prevent-overflow-in-the-rl_set_screen_size.patch
%description
The core analysis suite is a self-contained tool that can be used to
@@ -70,6 +71,7 @@ offered by Mission Critical Linux, or the LKCD kernel patch.
%patch14 -p1
%patch15 -p1
%patch16 -p1
+%patch17 -p1
%build
# This package has an internal copy of GDB which has broken configure code for
diff --git a/gdb-prevent-overflow-in-the-rl_set_screen_size.patch b/gdb-prevent-overflow-in-the-rl_set_screen_size.patch
new file mode 100644
index 000000000000..6fc2341d1625
--- /dev/null
+++ b/gdb-prevent-overflow-in-the-rl_set_screen_size.patch
@@ -0,0 +1,60 @@
+From 2f35469929ba91fd0404f1b09b32a299cac48ccf Mon Sep 17 00:00:00 2001
+From: Lianbo Jiang <lijiang(a)redhat.com>
+Date: Mon, 8 Mar 2021 13:59:21 +0800
+Subject: [PATCH] gdb: prevent overflow in the rl_set_screen_size()
+
+Signed-off-by: Lianbo Jiang <lijiang(a)redhat.com>
+---
+ gdb-7.6.patch | 38 ++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 38 insertions(+)
+
+diff --git a/gdb-7.6.patch b/gdb-7.6.patch
+index f64b55fe547a..468ff2d02abc 100644
+--- a/gdb-7.6.patch
++++ b/gdb-7.6.patch
+@@ -2500,4 +2500,42 @@ diff -up gdb-7.6/opcodes/configure.orig gdb-7.6/opcodes/configure
+ +struct target_desc *tdesc_aarch64;
+ #include "features/aarch64.c"
+ #include "features/aarch64-without-fpu.c"
++
++--- gdb-7.6/gdb/utils.c.orig
+++++ gdb-7.6/gdb/utils.c
++@@ -1821,11 +1821,30 @@ set_screen_size (void)
++ int rows = lines_per_page;
++ int cols = chars_per_line;
++
++- if (rows <= 0)
++- rows = INT_MAX;
+++ /* If we get 0 or negative ROWS or COLS, treat as "infinite" size.
+++ A negative number can be seen here with the "set width/height"
+++ commands and either:
++
++- if (cols <= 0)
++- cols = INT_MAX;
+++ - the user specified "unlimited", which maps to UINT_MAX, or
+++ - the user specified some number between INT_MAX and UINT_MAX.
+++
+++ Cap "infinity" to approximately sqrt(INT_MAX) so that we don't
+++ overflow in rl_set_screen_size, which multiplies rows and columns
+++ to compute the number of characters on the screen. */
+++
+++ const int sqrt_int_max = INT_MAX >> (sizeof (int) * 8 / 2);
+++
+++ if (rows <= 0 || rows > sqrt_int_max)
+++ {
+++ rows = sqrt_int_max;
+++ lines_per_page = UINT_MAX;
+++ }
+++
+++ if (cols <= 0 || cols > sqrt_int_max)
+++ {
+++ cols = sqrt_int_max;
+++ chars_per_line = UINT_MAX;
+++ }
++
++ /* Update Readline's idea of the terminal size. */
++ rl_set_screen_size (rows, cols);
+
+--
+2.17.1
+
--
2.17.1
3 years, 1 month
[crash PATCH] GDB: prevent overflow in the rl_set_screen_size()
by Lianbo Jiang
Currently, crash uses the system readline library to build the packages,
and the readline in system has been upgraded from 8.0 to 8.1, the gdb has
an old version, which can not play with the newer readline.
GDB calls rl_set_screen_size() in readline and may pass the INT_MAX to
the rl_set_screen_size(), however, the rl_set_screen_size() internally
multiplies the number of rows and columns, which causes a signed integer
overflow.
To avoid this issue, let's reduce the "infinite" rows and columns before
calling the rl_set_screen_size().
Signed-off-by: Lianbo Jiang <lijiang(a)redhat.com>
---
...t-overflow-in-the-rl_set_screen_size.patch | 88 +++++++++++++++++++
crash.spec | 2 +
2 files changed, 90 insertions(+)
create mode 100644 0001-gdb-prevent-overflow-in-the-rl_set_screen_size.patch
diff --git a/0001-gdb-prevent-overflow-in-the-rl_set_screen_size.patch b/0001-gdb-prevent-overflow-in-the-rl_set_screen_size.patch
new file mode 100644
index 000000000000..9ef48e033283
--- /dev/null
+++ b/0001-gdb-prevent-overflow-in-the-rl_set_screen_size.patch
@@ -0,0 +1,88 @@
+From f95d172b14e5b8ee6032b57f7535d2ffe2ee0135 Mon Sep 17 00:00:00 2001
+From: Lianbo Jiang <lijiang(a)redhat.com>
+Date: Wed, 3 Mar 2021 22:43:49 +0800
+Subject: [PATCH] gdb: prevent overflow in the rl_set_screen_size()
+
+Signed-off-by: Lianbo Jiang <lijiang(a)redhat.com>
+---
+ Makefile | 3 +++
+ configure.c | 2 +-
+ gdb-7.6-utils.patch | 39 +++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 43 insertions(+), 1 deletion(-)
+ create mode 100644 gdb-7.6-utils.patch
+
+diff --git a/Makefile b/Makefile
+index f72b3057d3e3..f3dfedc4c507 100644
+--- a/Makefile
++++ b/Makefile
+@@ -277,6 +277,9 @@ gdb_patch:
+ patch -p0 < ${GDB}-proc_service.h.patch; \
+ fi; \
+ fi
++ if [ -f ${GDB}-utils.patch ] && [ -s ${GDB}-utils.patch ]; then \
++ patch -p1 < ${GDB}-utils.patch; \
++ fi
+
+ library: make_build_data ${OBJECT_FILES}
+ ar -rs ${PROGRAM}lib.a ${OBJECT_FILES}
+diff --git a/configure.c b/configure.c
+index 7f6d19e0b87e..9d2610816c39 100644
+--- a/configure.c
++++ b/configure.c
+@@ -240,7 +240,7 @@ struct supported_gdb_version {
+ "7.6",
+ "GDB_FILES=${GDB_7.6_FILES}",
+ "GDB_OFILES=${GDB_7.6_OFILES}",
+- "GDB_PATCH_FILES=gdb-7.6.patch gdb-7.6-ppc64le-support.patch gdb-7.6-proc_service.h.patch",
++ "GDB_PATCH_FILES=gdb-7.6.patch gdb-7.6-ppc64le-support.patch gdb-7.6-proc_service.h.patch gdb-7.6-utils.patch",
+ "GDB_FLAGS=-DGDB_7_6",
+ "GPLv3"
+ },
+diff --git a/gdb-7.6-utils.patch b/gdb-7.6-utils.patch
+new file mode 100644
+index 000000000000..1f6830dc333e
+--- /dev/null
++++ b/gdb-7.6-utils.patch
+@@ -0,0 +1,39 @@
++diff --git a/gdb-7.6/gdb/utils.c b/gdb-7.6/gdb/utils.c
++index 1fdc8776902f..2579a0aed884 100644
++--- a/gdb-7.6/gdb/utils.c
+++++ b/gdb-7.6/gdb/utils.c
++@@ -1821,11 +1821,30 @@ set_screen_size (void)
++ int rows = lines_per_page;
++ int cols = chars_per_line;
++
++- if (rows <= 0)
++- rows = INT_MAX;
+++ /* If we get 0 or negative ROWS or COLS, treat as "infinite" size.
+++ A negative number can be seen here with the "set width/height"
+++ commands and either:
++
++- if (cols <= 0)
++- cols = INT_MAX;
+++ - the user specified "unlimited", which maps to UINT_MAX, or
+++ - the user specified some number between INT_MAX and UINT_MAX.
+++
+++ Cap "infinity" to approximately sqrt(INT_MAX) so that we don't
+++ overflow in rl_set_screen_size, which multiplies rows and columns
+++ to compute the number of characters on the screen. */
+++
+++ const int sqrt_int_max = INT_MAX >> (sizeof (int) * 8 / 2);
+++
+++ if (rows <= 0 || rows > sqrt_int_max)
+++ {
+++ rows = sqrt_int_max;
+++ lines_per_page = UINT_MAX;
+++ }
+++
+++ if (cols <= 0 || cols > sqrt_int_max)
+++ {
+++ cols = sqrt_int_max;
+++ chars_per_line = UINT_MAX;
+++ }
++
++ /* Update Readline's idea of the terminal size. */
++ rl_set_screen_size (rows, cols);
+--
+2.17.1
+
diff --git a/crash.spec b/crash.spec
index 8252b7baf7e6..48b882e9ec9a 100644
--- a/crash.spec
+++ b/crash.spec
@@ -34,6 +34,7 @@ Patch13: 0010-Fix-dev-d-option-on-Linux-5.11-rc1-and-later-kernels.patch
Patch14: 0011-Fix-kmem-v-option-on-Linux-5.11-rc1-and-later-kernel.patch
Patch15: 0012-mod-Show-the-base-address-of-module.patch
Patch16: 0013-xen-increase-__PHYSICAL_MASK_SHIFT_XEN-to-52.patch
+Patch17: 0001-gdb-prevent-overflow-in-the-rl_set_screen_size.patch
%description
The core analysis suite is a self-contained tool that can be used to
@@ -70,6 +71,7 @@ offered by Mission Critical Linux, or the LKCD kernel patch.
%patch14 -p1
%patch15 -p1
%patch16 -p1
+%patch17 -p1
%build
# This package has an internal copy of GDB which has broken configure code for
--
2.29.2
3 years, 1 month
[PATCH] Stop reloading kdump service on CPU hotplug event for FADump
by Sourabh Jain
As FADump does not require an explicit elfcorehdr update whenever there is CPU
hotplug event so let's stop kdump service reload for FADump when CPU hotplug
event is triggered.
A new label is added to handle CPU and memory hotplug events separately. The
updated CPU hotplug event handler make sure that kdump service should not be
reloaded when FADump is configured.
Signed-off-by: Sourabh Jain <sourabhjain(a)linux.ibm.com>
---
98-kexec.rules.ppc64 | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/98-kexec.rules.ppc64 b/98-kexec.rules.ppc64
index 1a91220..a1c00a9 100644
--- a/98-kexec.rules.ppc64
+++ b/98-kexec.rules.ppc64
@@ -1,15 +1,22 @@
-SUBSYSTEM=="cpu", ACTION=="online", GOTO="kdump_reload"
-SUBSYSTEM=="memory", ACTION=="online", GOTO="kdump_reload"
-SUBSYSTEM=="memory", ACTION=="offline", GOTO="kdump_reload"
+SUBSYSTEM=="cpu", ACTION=="online", GOTO="kdump_reload_cpu"
+SUBSYSTEM=="memory", ACTION=="online", GOTO="kdump_reload_mem"
+SUBSYSTEM=="memory", ACTION=="offline", GOTO="kdump_reload_mem"
GOTO="kdump_reload_end"
-LABEL="kdump_reload"
-
# If kdump is not loaded, calling kdump-udev-throttle will end up
# doing nothing, but systemd-run will always generate extra logs for
# each call, so trigger the kdump-udev-throttler only if kdump
# service is active to avoid unnecessary logs
+
+LABEL="kdump_reload_mem"
+
RUN+="/bin/sh -c '/usr/bin/systemctl is-active kdump.service || exit 0; /usr/bin/systemd-run --quiet --no-block /usr/lib/udev/kdump-udev-throttler'"
+GOTO="kdump_reload_end"
+
+LABEL="kdump_reload_cpu"
+
+RUN+="/bin/sh -c '/usr/bin/systemctl is-active kdump.service || exit 0; ! test -f /sys/kernel/fadump_enabled || cat /sys/kernel/fadump_enabled | grep 0 || exit 0; /usr/bin/systemd-run --quiet --no-block /usr/lib/udev/kdump-udev-throttler'"
+
LABEL="kdump_reload_end"
--
2.26.2
3 years, 1 month