diff --git a/s390-tools-02-zipl-src-fix-imprecise-check-that-file-is-on-specifi.patch b/s390-tools-02-zipl-src-fix-imprecise-check-that-file-is-on-specifi.patch new file mode 100644 index 0000000..bf9ce66 --- /dev/null +++ b/s390-tools-02-zipl-src-fix-imprecise-check-that-file-is-on-specifi.patch @@ -0,0 +1,63 @@ +From 592a016a1095fa9813f0bae8256433ba5af4ab9b Mon Sep 17 00:00:00 2001 +From: Eduard Shishkin +Date: Sat, 7 Dec 2024 12:48:12 +0100 +Subject: [PATCH s390-tools 2/2] zipl/src: fix imprecise check that file is on + specified device + +This fixes c0f02d2 + +The check that file is on specified disk is imprecise: In case when +target parameters are specified by user, the check compares a logical +device with a base disk, which is incorrect. + +The fixup makes the check compare base disks (a specified one with +the base disk determined by disk_get_info() procedure). + +Signed-off-by: Eduard Shishkin +--- + zipl/src/bootmap.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/zipl/src/bootmap.c b/zipl/src/bootmap.c +index 7d340156..880b93ce 100644 +--- a/zipl/src/bootmap.c ++++ b/zipl/src/bootmap.c +@@ -299,14 +299,15 @@ create_component_header(void* buffer, component_header_type type) + } + + /* +- * Not precise check that the file FILENAME locates on specified physical DISK. ++ * Not precise check that the file FILENAME locates on the physical ++ * disk specified by WHERE. + * + * Try to auto-detect parameters of the disk which the file locates on + * and compare found device-ID with DISK. + * Return 0, if auto-detection succeeded, and it is proven that the + * file does NOT locate on DISK. Otherwise, return 1. + */ +-static int file_is_on_disk(const char *filename, dev_t disk) ++static int file_is_on_disk(const char *filename, struct disk_info *where) + { + /* + * Retrieve info of the underlying disk without any user hints +@@ -331,7 +332,7 @@ static int file_is_on_disk(const char *filename, dev_t disk) + "Warning: Preparing a logical device for boot might fail\n"); + return 1; + } +- if (info->device != disk) { ++ if (info->basedisks[0] != where->basedisks[0]) { + disk_free_info(info); + return 0; + } +@@ -378,7 +379,7 @@ static int add_component_file_range(struct install_set *bis, + return -1; + } + } else { +- if (!file_is_on_disk(filename, bis->info->device)) { ++ if (!file_is_on_disk(filename, bis->info)) { + error_reason("File is not on target device"); + return -1; + } +-- +2.39.0 + diff --git a/s390-tools.changes b/s390-tools.changes index e7520b9..0a3740a 100644 --- a/s390-tools.changes +++ b/s390-tools.changes @@ -21,6 +21,8 @@ Mon Dec 9 09:49:52 UTC 2024 - Nikolay Gueorguiev - lszcrypt: Fix wrong state showing up for removed AP queue within SE guest - lszfcp: Show device names line for zfcp_units without SCSI device - Revendored vendor.tar.gz +- Applied additional patch (bsc#1233889, bsc#1233079) + * s390-tools-02-zipl-src-fix-imprecise-check-that-file-is-on-specifi.patch ------------------------------------------------------------------- Thu Dec 5 15:13:49 UTC 2024 - Nikolay Gueorguiev diff --git a/s390-tools.spec b/s390-tools.spec index e31cd97..676fbe7 100644 --- a/s390-tools.spec +++ b/s390-tools.spec @@ -154,6 +154,7 @@ Patch911: s390-tools-sles15sp5-remove-no-pie-link-arguments.patch Patch912: s390-tools-ALP-zdev-live.patch Patch913: s390-tools-sles15sp6-kdump-initrd-59-zfcp-compat-rules.patch Patch914: s390-tools-01-zipl_helper.device-mapper-add-missed-step-in-logical.patch +Patch915: s390-tools-02-zipl-src-fix-imprecise-check-that-file-is-on-specifi.patch ### Patch920: s390-tools-slfo-01-parse-ipl-device-for-activation.patch ### @@ -161,8 +162,8 @@ Patch920: s390-tools-slfo-01-parse-ipl-device-for-activation.patch BuildRequires: curl-devel BuildRequires: dracut BuildRequires: fuse3-devel -BuildRequires: gcc13 -BuildRequires: gcc13-c++ +BuildRequires: gcc +BuildRequires: gcc-c++ BuildRequires: gettext-tools BuildRequires: glib2-devel BuildRequires: glibc-devel-static @@ -378,9 +379,6 @@ tar -xzf %{SOURCE201} export OPT_FLAGS="%{optflags}" export KERNELIMAGE_MAKEFLAGS="%%{?_smp_mflags}" -export CC=gcc-13 -export CXX=g++-13 - %make_build \ ZFCPDUMP_DIR=%{_prefix}/lib/s390-tools/zfcpdump \ DISTRELEASE=%{release} \ @@ -388,15 +386,11 @@ export CXX=g++-13 HAVE_CARGO=1 \ HAVE_DRACUT=1 ### all -gcc-13 -static -o read_values ${OPT_FLAGS} %{SOURCE86} -lqc +gcc -static -o read_values ${OPT_FLAGS} %{SOURCE86} -lqc %install mkdir -p %{buildroot}/boot/zipl mkdir -p %{buildroot}%{_sysconfdir}/zkey/repository - -export CC=gcc-13 -export CXX=g++-13 - %make_install \ ZFCPDUMP_DIR=%{_prefix}/lib/s390-tools/zfcpdump \ DISTRELEASE=%{release} \ @@ -818,9 +812,6 @@ tar -xzf %{SOURCE201} export OPT_FLAGS="%{optflags}" export KERNELIMAGE_MAKEFLAGS="%%{?_smp_mflags}" -export CC=gcc-13 -export CXX=g++-13 - %make_build \ DISTRELEASE=%{release} \ UDEVRUNDIR=/run/udev \ @@ -829,9 +820,6 @@ export CXX=g++-13 %install -export CC=gcc-13 -export CXX=g++-13 - %make_install \ DISTRELEASE=%{release} \ SYSTEMDSYSTEMUNITDIR=%{_unitdir} \