All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fiona Klute via buildroot <buildroot@buildroot.org>
To: Rhidian De Wit <rhidian.dewit@openpixelsystems.org>,
	buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH] Avoid segfault on x86-64 with invalid EFI boot entries
Date: Tue, 25 Aug 2026 20:11:09 +0200	[thread overview]
Message-ID: <b1733911-86a5-4e32-bf75-9c025792093c@gmx.de> (raw)
In-Reply-To: <20260825143045.3860877-1-rhidian.dewit@openpixelsystems.org>

Hi Rhidian!

Am 25.08.26 um 16:30 schrieb Rhidian De Wit:
> Upstream: https://github.com/rauc/rauc/pull/2029

The "Upstream" trailer needs to be in the patch file (see below, or [1] 
for an example).

> Signed-off-by: Rhidian De Wit <rhidian.dewit@openpixelsystems.org>
> ---
>   ...bootcurrent-is-valid-before-using-it.patch | 43 +++++++++++++++++++
>   1 file changed, 43 insertions(+)
>   create mode 100644 package/rauc/0001-Check-if-bootcurrent-is-valid-before-using-it.patch
> 
> diff --git a/package/rauc/0001-Check-if-bootcurrent-is-valid-before-using-it.patch b/package/rauc/0001-Check-if-bootcurrent-is-valid-before-using-it.patch
> new file mode 100644
> index 0000000000..38fc02c5bf
> --- /dev/null
> +++ b/package/rauc/0001-Check-if-bootcurrent-is-valid-before-using-it.patch
> @@ -0,0 +1,43 @@
> +From 931d0af0f66b9afd2a7c9d9532abef1ec67b1f69 Mon Sep 17 00:00:00 2001
> +From: Rhidian De Wit <rhidian.dewit@openpixelsystems.org>
> +Date: Mon, 24 Aug 2026 10:04:24 +0200
> +Subject: [PATCH] Check if bootcurrent is valid before using it
> +

This is were the "Upstream:" should be.

> +Signed-off-by: Rhidian De Wit <rhidian.dewit@openpixelsystems.org>
> +---
> + src/bootloaders/efi.c | 19 +++++++++++--------
> + 1 file changed, 11 insertions(+), 8 deletions(-)
> +
> +diff --git a/src/bootloaders/efi.c b/src/bootloaders/efi.c
> +index 19224118..6de5f73d 100644
> +--- a/src/bootloaders/efi.c
> ++++ b/src/bootloaders/efi.c
> +@@ -625,14 +625,17 @@ gchar *r_efi_get_current_bootname(RaucConfig *config, GError **error)
> + 		return NULL;
> + 	}
> +
> +-	GHashTableIter iter;
> +-	g_hash_table_iter_init(&iter, config->slots);
> +-	RaucSlot *slot = NULL;
> +-	while (g_hash_table_iter_next(&iter, NULL, (gpointer*) &slot)) {
> +-		if (g_strcmp0(slot->bootname, bootcurrent->name) == 0) {
> +-			return slot->bootname;
> +-		}
> +-	}
> ++  if (bootcurrent != NULL)
> ++  {
> ++    GHashTableIter iter;
> ++    g_hash_table_iter_init(&iter, config->slots);
> ++    RaucSlot *slot = NULL;
> ++    while (g_hash_table_iter_next(&iter, NULL, (gpointer*) &slot)) {
> ++      if (g_strcmp0(slot->bootname, bootcurrent->name) == 0) {
> ++        return slot->bootname;
> ++      }
> ++    }
> ++  }

Indentation is very different from the surrounding code (tab vs. 2 
spaces per level), I assume upstream will want that fixed, too.

Best regards,
Fiona


[1] 
https://gitlab.com/buildroot.org/buildroot/-/blob/9dc567aa78e6381ff7100b696535f1ffdd8447f7/package/musl/0003-fix-pathological-slowness-incorrect-mappings-in-icon.patch#L44

> +
> + 	g_set_error(error,
> + 			R_BOOTCHOOSER_ERROR,
> +--
> +2.51.0
> +

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  parent reply	other threads:[~2026-08-25 18:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-25 14:30 [Buildroot] [PATCH] Avoid segfault on x86-64 with invalid EFI boot entries Rhidian De Wit
2026-08-25 14:30 ` [Buildroot] [PATCH] Avoid double-free on x86-64 systems with no cmdline set Rhidian De Wit
2026-08-25 18:11 ` Fiona Klute via buildroot [this message]
2026-08-26 13:36   ` [Buildroot] [PATCH] Avoid segfault on x86-64 with invalid EFI boot entries Rhidian De Wit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b1733911-86a5-4e32-bf75-9c025792093c@gmx.de \
    --to=buildroot@buildroot.org \
    --cc=fiona.klute@gmx.de \
    --cc=rhidian.dewit@openpixelsystems.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.