Hello community,

here is the log from the commit of package efivar.13473 for 
openSUSE:Leap:15.2:Update checked in at 2020-07-26 12:22:54
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Leap:15.2:Update/efivar.13473 (Old)
 and      /work/SRC/openSUSE:Leap:15.2:Update/.efivar.13473.new.3592 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "efivar.13473"

Sun Jul 26 12:22:54 2020 rev:1 rq:822304 version:37

Changes:
--------
New Changes file:

--- /dev/null   2020-07-16 02:54:20.700682797 +0200
+++ /work/SRC/openSUSE:Leap:15.2:Update/.efivar.13473.new.3592/efivar.changes   
2020-07-26 12:22:55.631495655 +0200
@@ -0,0 +1,259 @@
+-------------------------------------------------------------------
+Fri Mar  8 03:16:22 UTC 2019 - Gary Ching-Pang Lin <g...@suse.com>
+
+- Add efivar-bsc1127544-fix-ucs2len.patch to fix logic that checks
+  for UCS-2 string termination (boo#1127544)
+- Add efivar-fix-efidp_ipv4_addr-fields-assignment.patch to fix the
+  casting of IPv4 address.
+
+-------------------------------------------------------------------
+Fri Feb 22 08:24:56 UTC 2019 - Gary Ching-Pang Lin <g...@suse.com>
+
+- Update to 37
+  + Improve ACPI device path formatting
+  + Add support for SOC devices that use FDT as their PCI root node
+  + Make devices we can't parse the "device" sysfs link for use
+    DEV_ABBREV_ONLY
+  + Handle SCSI port numbers better
+  + Don't require an EUI for NVMe (boo#1100077)
+  + Fix the accidental requirement on ACPI UID nodes existing
+  + Add support for EMMC devices
+  + Add support for PCI root nodes without a device link in sysfs
+  + Add support for partitioned MD devices
+  + Fix partition number detection when the number isn't provided
+  + Add support for ACPI Generic Container and Embedded Controller
+    root nodes (boo#1101023)
+  + Add limited support for SAS/SATA port expanders
+- Add upstream patches to fix boo#1120862
+  + efivar-make-format_guid-handle-misaligned-guid-pointer.patch
+  + efivar-Fix-all-the-places-Werror-address-of-packed-member-c.patch
+- Drop upstreamed reproducible.patch
+- Refresh libefiboot-export-disk_get_partition_info.patch
+- Use %license for COPYING
+
+-------------------------------------------------------------------
+Tue Jul 24 07:45:35 UTC 2018 - bwiedem...@suse.com
+
+- Add reproducible.patch to initialize memory (boo#1061219)
+
+-------------------------------------------------------------------
+Mon Jul 16 07:45:14 UTC 2018 - g...@suse.com
+
+- Downgrade to 35 (fate#326702)
+  + 36 rewrote the linux interface parsers and caused several
+    problems in efibootmgr. Downgrade the version before the change
+    to avoid the failure of boot variable creation
+    (boo#1100077, boo#1101023)
+- Refresh libefiboot-export-disk_get_partition_info.patch
+
+-------------------------------------------------------------------
+Wed Jun 20 15:03:30 UTC 2018 - oli...@getspam.de
+
+- Update to version 36
+- adjust libefiboot-export-disk_get_partition_info.patch to fit
+  new version
+
+-------------------------------------------------------------------
+Thu Mar 23 15:32:57 UTC 2017 - jeng...@inai.de
+
+- RPM group fix
+
+-------------------------------------------------------------------
+Fri Mar  3 18:09:42 UTC 2017 - r...@suse.com
+
+- libefiboot-export-disk_get_partition_info.patch:
+  (bsc#870211, bsc#945705)
+
+-------------------------------------------------------------------
+Tue Feb 10 10:40:18 UTC 2017 - r...@suse.com
+
+- Update to 31  (fate#322108)
+- Drop upstreamed patches
+  + efivar-no-static.patch
+  + deprecated-readdir_r.patch
+  + efivar-use-sysmacros.patch
+
+-------------------------------------------------------------------
+Thu Feb  9 06:32:10 UTC 2017 - g...@suse.com
+
+- Add efivar-use-sysmacros.patch to fix the Factory/Tumbleweed
+  build correctly.
+- Amend the spec file to specify the gcc version for SLE11SP4
+
+-------------------------------------------------------------------
+Mon Feb  6 14:40:25 UTC 2017 - r...@suse.com
+
+- Fix building for SLE11SP4, SLE12SP2, and Tumbleweed
+  (fate#322108, bnc#1012765)
+- Drop obsolete patch
+  efivar-bsc988000-remove-versioning-efi_set_variable.patch
+
+-------------------------------------------------------------------
+Wed Jul 13 03:54:20 UTC 2016 - g...@suse.com
+
+- Update to 0.24
+- Drop upstreamed patches
+  + efivar-0.21-gcc6.diff
+  + efivar-nvme-rename.patch
+  + efivar-nvme-no-kernel-header.patch
+  + efivar-relicensing.patch
+  + efivar-bsc988000-fix-mode-efi_set_variable.patch
+
+-------------------------------------------------------------------
+Tue Jul 12 09:00:02 UTC 2016 - sch...@suse.de
+
+- deprecated-readdir_r.patch: Remove use of deprecated readdir_r
+
+-------------------------------------------------------------------
+Mon Jul 11 06:44:37 UTC 2016 - g...@suse.com
+
+- Add efivar-bsc988000-fix-mode-efi_set_variable.patch and
+  efivar-bsc988000-remove-versioning-efi_set_variable.patch to set
+  the default file mode rather than fetching a value randomly
+  (bsc#988000)
+
+-------------------------------------------------------------------
+Wed Apr 13 02:08:09 UTC 2016 - g...@suse.com
+
+- Add efivar-relicensing.patch to update the license in some files
+
+-------------------------------------------------------------------
+Tue Apr 12 02:05:47 UTC 2016 - g...@suse.com
+
+- Add the missing COPYING
+
+-------------------------------------------------------------------
+Wed Mar  9 04:23:29 UTC 2016 - g...@suse.com
+
+- Update to 0.23 for fwupdate (FATE#319345)
+- Add efivar-nvme-rename.patch and efivar-nvme-no-kernel-header.patch
+  to work around the missing kernel header.
+- Add efivar-no-static.patch to remove efivar-static since it
+  causes build failure and we don't really need it.
+- Remove efivar-fix-initializer.patch since it's already in 0.23.
+- Remove _smp_mflags since the Makefile doesn't work well with
+  the flag.
+
+-------------------------------------------------------------------
+Wed Feb 10 15:31:35 UTC 2016 - rguent...@suse.com
+
+- Add efivar-0.21-gcc6.diff to fix strict-aliasing issue.
+- Build with -Wno-nonnull as efivar tests nonnull args for zero
+  and that breaks with its use of -Werror.
+
+-------------------------------------------------------------------
+Tue Dec  1 09:08:28 UTC 2015 - g...@suse.com
+
+- Update the source link
+
+-------------------------------------------------------------------
+Fri Nov 27 10:23:58 UTC 2015 - g...@suse.com
+
+- Update to 0.21
+- Add efivar-fix-initializer.patch to initialize ifreq properly
+- Drop patches
+  + efivar-fix-vars_del_variable.patch: upstreamed
+  + efivar-revert-linker-order.patch: not necessary
+
+-------------------------------------------------------------------
+Wed Jun 24 09:58:16 UTC 2015 - g...@suse.com
+
+- Add efivar-fix-vars_del_variable.patch to fix the deletion of
+  the variable with the old efivar kernel modules
+
+-------------------------------------------------------------------
+Tue Jun 16 07:30:20 UTC 2015 - g...@suse.com
+
+- Add efivar-revert-linker-order.patch to adjust the linker order
+  which caused the compilation error in pesign
+
+-------------------------------------------------------------------
+Thu Jun 11 06:59:41 UTC 2015 - mplus...@suse.com
+
+- Use default CFLAGS
+
+-------------------------------------------------------------------
+Wed Jun  3 07:46:58 UTC 2015 - mplus...@suse.com
+
+- Update to 0.20
+  * Make sure tester is build with the right link order for
+    libraries.
+  * Adjust linker order for pkg-config
+  * Work around LocateDevicePath() not grokking PcieRoot() devices
+    properly.
+  * Rectify some missing changelog entries
+- Changes for 0.19
+  * Lots of debugging in this release, as well as some of the
+    documentation that's planned. There's more of that to come.
+- Changes for 0.18
+  * This release is mostly about adding the efidp and libefiboot
+    APIs available.Next release will feature documentation for
+    them, verification that various different device path types
+    work, etc. Right now efi device path generation is basically
+    limited to:
+    + full file paths on sata devices
+    + full file paths on sas devices
+    + HD() paths for SATA and SAS devices
+    + ipv4 dhcp device paths that don't specify their own
++++ 62 more lines (skipped)
++++ between /dev/null
++++ and 
/work/SRC/openSUSE:Leap:15.2:Update/.efivar.13473.new.3592/efivar.changes

New:
----
  efivar-37.tar.bz2
  efivar-Fix-all-the-places-Werror-address-of-packed-member-c.patch
  efivar-bsc1127544-fix-ucs2len.patch
  efivar-fix-efidp_ipv4_addr-fields-assignment.patch
  efivar-make-format_guid-handle-misaligned-guid-pointer.patch
  efivar.changes
  efivar.spec
  libefiboot-export-disk_get_partition_info.patch
  reproducible.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ efivar.spec ++++++
#
# spec file for package efivar
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


%if 0%{?suse_version} <= 1320
  # Allow building on older products (SLE11SP4, SLES12, and Leap 42.2)
  %define gcc 5
  %define gcc_v %{gcc}
  %if 120200 <= 0%{?sle_version} && 0%{?sle_version} < 130000
    %define gcc 6
    %define gcc_v %{gcc}
  %endif
%endif
%define major 1

Name:           efivar
Version:        37
Release:        0
Summary:        Tools to manage UEFI variables
License:        LGPL-2.1-only
Group:          Development/Libraries/C and C++
Url:            https://github.com/rhinstaller/efivar
Source:         
https://github.com/rhinstaller/%{name}/releases/download/%{version}/%{name}-%{version}.tar.bz2
Patch0:         libefiboot-export-disk_get_partition_info.patch
# PATCH-FIX-UPSTREAM boo#1120862
Patch1:         efivar-make-format_guid-handle-misaligned-guid-pointer.patch
# PATCH-FIX-UPSTREAM boo#1120862
Patch2:         
efivar-Fix-all-the-places-Werror-address-of-packed-member-c.patch
Patch3:         efivar-bsc1127544-fix-ucs2len.patch
Patch4:         efivar-fix-efidp_ipv4_addr-fields-assignment.patch
%if "0%{?buildroot}" == "0"
# set a sane value for buildroot, unless it's already there!
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%endif
BuildRequires:  fdupes
BuildRequires:  pkg-config
BuildRequires:  popt-devel
%if 0%{?gcc} != 0
BuildRequires:  gcc%{gcc}
%endif
Requires:       libefivar%{major} = %{version}-%{release}

%description
efivar provides a simple command line interface to the UEFI variable facility.

%package -n libefivar%{major}
Summary:        Library to manage UEFI variables
Group:          System/Libraries

%description -n libefivar%{major}
Library to allow for the simple manipulation of UEFI variables.

%package devel
Summary:        Development headers for libefivar
Group:          Development/Libraries/C and C++
Requires:       libefivar%{major} = %{version}-%{release}

%description devel
Development headers required to use libefivar.

%prep
%setup -q
%patch0 -p1
%if 0%{?suse_version} == 1110
# Instead of conditional patching:
# - 'popt.pc' missing in 'popt-devel' on SLE11
perl -pi -e 's{^.*PKGS=popt.*$}{}; s{^(efivar\S* : LIBS=.*)dl}{$1popt dl}' \
   src/Makefile
# - 'uchar.h' missing in both 'glibc-devel' and 'gcc-5' packages on SLE11
perl -pi -e 's{\#include \<uchar\.h\>}{typedef __CHAR16_TYPE__ char16_t;}' \
   src/export.c
%endif
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1

%build
CFLAGS="%{optflags} -Wno-nonnull -flto"
%ifarch ia64
  CFLAGS="${CFLAGS//-fstack-protector/}"
%endif
export CFLAGS

make \
%if 0%{?gcc_v} != 0
  CC=gcc-%{gcc_v} \
  AR=gcc-ar-%{gcc_v} \
  NM=gcc-nm-%{gcc_v} \
  RANLIB=gcc-ranlib-%{gcc_v} \
%endif
  libdir=%{_libdir} \
  bindir=%{_bindir}

%install
make DESTDIR=%{buildroot} \
  libdir=%{_libdir} \
  bindir=%{_bindir} \
  install
%fdupes -s %{buildroot}

# fail on undercover ABI changes
file %{buildroot}/%{_libdir}/lib%{name}.so.%{major}*

%post -n libefivar%{major} -p /sbin/ldconfig

%postun -n libefivar%{major} -p /sbin/ldconfig

%files
%defattr(-,root,root)
%license COPYING
%{_bindir}/efivar
%{_mandir}/man1/*

%files devel
%defattr(-,root,root)
%{_mandir}/man3/*
%{_includedir}/*
%{_libdir}/*.so
%{_libdir}/pkgconfig/*.pc

%files -n libefivar%{major}
%defattr(-,root,root)
%{_libdir}/*.so.*

%changelog
++++++ efivar-Fix-all-the-places-Werror-address-of-packed-member-c.patch ++++++
>From c3c553db85ff10890209d0fe48fb4856ad68e4e0 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjo...@redhat.com>
Date: Thu, 21 Feb 2019 15:20:12 -0500
Subject: [PATCH] Fix all the places -Werror=address-of-packed-member catches.

This gets rid of all the places GCC 9's -Werror=address-of-packed-member
flags as problematic.

Fixes github issue #123

Signed-off-by: Peter Jones <pjo...@redhat.com>
---
 src/dp-message.c            |  6 ++++--
 src/dp.h                    | 12 ++++--------
 src/guid.c                  |  2 +-
 src/include/efivar/efivar.h |  2 +-
 src/ucs2.h                  | 27 +++++++++++++++++++--------
 5 files changed, 29 insertions(+), 20 deletions(-)

diff --git a/src/dp-message.c b/src/dp-message.c
index 3724e5f..9f96466 100644
--- a/src/dp-message.c
+++ b/src/dp-message.c
@@ -620,11 +620,13 @@ _format_message_dn(char *buf, size_t size, const_efidp dp)
                          ) / sizeof(efi_ip_addr_t);
                format(buf, size, off, "Dns", "Dns(");
                for (int i=0; i < end; i++) {
-                       const efi_ip_addr_t *addr = &dp->dns.addrs[i];
+                       efi_ip_addr_t addr;
+
+                       memcpy(&addr, &dp->dns.addrs[i], sizeof(addr));
                        if (i != 0)
                                format(buf, size, off, "Dns", ",");
                        format_ip_addr(buf, size, off, "Dns",
-                                      dp->dns.is_ipv6, addr);
+                                      dp->dns.is_ipv6, &addr);
                }
                format(buf, size, off, "Dns", ")");
                break;
diff --git a/src/dp.h b/src/dp.h
index 20cb608..1f921d5 100644
--- a/src/dp.h
+++ b/src/dp.h
@@ -71,13 +71,9 @@
                int _rc;                                                \
                char *_guidstr = NULL;                                  \
                efi_guid_t _guid;                                       \
-               const efi_guid_t * const _guid_p =                      \
-                       likely(__alignof__(guid) == sizeof(guid))       \
-                               ? guid                                  \
-                               : &_guid;                               \
-                                                                       \
-               if (unlikely(__alignof__(guid) == sizeof(guid)))        \
-                       memmove(&_guid, guid, sizeof(_guid));           \
+               const efi_guid_t * const _guid_p = &_guid;              \
+                                                                       \
+               memmove(&_guid, guid, sizeof(_guid));                   \
                _rc = efi_guid_to_str(_guid_p, &_guidstr);              \
                if (_rc < 0) {                                          \
                        efi_error("could not build %s GUID DP string",  \
@@ -86,7 +82,7 @@
                        _guidstr = onstack(_guidstr,                    \
                                           strlen(_guidstr)+1);         \
                        _rc = format(buf, size, off, dp_type, "%s",     \
-                                    _guidstr); \
+                                    _guidstr);                         \
                }                                                       \
                _rc;                                                    \
        })
diff --git a/src/guid.c b/src/guid.c
index 306c9ff..3156b3b 100644
--- a/src/guid.c
+++ b/src/guid.c
@@ -31,7 +31,7 @@
 extern const efi_guid_t efi_guid_zero;
 
 int NONNULL(1, 2) PUBLIC
-efi_guid_cmp(const efi_guid_t *a, const efi_guid_t *b)
+efi_guid_cmp(const void * const a, const void * const b)
 {
        return memcmp(a, b, sizeof (efi_guid_t));
 }
diff --git a/src/include/efivar/efivar.h b/src/include/efivar/efivar.h
index 316891c..ad6449d 100644
--- a/src/include/efivar/efivar.h
+++ b/src/include/efivar/efivar.h
@@ -128,7 +128,7 @@ extern int efi_symbol_to_guid(const char *symbol, 
efi_guid_t *guid)
 
 extern int efi_guid_is_zero(const efi_guid_t *guid);
 extern int efi_guid_is_empty(const efi_guid_t *guid);
-extern int efi_guid_cmp(const efi_guid_t *a, const efi_guid_t *b);
+extern int efi_guid_cmp(const void * const a, const void * const b);
 
 /* import / export functions */
 typedef struct efi_variable efi_variable_t;
diff --git a/src/ucs2.h b/src/ucs2.h
index dbb5900..edd8367 100644
--- a/src/ucs2.h
+++ b/src/ucs2.h
@@ -23,16 +23,21 @@
        (((val) & ((mask) << (shift))) >> (shift))
 
 static inline size_t UNUSED
-ucs2len(const uint16_t * const s, ssize_t limit)
+ucs2len(const void *vs, ssize_t limit)
 {
        ssize_t i;
-       for (i = 0; i < (limit >= 0 ? limit : i+1) && s[i] != (uint16_t)0; i++)
+       const uint16_t *s = vs;
+       const uint8_t *s8 = vs;
+
+       for (i = 0;
+            i < (limit >= 0 ? limit : i+1) && s8[0] != 0 && s8[1] != 0;
+            i++, s8 += 2, s++)
                ;
        return i;
 }
 
 static inline size_t UNUSED
-ucs2size(const uint16_t * const s, ssize_t limit)
+ucs2size(const void *s, ssize_t limit)
 {
        size_t rc = ucs2len(s, limit);
        rc *= sizeof (uint16_t);
@@ -69,10 +74,11 @@ utf8size(uint8_t *s, ssize_t limit)
 }
 
 static inline unsigned char * UNUSED
-ucs2_to_utf8(const uint16_t * const chars, ssize_t limit)
+ucs2_to_utf8(const void * const voidchars, ssize_t limit)
 {
        ssize_t i, j;
        unsigned char *ret;
+       const uint16_t * const chars = voidchars;
 
        if (limit < 0)
                limit = ucs2len(chars, -1);
@@ -124,10 +130,12 @@ ucs2_to_utf8(const uint16_t * const chars, ssize_t limit)
 }
 
 static inline ssize_t UNUSED NONNULL(4)
-utf8_to_ucs2(uint16_t *ucs2, ssize_t size, int terminate, uint8_t *utf8)
+utf8_to_ucs2(void *ucs2void, ssize_t size, int terminate, uint8_t *utf8)
 {
        ssize_t req;
        ssize_t i, j;
+       uint16_t *ucs2 = ucs2void;
+       uint16_t val16;
 
        if (!ucs2 && size > 0) {
                errno = EINVAL;
@@ -162,10 +170,13 @@ utf8_to_ucs2(uint16_t *ucs2, ssize_t size, int terminate, 
uint8_t *utf8)
                        val = utf8[i] & 0x7f;
                        i += 1;
                }
-               ucs2[j] = val;
+               val16 = val;
+               ucs2[j] = val16;
+       }
+       if (terminate) {
+               val16 = 0;
+               ucs2[j++] = val16;
        }
-       if (terminate)
-               ucs2[j++] = (uint16_t)0;
        return j;
 };
 
-- 
2.20.1

++++++ efivar-bsc1127544-fix-ucs2len.patch ++++++
>From fdb803402fb32fa6d020bac57a40c7efe4aabb7d Mon Sep 17 00:00:00 2001
From: Javier Martinez Canillas <javi...@redhat.com>
Date: Tue, 5 Mar 2019 17:23:24 +0100
Subject: [PATCH 1/2] ucs2.h: remove unused variable

The const uint16_t pointer is not used since now the two bytes of the
UCS-2 chars are checked to know if is the termination of the string.

Signed-off-by: Javier Martinez Canillas <javi...@redhat.com>
---
 src/ucs2.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/ucs2.h b/src/ucs2.h
index edd8367..e0390c3 100644
--- a/src/ucs2.h
+++ b/src/ucs2.h
@@ -26,12 +26,11 @@ static inline size_t UNUSED
 ucs2len(const void *vs, ssize_t limit)
 {
        ssize_t i;
-       const uint16_t *s = vs;
        const uint8_t *s8 = vs;
 
        for (i = 0;
             i < (limit >= 0 ? limit : i+1) && s8[0] != 0 && s8[1] != 0;
-            i++, s8 += 2, s++)
+            i++, s8 += 2)
                ;
        return i;
 }
-- 
2.20.1


>From 4e04afc2df9bbc26e5ab524b53a6f4f1e61d7c9e Mon Sep 17 00:00:00 2001
From: Javier Martinez Canillas <javi...@redhat.com>
Date: Tue, 5 Mar 2019 17:23:32 +0100
Subject: [PATCH 2/2] ucs2.h: fix logic that checks for UCS-2 string
 termination

Currently the loop to count the lenght of the UCS-2 string ends if either
of the two bytes are 0, but 0 is a valid value for UCS-2 character codes.

So only break the loop when 0 is the value for both UCS-2 char bytes.

Signed-off-by: Javier Martinez Canillas <javi...@redhat.com>
---
 src/ucs2.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/ucs2.h b/src/ucs2.h
index e0390c3..fd8b056 100644
--- a/src/ucs2.h
+++ b/src/ucs2.h
@@ -29,7 +29,7 @@ ucs2len(const void *vs, ssize_t limit)
        const uint8_t *s8 = vs;
 
        for (i = 0;
-            i < (limit >= 0 ? limit : i+1) && s8[0] != 0 && s8[1] != 0;
+            i < (limit >= 0 ? limit : i+1) && !(s8[0] == 0 && s8[1] == 0);
             i++, s8 += 2)
                ;
        return i;
-- 
2.20.1

++++++ efivar-fix-efidp_ipv4_addr-fields-assignment.patch ++++++
>From 836461e480e2249de134efeaef79588cab045d5c Mon Sep 17 00:00:00 2001
From: Javier Martinez Canillas <javi...@redhat.com>
Date: Tue, 5 Mar 2019 17:23:36 +0100
Subject: [PATCH] dp-message: fix efidp_ipv4_addr fields assignment

The efidp_ipv4_addr structure has some 4-byte array fields to store IPv4
addresses and network mask. But the efidp_make_ipv4() function wrongly
casts these as a char * before dereferencing them to store a value.

Instead, cast it to a uint32_t * so the 32-bit value is correctly stored.

Signed-off-by: Javier Martinez Canillas <javi...@redhat.com>
---
 src/dp-message.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/dp-message.c b/src/dp-message.c
index 6b8e907..55fa781 100644
--- a/src/dp-message.c
+++ b/src/dp-message.c
@@ -678,16 +678,16 @@ efidp_make_ipv4(uint8_t *buf, ssize_t size, uint32_t 
local, uint32_t remote,
                                        EFIDP_MSG_IPv4, sizeof (*ipv4));
        ssize_t req = sizeof (*ipv4);
        if (size && sz == req) {
-               *((char *)ipv4->local_ipv4_addr) = htonl(local);
-               *((char *)ipv4->remote_ipv4_addr) = htonl(remote);
+               *((uint32_t *)ipv4->local_ipv4_addr) = htonl(local);
+               *((uint32_t *)ipv4->remote_ipv4_addr) = htonl(remote);
                ipv4->local_port = htons(local_port);
                ipv4->remote_port = htons(remote_port);
                ipv4->protocol = htons(protocol);
                ipv4->static_ip_addr = 0;
                if (is_static)
                        ipv4->static_ip_addr = 1;
-               *((char *)ipv4->gateway) = htonl(gateway);
-               *((char *)ipv4->netmask) = htonl(netmask);
+               *((uint32_t *)ipv4->gateway) = htonl(gateway);
+               *((uint32_t *)ipv4->netmask) = htonl(netmask);
        }
 
        if (sz < 0)
-- 
2.20.1

++++++ efivar-make-format_guid-handle-misaligned-guid-pointer.patch ++++++
>From b98ba8921010d03f46704a476c69861515deb1ca Mon Sep 17 00:00:00 2001
From: Peter Jones <pjo...@redhat.com>
Date: Mon, 7 Jan 2019 10:30:59 -0500
Subject: [PATCH] dp.h: make format_guid() handle misaligned guid pointers
 safely.

GCC 9 adds -Werror=address-of-packed-member, which causes us to see the
build error reported at
 https://bugzilla.opensuse.org/show_bug.cgi?id=1120862 .

That bug report shows us the following:

In file included from dp.c:26:
dp.h: In function 'format_vendor_helper':
dp.h:120:37: error: taking address of packed member of 'struct <anonymous>' may 
result in an unaligned pointer value [-Werror=address-of-packed-member]
  120 |  format_guid(buf, size, off, label, &dp->hw_vendor.vendor_guid);
      |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~
dp.h:74:25: note: in definition of macro 'format_guid'
   74 |   _rc = efi_guid_to_str(guid, &_guidstr);   \
      |                         ^~~~
cc1: all warnings being treated as errors

This patch makes format_guid() use a local variable as a bounce buffer
in the case that the guid we're passed is aligned as chaotic neutral.

Note that this only fixes this instance and there may be others that bz
didn't show because it exited too soon, and I don't have a gcc 9 build
in front of me right now.

Signed-off-by: Peter Jones <pjo...@redhat.com>
---
 src/dp.h | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/dp.h b/src/dp.h
index aa4e390..20cb608 100644
--- a/src/dp.h
+++ b/src/dp.h
@@ -70,8 +70,15 @@
 #define format_guid(buf, size, off, dp_type, guid) ({                  \
                int _rc;                                                \
                char *_guidstr = NULL;                                  \
-                                                                       \
-               _rc = efi_guid_to_str(guid, &_guidstr);                 \
+               efi_guid_t _guid;                                       \
+               const efi_guid_t * const _guid_p =                      \
+                       likely(__alignof__(guid) == sizeof(guid))       \
+                               ? guid                                  \
+                               : &_guid;                               \
+                                                                       \
+               if (unlikely(__alignof__(guid) == sizeof(guid)))        \
+                       memmove(&_guid, guid, sizeof(_guid));           \
+               _rc = efi_guid_to_str(_guid_p, &_guidstr);              \
                if (_rc < 0) {                                          \
                        efi_error("could not build %s GUID DP string",  \
                                  dp_type);                             \
-- 
2.20.1

++++++ libefiboot-export-disk_get_partition_info.patch ++++++
Index: efivar-37/src/disk.c
===================================================================
--- efivar-37.orig/src/disk.c
+++ efivar-37/src/disk.c
@@ -256,6 +256,33 @@ is_partitioned(int fd)
        return true;
 }
 
+/*
+ * efi_disk_get_partition_info()
+ *  @fd - open file descriptor to disk
+ *  @part   - partition number (1 is first partition on the disk)
+ *  @start - partition starting sector returned
+ *  @size  - partition size (in sectors) returned
+ *  @signature - partition signature returned
+ *  @mbr_type  - partition type returned
+ *  @signature_type - signature type returned
+ *
+ *  Description: Finds partition table info for given partition on given disk.
+ *               Both GPT and MSDOS partition tables are tested for.
+ *  Returns 0 on success, non-zero on failure
+ */
+int
+__attribute__((__nonnull__ (3,4,5,6,7)))
+__attribute__((__visibility__ ("default")))
+efi_disk_get_partition_info (int fd,
+                         uint32_t part,
+                         uint64_t *start, uint64_t *size,
+                         uint8_t *signature,
+                         uint8_t *mbr_type, uint8_t *signature_type)
+{
+        return get_partition_info(fd, EFIBOOT_OPTIONS_IGNORE_PMBR_ERR, part,
+                        start, size, signature, mbr_type, signature_type);
+}
+
 ssize_t HIDDEN
 make_hd_dn(uint8_t *buf, ssize_t size, int fd, int32_t partition,
            uint32_t options)
Index: efivar-37/src/include/efivar/efiboot-disk.h
===================================================================
--- /dev/null
+++ efivar-37/src/include/efivar/efiboot-disk.h
@@ -0,0 +1,32 @@
+/*
+ * libefiboot - library for the manipulation of EFI boot variables
+ * Copyright 2012-2015 Red Hat, Inc.
+ * Copyright (C) 2001 Dell Computer Corporation <matt_dom...@dell.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of the
+ * License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ */
+#ifndef _EFIBOOT_BOOT_H
+#define _EFIBOOT_BOOT_H 1
+
+extern int efi_disk_get_partition_info (int fd,
+                         uint32_t part,
+                         uint64_t *start, uint64_t *size,
+                         uint8_t *signature,
+                         uint8_t *mbr_type, uint8_t *signature_type)
+       __attribute__((__nonnull__ (3,4,5,6,7)))
+       __attribute__((__visibility__ ("default")));
+
+#endif /* _EFIBOOT_BOOT_H */
Index: efivar-37/src/include/efivar/efiboot.h
===================================================================
--- efivar-37.orig/src/include/efivar/efiboot.h
+++ efivar-37/src/include/efivar/efiboot.h
@@ -34,5 +34,6 @@
 
 #include <efivar/efiboot-creator.h>
 #include <efivar/efiboot-loadopt.h>
+#include <efivar/efiboot-disk.h>
 
 #endif /* EFIBOOT_H */
Index: efivar-37/src/libefiboot.map.in
===================================================================
--- efivar-37.orig/src/libefiboot.map.in
+++ efivar-37/src/libefiboot.map.in
@@ -33,3 +33,7 @@ LIBEFIBOOT_1.29 {
 
 LIBEFIBOOT_1.30 {
 } LIBEFIBOOT_1.29;
+
+LIBEFIBOOT_1.31 {
+        global: efi_disk_get_partition_info;
+} LIBEFIBOOT_1.30;
++++++ reproducible.patch ++++++
>From a02f33199a3c28a655178d35188efda71406a6a0 Mon Sep 17 00:00:00 2001
From: "Bernhard M. Wiedemann" <bwiedem...@suse.de>
Date: Tue, 24 Jul 2018 09:34:21 +0200
Subject: [PATCH] makeguids: initialize memory

so that we do not write uninitialized memory into guids.bin and names.bin
which made the resulting libefivar.so.1.36 unreproducible.
See https://reproducible-builds.org/ for why this matters.
---
 src/makeguids.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/makeguids.c b/src/makeguids.c
index f84fbb8..a15356b 100644
--- a/src/makeguids.c
+++ b/src/makeguids.c
@@ -147,6 +147,7 @@ main(int argc, char *argv[])
                outbuf = realloc(outbuf, line * sizeof (struct guidname));
                if (!outbuf)
                        err(1, "makeguids");
+               memset(outbuf + line - 1, 0, sizeof(struct guidname));
 
                char *symbol = strchr(guidstr, '\t');
                if (symbol == NULL)

Reply via email to