public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/fwupd-efi] main: Backport a patch from upstream to fix the SBAT section
@ 2026-10-28 15:21 Richard Hughes
  0 siblings, 0 replies; only message in thread
From: Richard Hughes @ 2026-10-28 15:21 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/fwupd-efi
Branch : main
Commit : d3065e0ddf518d3c132279e6b3d1a9520c260a8e
Author : Richard Hughes <richard@hughsie.com>
Date   : 2026-10-28T15:20:27+00:00
Stats  : +98/-0 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/fwupd-efi/c/d3065e0ddf518d3c132279e6b3d1a9520c260a8e?branch=main

Log:
Backport a patch from upstream to fix the SBAT section

---
diff --git a/0001-Add-efi_sbat_distro_generation-to-set-the-distro-SBA.patch b/0001-Add-efi_sbat_distro_generation-to-set-the-distro-SBA.patch
new file mode 100644
index 0000000..d985896
--- /dev/null
+++ b/0001-Add-efi_sbat_distro_generation-to-set-the-distro-SBA.patch
@@ -0,0 +1,96 @@
+From 82cdf4f71471034061656b0f9fb6f5a940fe3343 Mon Sep 17 00:00:00 2001
+From: Egor Ignatov <egori@altlinux.org>
+Date: Tue, 27 Oct 2026 12:58:35 +0500
+Subject: [PATCH] Add efi_sbat_distro_generation to set the distro SBAT
+ generation
+
+The distro entry was always passed a generation of 0, which generate_sbat.py
+treated as unset and replaced with the fwupd-efi generation. Bumping
+efi_sbat_fwupd_generation therefore also bumped every distro entry to 2.
+
+SBAT keeps the two generations independent: the distro one only goes up for
+distro-specific fixes and must never go back down, even when the global
+one is bumped.
+
+Distributions that have already shipped binaries with the distro entry at 2
+must set -Defi_sbat_distro_generation=2 to keep the number monotonic.
+
+See https://github.com/rhboot/shim/blob/main/SBAT.md
+---
+ README.md            | 13 +++++++++++++
+ efi/generate_sbat.py |  4 ++--
+ efi/meson.build      |  2 +-
+ meson_options.txt    |  1 +
+ 4 files changed, 17 insertions(+), 3 deletions(-)
+
+diff --git a/README.md b/README.md
+index 343ff57..3121a12 100644
+--- a/README.md
++++ b/README.md
+@@ -74,3 +74,16 @@ Typically, this will be set as part of the packager build script, e.g.
+     -Defi_sbat_distro_version="%{version}" \
+     -Defi_sbat_distro_url="https://src.fedoraproject.org/rpms/%{name}" \
+ ```
++
++The generation number of the distribution-specific SBAT entry defaults to 1 and
++is independent of the `fwupd-efi` generation. It is only incremented when a
++distribution-specific security fix requires revoking older builds of that
++distribution, and like the global generation it must never be decreased or
++reset, even when the `fwupd-efi` generation is bumped, e.g.
++
++```meson
++    -Defi_sbat_distro_generation=2 \
++```
++
++Distributions that have already shipped signed binaries with a distribution
++generation higher than 1 must set this option to keep the number monotonic.
+diff --git a/efi/generate_sbat.py b/efi/generate_sbat.py
+index b9b80ac..9209802 100755
+--- a/efi/generate_sbat.py
++++ b/efi/generate_sbat.py
+@@ -57,7 +57,7 @@ def _generate_sbat(args):
+             "{0}.{1},{2},{3},{4},{5},{6}\n".format(
+                 args.project_name,
+                 args.sbat_distro_id,
+-                args.sbat_distro_generation or args.sbat_generation,
++                args.sbat_distro_generation,
+                 args.sbat_distro_summary or FWUPD_SUMMARY,
+                 args.sbat_distro_pkgname,
+                 args.sbat_distro_version or args.project_version,
+@@ -99,7 +99,7 @@ if __name__ == "__main__":
+     parser.add_argument("--sbat-distro-id", default=None, help="SBAT distribution ID")
+     parser.add_argument(
+         "--sbat-distro-generation",
+-        default=None,
++        default=1,
+         type=int,
+         help="SBAT distribution generation",
+     )
+diff --git a/efi/meson.build b/efi/meson.build
+index 63f716c..4acb613 100644
+--- a/efi/meson.build
++++ b/efi/meson.build
+@@ -277,7 +277,7 @@ o_files += custom_target('fwup-sbat.o',
+                           '--sbat-version', '1',
+                           '--sbat-generation', '@0@'.format(get_option('efi_sbat_fwupd_generation')),
+                           '--sbat-distro-id', get_option('efi_sbat_distro_id'),
+-                          '--sbat-distro-generation', '0',
++                          '--sbat-distro-generation', '@0@'.format(get_option('efi_sbat_distro_generation')),
+                           '--sbat-distro-summary', get_option('efi_sbat_distro_summary'),
+                           '--sbat-distro-pkgname', get_option('efi_sbat_distro_pkgname'),
+                           '--sbat-distro-version', get_option('efi_sbat_distro_version'),
+diff --git a/meson_options.txt b/meson_options.txt
+index ec18f8e..8cc0781 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -2,6 +2,7 @@ option('efi-libdir', type : 'string', description : 'path to the EFI lib directo
+ option('efi-ldsdir', type : 'string', description : 'path to the EFI lds directory')
+ option('efi-includedir', type : 'string', value : '/usr/include/efi', description : 'path to the EFI header directory')
+ option('efi_sbat_fwupd_generation', type : 'integer', value : 2, description : 'SBAT fwupd generation')
++option('efi_sbat_distro_generation', type : 'integer', value : 1, description : 'SBAT distribution generation')
+ option('efi_sbat_distro_id', type : 'string', value : '', description : 'SBAT distribution ID, e.g. fedora')
+ option('efi_sbat_distro_summary', type : 'string', value : '', description : 'SBAT distribution summary, e.g. Fedora')
+ option('efi_sbat_distro_pkgname', type : 'string', value : '', description : 'SBAT distribution package name, e.g. fwupd')
+-- 
+2.56.0
+

diff --git a/fwupd-efi.spec b/fwupd-efi.spec
index b09bffc..69d7f47 100644
--- a/fwupd-efi.spec
+++ b/fwupd-efi.spec
@@ -8,6 +8,8 @@ License:   LGPL-2.1-or-later
 URL:       https://github.com/fwupd/fwupd-efi
 Source0:   https://github.com/fwupd/%{name}/archive/refs/tags/%{name}-%{version}.tar.xz
 
+Patch0:    0001-Add-efi_sbat_distro_generation-to-set-the-distro-SBA.patch
+
 # these are the only architectures supporting UEFI UpdateCapsule
 ExclusiveArch: x86_64 aarch64
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-28 15:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-28 15:21 [rpms/fwupd-efi] main: Backport a patch from upstream to fix the SBAT section Richard Hughes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox