commit grub2 for openSUSE:Factory
Hello community, here is the log from the commit of package grub2 for openSUSE:Factory checked in at 2018-11-28 11:10:33 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/grub2 (Old) and /work/SRC/openSUSE:Factory/.grub2.new.19453 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "grub2" Wed Nov 28 11:10:33 2018 rev:196 rq:651971 version:2.02 Changes: -------- --- /work/SRC/openSUSE:Factory/grub2/grub2.changes 2018-10-09 15:53:08.594355530 +0200 +++ /work/SRC/openSUSE:Factory/.grub2.new.19453/grub2.changes 2018-11-28 11:11:07.151090993 +0100 @@ -1,0 +2,12 @@ +Mon Nov 26 06:54:34 UTC 2018 - mchang@suse.com + +- Change default tsc calibration method to pmtimer on EFI (bsc#1114754) + * 0001-tsc-Change-default-tsc-calibration-method-to-pmtimer.patch + +------------------------------------------------------------------- +Fri Oct 19 07:17:34 UTC 2018 - mchang@suse.com + +- ieee1275: Fix double free in CAS reboot (bsc#1111955) + * grub2-ppc64-cas-fix-double-free.patch + +------------------------------------------------------------------- New: ---- 0001-tsc-Change-default-tsc-calibration-method-to-pmtimer.patch grub2-ppc64-cas-fix-double-free.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ grub2.spec ++++++ --- /var/tmp/diff_new_pack.FlO7zI/_old 2018-11-28 11:11:08.939088473 +0100 +++ /var/tmp/diff_new_pack.FlO7zI/_new 2018-11-28 11:11:08.943088467 +0100 @@ -223,6 +223,7 @@ Patch91: grub2-msdos-fix-overflow.patch Patch92: grub2-util-30_os-prober-multiple-initrd.patch Patch93: grub2-getroot-support-nvdimm.patch +Patch94: 0001-tsc-Change-default-tsc-calibration-method-to-pmtimer.patch # Btrfs snapshot booting related patches Patch101: grub2-btrfs-01-add-ability-to-boot-from-subvolumes.patch Patch102: grub2-btrfs-02-export-subvolume-envvars.patch @@ -261,6 +262,7 @@ Patch215: grub2-ppc64-cas-new-scope.patch Patch216: 0001-ofnet-Initialize-structs-in-bootpath-parser.patch Patch217: grub2-ieee1275-FCP-methods-for-WWPN-and-LUNs.patch +Patch218: grub2-ppc64-cas-fix-double-free.patch Patch233: grub2-use-stat-instead-of-udevadm-for-partition-lookup.patch Patch234: fix-grub2-use-stat-instead-of-udevadm-for-partition-lookup-with-new-glibc.patch Patch236: grub2-efi_gop-avoid-low-resolution.patch @@ -523,6 +525,7 @@ %patch91 -p1 %patch92 -p1 %patch93 -p1 +%patch94 -p1 %patch101 -p1 %patch102 -p1 %patch103 -p1 @@ -554,6 +557,7 @@ %patch215 -p1 %patch216 -p1 %patch217 -p1 +%patch218 -p1 %patch233 -p1 %patch234 -p1 %patch236 -p1 ++++++ 0001-tsc-Change-default-tsc-calibration-method-to-pmtimer.patch ++++++
From 446794de8da4329ea532cbee4ca877bcafd0e534 Mon Sep 17 00:00:00 2001 From: "David E. Box" <david.e.box@linux.intel.com> Date: Fri, 15 Sep 2017 15:37:05 -0700 Subject: [PATCH] tsc: Change default tsc calibration method to pmtimer on EFI systems
On efi systems, make pmtimer based tsc calibration the default over the pit. This prevents Grub from hanging on Intel SoC systems that power gate the pit. Signed-off-by: David E. Box <david.e.box@linux.intel.com> Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> --- grub-core/kern/i386/tsc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: grub-2.02/grub-core/kern/i386/tsc.c =================================================================== --- grub-2.02.orig/grub-core/kern/i386/tsc.c +++ grub-2.02/grub-core/kern/i386/tsc.c @@ -68,7 +68,7 @@ grub_tsc_init (void) #ifdef GRUB_MACHINE_XEN (void) (grub_tsc_calibrate_from_xen () || calibrate_tsc_hardcode()); #elif defined (GRUB_MACHINE_EFI) - (void) (grub_tsc_calibrate_from_pit () || grub_tsc_calibrate_from_pmtimer () || grub_tsc_calibrate_from_efi() || calibrate_tsc_hardcode()); + (void) (grub_tsc_calibrate_from_pmtimer () || grub_tsc_calibrate_from_pit () || grub_tsc_calibrate_from_efi() || calibrate_tsc_hardcode()); #elif defined (GRUB_MACHINE_COREBOOT) (void) (grub_tsc_calibrate_from_pmtimer () || grub_tsc_calibrate_from_pit () || calibrate_tsc_hardcode()); #else ++++++ grub2-ppc64-cas-fix-double-free.patch ++++++ Index: grub-2.02/grub-core/kern/ieee1275/openfw.c =================================================================== --- grub-2.02.orig/grub-core/kern/ieee1275/openfw.c +++ grub-2.02/grub-core/kern/ieee1275/openfw.c @@ -592,7 +592,7 @@ grub_ieee1275_canonicalise_devname (cons /* Check if it's a CAS reboot. If so, set the script to be executed. */ int -grub_ieee1275_cas_reboot (char *script) +grub_ieee1275_cas_reboot (char **script) { grub_uint32_t ibm_ca_support_reboot; grub_uint32_t ibm_fw_nbr_reboots; @@ -625,16 +625,37 @@ grub_ieee1275_cas_reboot (char *script) if (ibm_ca_support_reboot || ibm_fw_nbr_reboots) { - if (! grub_ieee1275_get_property_length (options, "boot-last-label", &actual)) - { - if (actual > 1024) - script = grub_realloc (script, actual + 1); - grub_ieee1275_get_property (options, "boot-last-label", script, actual, - &actual); - return 0; - } + grub_ssize_t len; + char *buf; + + if (grub_ieee1275_get_property_length (options, "boot-last-label", &len) + || len <= 0) + { + grub_dprintf ("ieee1275", "boot-last-label missing or invalid\n"); + goto out; + } + /* The returned property string length may not include terminating null byte, and in + a bid to avoid out of bound access we allocate one more byte to add it back */ + buf = grub_malloc ((grub_size_t)len + 1); + if (!buf) + { + grub_print_error (); + goto out; + } + if (grub_ieee1275_get_property (options, "boot-last-label", buf, (grub_size_t)len + 1, &actual) + || actual < 0) + { + grub_dprintf ("ieee1275", "error while get boot-last-label property\n"); + grub_free (buf); + goto out; + } + /* Add terminating null byte */ + buf[len] = '\0'; + *script = buf; + return 0; } +out: grub_ieee1275_set_boot_last_label (""); return -1; @@ -648,7 +669,8 @@ int grub_ieee1275_set_boot_last_label (c grub_dprintf("ieee1275", "set boot_last_label (size: %" PRIxGRUB_SIZE ")\n", grub_strlen(text)); if (! grub_ieee1275_finddevice ("/options", &options) && options != (grub_ieee1275_ihandle_t) -1) + /* To be on the safe side, set the property string with terminating null byte */ grub_ieee1275_set_property (options, "boot-last-label", text, - grub_strlen (text), &actual); + grub_strlen (text) + 1, &actual); return 0; } Index: grub-2.02/grub-core/normal/main.c =================================================================== --- grub-2.02.orig/grub-core/normal/main.c +++ grub-2.02/grub-core/normal/main.c @@ -281,10 +281,9 @@ grub_normal_execute (const char *config, #ifdef GRUB_MACHINE_IEEE1275 int boot; boot = 0; - char *script; + char *script = NULL; char *dummy[1] = { NULL }; - script = grub_malloc (1024); - if (! grub_ieee1275_cas_reboot (script)) + if (! grub_ieee1275_cas_reboot (&script) && script) { if (! grub_script_execute_new_scope (script, 0, dummy)) boot = 1; Index: grub-2.02/include/grub/ieee1275/ieee1275.h =================================================================== --- grub-2.02.orig/include/grub/ieee1275/ieee1275.h +++ grub-2.02/include/grub/ieee1275/ieee1275.h @@ -243,7 +243,7 @@ int EXPORT_FUNC(grub_ieee1275_devalias_n void EXPORT_FUNC(grub_ieee1275_children_peer) (struct grub_ieee1275_devalias *alias); void EXPORT_FUNC(grub_ieee1275_children_first) (const char *devpath, struct grub_ieee1275_devalias *alias); -int EXPORT_FUNC(grub_ieee1275_cas_reboot) (char *script); +int EXPORT_FUNC(grub_ieee1275_cas_reboot) (char **script); int EXPORT_FUNC(grub_ieee1275_set_boot_last_label) (const char *text); #define FOR_IEEE1275_DEVALIASES(alias) for (grub_ieee1275_devalias_init_iterator (&(alias)); grub_ieee1275_devalias_next (&(alias));)
participants (1)
-
root