From 12bc16e2c1d05f2456ac6f620a091f5bb6663a5c4c83baf02c567f6fb0d304cb Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Mon, 11 May 2020 15:26:12 +0000 Subject: [PATCH 1/2] Accepting request 802717 from home:adamm:branches:utilities Patch already forwarded upstream - mkisofs: fix integer overflow in partition table calculation when chrp-boot is enabled and a large ISO image is created. (large_mac_iso.patch, bsc#1169420) OBS-URL: https://build.opensuse.org/request/show/802717 OBS-URL: https://build.opensuse.org/package/show/utilities/schily?expand=0&rev=93 --- large_mac_iso.patch | 33 +++++++++++++++++++++++++++++++++ schily.changes | 7 +++++++ schily.spec | 2 ++ 3 files changed, 42 insertions(+) create mode 100644 large_mac_iso.patch diff --git a/large_mac_iso.patch b/large_mac_iso.patch new file mode 100644 index 0000000..d30791c --- /dev/null +++ b/large_mac_iso.patch @@ -0,0 +1,33 @@ +Index: cdrtools-3.02/mkisofs/mac_label.c +=================================================================== +--- cdrtools-3.02.orig/mkisofs/mac_label.c ++++ cdrtools-3.02/mkisofs/mac_label.c +@@ -67,8 +67,8 @@ gen_prepboot_label(ml) + { + struct directory_entry *de; + int i = 0; +- int block; +- int size; ++ unsigned block; ++ unsigned size; + MacLabel *mac_label = (MacLabel *) ml; + + if (verbose > 1) { +@@ -98,7 +98,7 @@ gen_prepboot_label(ml) + mac_label->image[i].startSect[2] = 0; + mac_label->image[i].startSect[3] = 0; + +- size = (last_extent - session_start) * 2048 / 512; ++ size = (unsigned)(last_extent - session_start) * (2048 / 512); + mac_label->image[i].size[0] = size & 0xff; + mac_label->image[i].size[1] = (size >> 8) & 0xff; + mac_label->image[i].size[2] = (size >> 16) & 0xff; +@@ -115,7 +115,7 @@ gen_prepboot_label(ml) + /* NOTREACHED */ + } + /* get size and block in 512-byte blocks */ +- block = get_733(de->isorec.extent) * 2048 / 512; ++ block = get_733(de->isorec.extent) * (2048 / 512); + size = get_733(de->isorec.size) / 512 + 1; + fprintf(stderr, _("PReP boot partition %d is \"%s\"\n"), + i + 1, prep_boot_image[i - use_chrp_boot]); diff --git a/schily.changes b/schily.changes index aed8f99..c761e24 100644 --- a/schily.changes +++ b/schily.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon May 11 11:47:23 UTC 2020 - Adam Majer + +- mkisofs: fix integer overflow in partition table calculation + when chrp-boot is enabled and a large ISO image is created. + (large_mac_iso.patch, bsc#1169420) + ------------------------------------------------------------------- Wed Apr 29 08:26:30 UTC 2020 - Jan Engelhardt diff --git a/schily.spec b/schily.spec index 7d055c0..e170ebc 100644 --- a/schily.spec +++ b/schily.spec @@ -41,6 +41,7 @@ Source1: README-FIRST # and submit patches upstream FIRST (cc to the bspkg maintainer perhaps). Patch1: iconv-name.diff Patch2: schily-2018-05-25_star_configuration.patch +Patch3: large_mac_iso.patch BuildRequires: autoconf BuildRequires: fdupes BuildRequires: gcc-c++ @@ -447,6 +448,7 @@ GB). %prep %setup -qn %name-%rver %patch -P 1 -P 2 -p1 +%patch3 -p1 find . "(" -type d -o -type f ")" -exec chmod u+w "{}" "+" cp %{SOURCE1} . From d85d8bf21e106180ccb7bed7de3b3a3116cbd3e99353b528cb84d6ebc5cc6018 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Mon, 11 May 2020 15:55:26 +0000 Subject: [PATCH 2/2] add patch info OBS-URL: https://build.opensuse.org/package/show/utilities/schily?expand=0&rev=94 --- large_mac_iso.patch | 6 ++++++ schily.spec | 4 +--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/large_mac_iso.patch b/large_mac_iso.patch index d30791c..8008d27 100644 --- a/large_mac_iso.patch +++ b/large_mac_iso.patch @@ -1,3 +1,9 @@ +From: Adam Majer +Date: 2020-05-11 11:47:23+0000 + +Fix an integer overflow in partition table calculation when chrp-boot +is enabled and a large ISO image is created. + Index: cdrtools-3.02/mkisofs/mac_label.c =================================================================== --- cdrtools-3.02.orig/mkisofs/mac_label.c diff --git a/schily.spec b/schily.spec index e170ebc..f956727 100644 --- a/schily.spec +++ b/schily.spec @@ -446,9 +446,7 @@ limitations on file size and supports to edit large files (files >2 GB). %prep -%setup -qn %name-%rver -%patch -P 1 -P 2 -p1 -%patch3 -p1 +%autosetup -n %name-%rver -p1 find . "(" -type d -o -type f ")" -exec chmod u+w "{}" "+" cp %{SOURCE1} .