import kexec-tools-2.0.26-8.el8

c8 imports/c8/kexec-tools-2.0.26-8.el8
MSVSphere Packaging Team 1 year ago
parent 0e87e491ea
commit ad7e95f869

4
.gitignore vendored

@ -1,3 +1,3 @@
SOURCES/1.7.1.tar.gz
SOURCES/1.7.2.tar.gz
SOURCES/eppic_050615.tar.gz
SOURCES/kexec-tools-2.0.25.tar.xz
SOURCES/kexec-tools-2.0.26.tar.xz

@ -1,3 +1,3 @@
8f8485c2a1edbc730f4fa1b96ae3ec8d8f1f9761 SOURCES/1.7.1.tar.gz
24bce02cd42cdbb960ada4d9e733355582e35784 SOURCES/1.7.2.tar.gz
a096c8e0892b559f40b01916aae240652f75b68a SOURCES/eppic_050615.tar.gz
78d5d4f7e9d358ca234db9c84a551d9d411eb0b5 SOURCES/kexec-tools-2.0.25.tar.xz
27cea5d032ec1e93506b8110222420abf754df2d SOURCES/kexec-tools-2.0.26.tar.xz

@ -108,6 +108,17 @@ source_ifcfg_file() {
fi
}
add_dns_netdev() {
local _server _route
_server=$1
_route=`/sbin/ip -o route get to $_server 2>&1`
[ $? != 0 ] && echo "DNS server $_server unreachable"
_netdev=$(get_ip_route_field "$_route" "dev")
_save_kdump_netifs "$_netdev" "$(kdump_setup_ifname $_netdev)"
}
# $1: netdev name
kdump_setup_dns() {
local _nameserver _dns
@ -115,8 +126,8 @@ kdump_setup_dns() {
source_ifcfg_file $1
[ -n "$DNS1" ] && echo "nameserver=$DNS1" > "$_dnsfile"
[ -n "$DNS2" ] && echo "nameserver=$DNS2" >> "$_dnsfile"
[ -n "$DNS1" ] && echo "nameserver=$DNS1" > "$_dnsfile" && add_dns_netdev "$DNS1"
[ -n "$DNS2" ] && echo "nameserver=$DNS2" >> "$_dnsfile" && add_dns_netdev "$DNS2"
while read content;
do
@ -128,6 +139,7 @@ kdump_setup_dns() {
if [ ! -f $_dnsfile ] || [ ! $(cat $_dnsfile | grep -q $_dns) ]; then
echo "nameserver=$_dns" >> "$_dnsfile"
add_dns_netdev "$_dns"
fi
done < "/etc/resolv.conf"
}
@ -347,6 +359,38 @@ EOF
rm -f "$_netif_allowlist_nm_conf"
}
_get_nic_driver() {
ethtool -i "$1" | sed -n -E "s/driver: (.*)/\1/p"
}
kdump_install_nic_driver() {
local _netif _driver _drivers
_drivers=()
for _netif in $1; do
[[ $_netif == lo ]] && continue
_driver=$(_get_nic_driver "$_netif")
if [[ -z $_driver ]]; then
derror "Failed to get the driver of $_netif"
exit 1
fi
if [[ $_driver == "802.1Q VLAN Support" ]]; then
# ethtool somehow doesn't return the driver name for a VLAN NIC
_driver=8021q
elif [[ $_driver == "team" ]]; then
# install the team mode drivers like team_mode_roundrobin.ko as well
_driver='=drivers/net/team'
fi
_drivers+=("$_driver")
done
[[ -n ${_drivers[*]} ]] || return
instmods "${_drivers[@]}"
}
kdump_setup_bridge() {
local _netdev=$1
local _brif _dev _mac _kdumpdev
@ -481,6 +525,18 @@ kdump_setup_znet() {
echo rd.znet=${NETTYPE},${SUBCHANNELS}${_options} rd.znet_ifname=$(kdump_setup_ifname $_netdev):${SUBCHANNELS} > ${initdir}/etc/cmdline.d/30znet.conf
}
_get_nic_driver() {
ethtool -i "$1" | sed -n -E "s/driver: (.*)/\1/p"
}
_rename_hypver_netdev() {
local _udev_rule_dir
_udev_rule_dir=${initdir}/etc/udev/rules.d
mkdir -p "$_udev_rule_dir"
printf 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="hv_netvsc", ATTR{address}=="%s", ATTR{type}=="1", NAME="%s"\n' "$2" "$1" > "${_udev_rule_dir}/80-hv_netvsc-ifname.rules"
}
# Setup dracut to bringup a given network interface
kdump_setup_netdev() {
local _netdev=$1 _srcaddr=$2
@ -529,8 +585,12 @@ kdump_setup_netdev() {
elif kdump_is_vlan "$_netdev"; then
kdump_setup_vlan "$_netdev"
else
_ifname_opts=" ifname=$kdumpnic:$_netmac"
echo "$_ifname_opts" >> $_ip_conf
if [[ $(_get_nic_driver "$1") != hv_netvsc ]]; then
_ifname_opts=" ifname=$kdumpnic:$_netmac"
echo "$_ifname_opts" >> $_ip_conf
else
_rename_hypver_netdev "$kdumpnic" "$_netmac"
fi
fi
_save_kdump_netifs "$_netdev" "$_kdumpdev"
@ -1053,6 +1113,7 @@ install() {
_netifs=$(_get_kdump_netifs)
if [[ -n "$_netifs" ]]; then
kdump_install_nm_netif_allowlist "$_netifs"
kdump_install_nic_driver "$_netifs"
fi
kdump_install_systemd_conf

@ -17,7 +17,7 @@ KDUMP_COMMANDLINE=""
# This variable lets us remove arguments from the current kdump commandline
# as taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
# NOTE: some arguments such as crashkernel will always be removed
KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swiotlb prot_virt ignition.firstboot"
KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swiotlb prot_virt ignition.firstboot zfcp.allow_lun_scan"
# This variable lets us append arguments to the current kdump commandline
# after processed by KDUMP_COMMANDLINE_REMOVE

@ -1,76 +0,0 @@
commit 6d0d95ecc04a70f8448d562ff0fbbae237f5c929
Author: Kazuhito Hagio <k-hagio-ab@nec.com>
Date: Thu Apr 21 08:58:29 2022 +0900
[PATCH] Avoid false-positive mem_section validation with vmlinux
Currently get_mem_section() validates if SYMBOL(mem_section) is the address
of the mem_section array first. But there was a report that the first
validation wrongly returned TRUE with -x vmlinux and SPARSEMEM_EXTREME
(4.15+) on s390x. This leads to crash failing statup with the following
seek error:
crash: seek error: kernel virtual address: 67fffc2800 type: "memory section root table"
Skip the first validation when satisfying the conditions.
Reported-by: Dave Wysochanski <dwysocha@redhat.com>
Signed-off-by: Kazuhito Hagio <k-hagio-ab@nec.com>
Reviewed-and-Tested-by: Philipp Rudo <prudo@redhat.com>
Reviewed-by: Pingfan Liu <piliu@redhat.com>
diff --git a/makedumpfile-1.7.1/makedumpfile.c b/makedumpfile-1.7.1/makedumpfile.c
index a2f45c84cee3ba57ce3d3cf3f1905e6a03f4fd09..65d1c7c2f02c9ae8ead9de0f0217235fe72b3ca7 100644
--- a/makedumpfile-1.7.1/makedumpfile.c
+++ b/makedumpfile-1.7.1/makedumpfile.c
@@ -3698,6 +3698,22 @@ validate_mem_section(unsigned long *mem_sec,
return ret;
}
+/*
+ * SYMBOL(mem_section) varies with the combination of memory model and
+ * its source:
+ *
+ * SPARSEMEM
+ * vmcoreinfo: address of mem_section root array
+ * -x vmlinux: address of mem_section root array
+ *
+ * SPARSEMEM_EXTREME v1
+ * vmcoreinfo: address of mem_section root array
+ * -x vmlinux: address of mem_section root array
+ *
+ * SPARSEMEM_EXTREME v2 (with 83e3c48729d9 and a0b1280368d1) 4.15+
+ * vmcoreinfo: address of mem_section root array
+ * -x vmlinux: address of pointer to mem_section root array
+ */
static int
get_mem_section(unsigned int mem_section_size, unsigned long *mem_maps,
unsigned int num_section)
@@ -3710,12 +3726,27 @@ get_mem_section(unsigned int mem_section_size, unsigned long *mem_maps,
strerror(errno));
return FALSE;
}
+
+ /*
+ * There was a report that the first validation wrongly returned TRUE
+ * with -x vmlinux and SPARSEMEM_EXTREME v2 on s390x, so skip it.
+ * Howerver, leave the fallback validation as it is for the -i option.
+ */
+ if (is_sparsemem_extreme() && info->name_vmlinux) {
+ unsigned long flag = 0;
+ if (get_symbol_type_name("mem_section", DWARF_INFO_GET_SYMBOL_TYPE,
+ NULL, &flag)
+ && !(flag & TYPE_ARRAY))
+ goto skip_1st_validation;
+ }
+
ret = validate_mem_section(mem_sec, SYMBOL(mem_section),
mem_section_size, mem_maps, num_section);
if (!ret && is_sparsemem_extreme()) {
unsigned long mem_section_ptr;
+skip_1st_validation:
if (!readmem(VADDR, SYMBOL(mem_section), &mem_section_ptr,
sizeof(mem_section_ptr)))
goto out;

@ -38,10 +38,10 @@ Signed-off-by: HATAYAMA Daisuke <d.hatayama@fujitsu.com>
sadump_info.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/makedumpfile-1.7.1/sadump_info.c b/makedumpfile-1.7.1/sadump_info.c
diff --git a/makedumpfile-1.7.2/sadump_info.c b/makedumpfile-1.7.2/sadump_info.c
index adfa8dc..2c44068 100644
--- a/makedumpfile-1.7.1/sadump_info.c
+++ b/makedumpfile-1.7.1/sadump_info.c
--- a/makedumpfile-1.7.2/sadump_info.c
+++ b/makedumpfile-1.7.2/sadump_info.c
@@ -1362,6 +1362,7 @@ static int linux_banner_sanity_check(ulong cr3)
#define PTI_USER_PGTABLE_BIT (info->page_shift)
#define PTI_USER_PGTABLE_MASK (1 << PTI_USER_PGTABLE_BIT)

@ -29,7 +29,7 @@ SAVE_PATH=$(get_save_path)
OVERRIDE_RESETTABLE=0
extra_modules=""
dracut_args="--add kdumpbase --quiet --hostonly --hostonly-cmdline --hostonly-i18n --hostonly-mode strict -o \"plymouth dash resume ifcfg earlykdump\" --compress=xz"
dracut_args="--add kdumpbase --quiet --hostonly --hostonly-cmdline --hostonly-i18n --hostonly-mode strict --hostonly-nics '' -o \"plymouth dash resume ifcfg earlykdump\" --compress=xz"
readonly MKDUMPRD_TMPDIR="$(mktemp -d -t mkdumprd.XXXXXX)"
[ -d "$MKDUMPRD_TMPDIR" ] || perror_exit "dracut: mktemp -p -d -t dracut.XXXXXX failed."
@ -442,7 +442,11 @@ if ! is_fadump_capable; then
# so it doesn't affect the logic of check_dump_fs_modified().
is_dump_to_rootfs && add_mount "$(to_dev_name $(get_root_fs_device))"
add_dracut_arg "--no-hostonly-default-device"
add_dracut_arg "--no-hostonly-default-device"
if fips-mode-setup --is-enabled 2> /dev/null; then
add_dracut_arg --add-device "$(findmnt -n -o SOURCE --target /boot)"
fi
fi
echo "$dracut_args $@" | xargs dracut

@ -12,10 +12,10 @@ Signed-off-by: Pingfan Liu <piliu@redhat.com>
makedumpfile.h | 1 +
3 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/makedumpfile-1.7.1/arch/arm64.c b/makedumpfile-1.7.1/arch/arm64.c
diff --git a/makedumpfile-1.7.2/arch/arm64.c b/makedumpfile-1.7.2/arch/arm64.c
index 1072178..95beae6 100644
--- a/makedumpfile-1.7.1/arch/arm64.c
+++ b/makedumpfile-1.7.1/arch/arm64.c
--- a/makedumpfile-1.7.2/arch/arm64.c
+++ b/makedumpfile-1.7.2/arch/arm64.c
@@ -50,6 +50,7 @@ static int va_bits;
static int vabits_actual;
static int flipped_va;
@ -51,10 +51,10 @@ index 1072178..95beae6 100644
kimage_voffset = NUMBER(kimage_voffset);
info->section_size_bits = SECTIONS_SIZE_BITS;
diff --git a/makedumpfile-1.7.1/makedumpfile.c b/makedumpfile-1.7.1/makedumpfile.c
diff --git a/makedumpfile-1.7.2/makedumpfile.c b/makedumpfile-1.7.2/makedumpfile.c
index 3ad4443..018ea4c 100644
--- a/makedumpfile-1.7.1/makedumpfile.c
+++ b/makedumpfile-1.7.1/makedumpfile.c
--- a/makedumpfile-1.7.2/makedumpfile.c
+++ b/makedumpfile-1.7.2/makedumpfile.c
@@ -2417,6 +2417,7 @@ write_vmcoreinfo_data(void)
WRITE_NUMBER("HUGETLB_PAGE_DTOR", HUGETLB_PAGE_DTOR);
@ -71,10 +71,10 @@ index 3ad4443..018ea4c 100644
READ_NUMBER("VA_BITS", VA_BITS);
READ_NUMBER("TCR_EL1_T1SZ", TCR_EL1_T1SZ);
READ_NUMBER_UNSIGNED("PHYS_OFFSET", PHYS_OFFSET);
diff --git a/makedumpfile-1.7.1/makedumpfile.h b/makedumpfile-1.7.1/makedumpfile.h
diff --git a/makedumpfile-1.7.2/makedumpfile.h b/makedumpfile-1.7.2/makedumpfile.h
index e59239d..b6236dd 100644
--- a/makedumpfile-1.7.1/makedumpfile.h
+++ b/makedumpfile-1.7.1/makedumpfile.h
--- a/makedumpfile-1.7.2/makedumpfile.h
+++ b/makedumpfile-1.7.2/makedumpfile.h
@@ -2064,6 +2064,7 @@ struct number_table {
long phys_base;
long KERNEL_IMAGE_SIZE;

@ -1,6 +1,6 @@
Name: kexec-tools
Version: 2.0.25
Release: 5%{?dist}.1
Version: 2.0.26
Release: 8%{?dist}
License: GPLv2
Group: Applications/System
Summary: The kexec/kdump userspace component
@ -13,7 +13,7 @@ Source4: kdump.sysconfig.i386
Source5: kdump.sysconfig.ppc64
Source7: mkdumprd
Source8: gen-kdump-conf.sh
Source9: https://github.com/makedumpfile/makedumpfile/archive/1.7.1.tar.gz
Source9: https://github.com/makedumpfile/makedumpfile/archive/1.7.2.tar.gz
Source10: kexec-kdump-howto.txt
Source12: mkdumprd.8
Source13: 98-kexec.rules
@ -111,8 +111,7 @@ Patch602: rhelonly-kexec-tools-2.0.18-eppic-fix-issues-with-hardening-flags.patc
# Patches 701 onward for makedumpfile
Patch701: rhelonly-kexec-tools-2.0.20-makedumpfile-arm64-Add-support-for-ARMv8.2-LVA-52-bi.patch
Patch702: kexec-tools-2.0.24-makedumpfile-Avoid_false_positive_mem_section_validation_with_vmlinux.patch
Patch703: kexec-tools-2.0.25-makedumpfile-sadump-fix-failure-of-reading-memory-when-5-le.patch
Patch702: kexec-tools-2.0.26-makedumpfile-sadump-fix-failure-of-reading-memory-when-5-le.patch
%description
kexec-tools provides /usr/sbin/kexec binary that facilitates a new
@ -133,7 +132,6 @@ tar -z -x -v -f %{SOURCE19}
%patch701 -p1
%patch702 -p1
%patch703 -p1
%ifarch ppc
%define archdef ARCH=ppc
@ -166,8 +164,8 @@ cp %{SOURCE31} .
make
%ifarch %{ix86} x86_64 ppc64 s390x ppc64le aarch64
make -C eppic/libeppic
make -C makedumpfile-1.7.1 LINKTYPE=dynamic USELZO=on USESNAPPY=on USEZSTD=on
make -C makedumpfile-1.7.1 LDFLAGS="$LDFLAGS -I../eppic/libeppic -L../eppic/libeppic" eppic_makedumpfile.so
make -C makedumpfile-1.7.2 LINKTYPE=dynamic USELZO=on USESNAPPY=on USEZSTD=on
make -C makedumpfile-1.7.2 LDFLAGS="$LDFLAGS -I../eppic/libeppic -L../eppic/libeppic" eppic_makedumpfile.so
%endif
%install
@ -228,13 +226,13 @@ install -m 755 -D %{SOURCE32} $RPM_BUILD_ROOT%{_prefix}/lib/kernel/install.d/60-
%ifarch %{ix86} x86_64 ppc64 s390x ppc64le aarch64
install -m 755 makedumpfile-1.7.1/makedumpfile $RPM_BUILD_ROOT/usr/sbin/makedumpfile
install -m 644 makedumpfile-1.7.1/makedumpfile.8 $RPM_BUILD_ROOT/%{_mandir}/man8/makedumpfile.8
install -m 644 makedumpfile-1.7.1/makedumpfile.conf.5 $RPM_BUILD_ROOT/%{_mandir}/man5/makedumpfile.conf.5
install -m 644 makedumpfile-1.7.1/makedumpfile.conf $RPM_BUILD_ROOT/%{_sysconfdir}/makedumpfile.conf.sample
install -m 755 makedumpfile-1.7.1/eppic_makedumpfile.so $RPM_BUILD_ROOT/%{_libdir}/eppic_makedumpfile.so
install -m 755 makedumpfile-1.7.2/makedumpfile $RPM_BUILD_ROOT/usr/sbin/makedumpfile
install -m 644 makedumpfile-1.7.2/makedumpfile.8 $RPM_BUILD_ROOT/%{_mandir}/man8/makedumpfile.8
install -m 644 makedumpfile-1.7.2/makedumpfile.conf.5 $RPM_BUILD_ROOT/%{_mandir}/man5/makedumpfile.conf.5
install -m 644 makedumpfile-1.7.2/makedumpfile.conf $RPM_BUILD_ROOT/%{_sysconfdir}/makedumpfile.conf.sample
install -m 755 makedumpfile-1.7.2/eppic_makedumpfile.so $RPM_BUILD_ROOT/%{_libdir}/eppic_makedumpfile.so
mkdir -p $RPM_BUILD_ROOT/usr/share/makedumpfile/eppic_scripts/
install -m 644 makedumpfile-1.7.1/eppic_scripts/* $RPM_BUILD_ROOT/usr/share/makedumpfile/eppic_scripts/
install -m 644 makedumpfile-1.7.2/eppic_scripts/* $RPM_BUILD_ROOT/usr/share/makedumpfile/eppic_scripts/
%endif
%define remove_dracut_prefix() %(echo -n %1|sed 's/.*dracut-//g')
@ -398,12 +396,39 @@ done
%endif
%changelog
* Thu May 4 2023 Pingfan Liu <piliu@redhat.com> - 2.0.25-5.1
* Thu Aug 10 2023 Pingfan Liu <piliu@redhat.com> - 2.0.26-8
- mkdumprd: Use the correct syntax to redirect the stderr to null
- mkdumprd: call dracut with --add-device to install the drivers needed by /boot partition automatically for FIPS
- Add NICs that handle DNS queries to the allowlist
* Wed Jul 12 2023 Pingfan Liu <piliu@redhat.com> - 2.0.26-7
- Revert "Revert "Append both nofail and x-systemd.before to kdump mount target"
* Thu Jun 29 2023 Pingfan Liu <piliu@redhat.com> - 2.0.26-6
- dracut-module-setup.sh: skip installing driver for the loopback interface
- Reduce kdump memory consumption by only installing needed NIC drivers
* Tue Jun 13 2023 Pingfan Liu <piliu@redhat.com> - 2.0.26-5
- Revert "Append both nofail and x-systemd.before to kdump mount target"
* Wed May 31 2023 Pingfan Liu <piliu@redhat.com> - 2.0.26-4
- Only rename the virtual Azure Hyper-V network interface
* Tue May 16 2023 Pingfan Liu <piliu@redhat.com> - 2.0.26-3
- Don't rename Azure Hyper-V network interface
* Thu Apr 20 2023 Pingfan Liu <piliu@redhat.com> - 2.0.26-2
- sadump: fix failure of reading memory when 5-level paging is enabled
* Tue Apr 4 2023 Pingfan Liu <piliu@redhat.com> - 2.0.25-7
- Rebase makedumpfile to 1.7.2
* Tue Mar 14 2023 Pingfan Liu <piliu@redhat.com> - 2.0.25-6
- sysconfig: add zfcp.allow_lun_scan to KDUMP_COMMANDLINE_REMOVE on s390
* Wed Jan 18 2023 Pingfan Liu <piliu@redhat.com> - 2.0.25-5
dracut-module-setup: Fix invalid rd.znet command line entry
dracut-module-setup: Fix persistent nic name on s390
- dracut-module-setup: Fix invalid rd.znet command line entry
- dracut-module-setup: Fix persistent nic name on s390
* Mon Jan 9 2023 Pingfan Liu <piliu@redhat.com> - 2.0.25-4
- Don't check fs modified when dump target is lvm2 thinp

Loading…
Cancel
Save