Re: [PATCH v2] grub-mkimage: Fix empty SBAT metadata file issue
Daniel Kiper <[email protected]> Thu, 8 Jan 2026 16:28:37 +0100
| Newsgroups | org.gnu.grub-devel |
|---|---|
| Message-ID | <[email protected]> |
On Mon, Dec 29, 2025 at 04:25:24PM +0100, Daniel Kiper wrote: > On Wed, Dec 24, 2025 at 05:58:59PM +0530, Sudhakar Kuppusamy wrote: > > The grub-mkimage does not check if the SBAT metadata file is contains at least > > the SBAT header or not when creating core.elf with the SBAT metadata file. It > > leads to adding the empty SBAT ELF note for PowerPC and the .sbat section for EFI. > > Fixing this by checking the SBAT metadata file size against the SBAT header size > > before adding it to the ELF note or .sbat section. > > > > Signed-off-by: Sudhakar Kuppusamy <[email protected]> > > --- > > util/mkimage.c | 12 ++++++++++-- > > 1 file changed, 10 insertions(+), 2 deletions(-) > > > > diff --git a/util/mkimage.c b/util/mkimage.c > > index f364a5718..b3a815be5 100644 > > --- a/util/mkimage.c > > +++ b/util/mkimage.c > > @@ -56,6 +56,9 @@ > > > > #pragma GCC diagnostic ignored "-Wcast-align" > > > > +#define SBAT_HEADER "sbat,1,SBAT Version,sbat,1,https://github.com/rhboot/shim/blob/main/SBAT.md" > > You copy an example which is different from real SBAT. Please take > a look at real file and update the line accordingly. Ugh! It looks that I have wrongly remembered real usage or mixed up different things somehow. Sorry for the noise... > > +#define SBAT_HEADER_SIZE (sizeof(SBAT_HEADER)) > > Missing space after "sizeof". I will fix this for you. > Otherwise patch LGTM... Reviewed-by: Daniel Kiper <[email protected]> Daniel _______________________________________________ Grub-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/grub-devel