Hello community, here is the log from the commit of package grub2 for openSUSE:Factory checked in at 2018-03-30 12:01:00 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/grub2 (Old) and /work/SRC/openSUSE:Factory/.grub2.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "grub2" Fri Mar 30 12:01:00 2018 rev:179 rq:591814 version:2.02 Changes: -------- --- /work/SRC/openSUSE:Factory/grub2/grub2.changes 2018-03-19 23:30:34.894228962 +0100 +++ /work/SRC/openSUSE:Factory/.grub2.new/grub2.changes 2018-03-30 12:01:03.707534300 +0200 @@ -1,0 +2,6 @@ +Mon Mar 26 11:37:13 UTC 2018 - msucha...@suse.com + +- Fix incorrect netmask on ppc64 (bsc#1085419) + * grub2-Fix-incorrect-netmask-on-ppc64.patch + +------------------------------------------------------------------- New: ---- grub2-Fix-incorrect-netmask-on-ppc64.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ grub2.spec ++++++ --- /var/tmp/diff_new_pack.77DXVk/_old 2018-03-30 12:01:05.591466175 +0200 +++ /var/tmp/diff_new_pack.77DXVk/_new 2018-03-30 12:01:05.599465885 +0200 @@ -213,8 +213,7 @@ Patch82: grub2-diskfilter-support-pv-without-metadatacopies.patch Patch83: grub2-efi-uga-64bit-fb.patch Patch84: grub2-s390x-09-improve-zipl-setup.patch -Patch85: grub2-install-remove-useless-check-PReP-partition-is-empty.patch -Patch86: grub2-getroot-scan-disk-pv.patch +Patch85: grub2-getroot-scan-disk-pv.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 @@ -247,6 +246,8 @@ Patch235: 0002-Add-Virtual-LAN-support.patch Patch236: grub2-efi_gop-avoid-low-resolution.patch Patch277: grub2-ppc64-cas-reboot-support.patch +Patch278: grub2-install-remove-useless-check-PReP-partition-is-empty.patch +Patch279: grub2-Fix-incorrect-netmask-on-ppc64.patch # Support HTTP Boot IPv4 and IPv6 (fate#320129) Patch280: 0001-misc-fix-invalid-character-recongition-in-strto-l.patch Patch281: 0002-net-read-bracketed-ipv6-addrs-and-port-numbers.patch @@ -492,7 +493,6 @@ %patch83 -p1 %patch84 -p1 %patch85 -p1 -%patch86 -p1 %patch101 -p1 %patch102 -p1 %patch103 -p1 @@ -519,6 +519,8 @@ %patch235 -p1 %patch236 -p1 %patch277 -p1 +%patch278 -p1 +%patch279 -p1 %patch280 -p1 %patch281 -p1 %patch282 -p1 ++++++ grub2-Fix-incorrect-netmask-on-ppc64.patch ++++++ From: Masahiro Matsuya <mmats...@redhat.com> The netmask configured in firmware is not respected on ppc64 (big endian). When 255.255.252.0 is set as netmask in firmware, the following is the value of bootpath string in grub_ieee1275_parse_bootpath(). /vdevice/l-lan@30000002:speed=auto,duplex=auto,192.168.88.10,,192.168.89.113,192.168.88.1,5,5,255.255.252.0,512 The netmask in this bootpath is no problem, since it's a value specified in firmware. But, The value of 'subnet_mask.ipv4' was set with 0xfffffc00, and __builtin_ctz (~grub_le_to_cpu32 (subnet_mask.ipv4)) returned 16 (not 22). As a result, 16 was used for netmask wrongly. 1111 1111 1111 1111 1111 1100 0000 0000 # subnet_mask.ipv4 (=0xfffffc00) 0000 0000 1111 1100 1111 1111 1111 1111 # grub_le_to_cpu32 (subnet_mask.ipv4) 1111 1111 0000 0011 0000 0000 0000 0000 # ~grub_le_to_cpu32 (subnet_mask.ipv4) And, the count of zero with __builtin_ctz can be 16. This patch changes it as below. 1111 1111 1111 1111 1111 1100 0000 0000 # subnet_mask.ipv4 (=0xfffffc00) 0000 0000 1111 1100 1111 1111 1111 1111 # grub_le_to_cpu32 (subnet_mask.ipv4) 1111 1111 1111 1111 1111 1100 0000 0000 # grub_swap_bytes32(grub_le_to_cpu32 (subnet_mask.ipv4)) 0000 0000 0000 0000 0000 0011 1111 1111 # ~grub_swap_bytes32(grub_le_to_cpu32 (subnet_mask.ipv4)) The count of zero with __builtin_clz can be 22. (clz counts the number of one bits preceding the most significant zero bit) --- grub-core/net/drivers/ieee1275/ofnet.c | 2 +- 1 file changed, 1 insertion(+), 2 deletions(-) diff -ur grub-2.02~/grub-core/net/drivers/ieee1275/ofnet.c grub-2.02/grub-core/net/drivers/ieee1275/ofnet.c --- grub-2.02~/grub-core/net/drivers/ieee1275/ofnet.c 2018-03-26 13:49:55.399558334 +0200 +++ grub-2.02/grub-core/net/drivers/ieee1275/ofnet.c 2018-03-26 13:51:03.092656921 +0200 @@ -232,7 +232,7 @@ } grub_net_add_ipv4_local (inter, - __builtin_ctz (~grub_le_to_cpu32 (subnet_mask.ipv4))); + __builtin_clz (~ (subnet_mask.ipv4))); } if (gateway_addr.ipv4 != 0)