All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] Avoid segfault on x86-64 with invalid EFI boot entries
@ 2026-08-25 14:30 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 ` [Buildroot] [PATCH] Avoid segfault on x86-64 with invalid EFI boot entries Fiona Klute via buildroot
  0 siblings, 2 replies; 4+ messages in thread
From: Rhidian De Wit @ 2026-08-25 14:30 UTC (permalink / raw)
  To: buildroot; +Cc: Rhidian De Wit

Upstream: https://github.com/rauc/rauc/pull/2029

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
+
+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;
++      }
++    }
++  }
+ 
+ 	g_set_error(error,
+ 			R_BOOTCHOOSER_ERROR,
+-- 
+2.51.0
+
-- 
2.51.0

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH] Avoid double-free on x86-64 systems with no cmdline set
  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 ` Rhidian De Wit
  2026-08-25 18:11 ` [Buildroot] [PATCH] Avoid segfault on x86-64 with invalid EFI boot entries Fiona Klute via buildroot
  1 sibling, 0 replies; 4+ messages in thread
From: Rhidian De Wit @ 2026-08-25 14:30 UTC (permalink / raw)
  To: buildroot; +Cc: Rhidian De Wit

Upstream: https://github.com/rauc/rauc/pull/2028

Signed-off-by: Rhidian De Wit <rhidian.dewit@openpixelsystems.org>
---
 ...i-slot-bootname-to-avoid-double-free.patch | 39 +++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 package/rauc/0002-Duplicate-efi-slot-bootname-to-avoid-double-free.patch

diff --git a/package/rauc/0002-Duplicate-efi-slot-bootname-to-avoid-double-free.patch b/package/rauc/0002-Duplicate-efi-slot-bootname-to-avoid-double-free.patch
new file mode 100644
index 0000000000..a062844659
--- /dev/null
+++ b/package/rauc/0002-Duplicate-efi-slot-bootname-to-avoid-double-free.patch
@@ -0,0 +1,39 @@
+From 1b17578e90b2929e1a7ed1f3eec8d3b5f663b673 Mon Sep 17 00:00:00 2001
+From: Rhidian De Wit <rhidian.dewit@openpixelsystems.org>
+Date: Fri, 21 Aug 2026 16:37:45 +0200
+Subject: [PATCH] Duplicate efi slot bootname to avoid double free
+
+Signed-off-by: Rhidian De Wit <rhidian.dewit@openpixelsystems.org>
+---
+ src/bootloaders/efi.c | 2 +-
+ test/bootchooser.c    | 1 +
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/bootloaders/efi.c b/src/bootloaders/efi.c
+index 19224118..8b0cf820 100644
+--- a/src/bootloaders/efi.c
++++ b/src/bootloaders/efi.c
+@@ -630,7 +630,7 @@ gchar *r_efi_get_current_bootname(RaucConfig *config, GError **error)
+ 	RaucSlot *slot = NULL;
+ 	while (g_hash_table_iter_next(&iter, NULL, (gpointer*) &slot)) {
+ 		if (g_strcmp0(slot->bootname, bootcurrent->name) == 0) {
+-			return slot->bootname;
++			return g_strdup(slot->bootname);
+ 		}
+ 	}
+ 
+diff --git a/test/bootchooser.c b/test/bootchooser.c
+index 43c45397..c35a78f1 100644
+--- a/test/bootchooser.c
++++ b/test/bootchooser.c
+@@ -970,6 +970,7 @@ bootname=system1\n";
+ 
+ 	bootname = r_boot_get_current_bootname(r_context()->config, "", &error);
+ 	g_assert_nonnull(bootname);
++	g_clear_pointer(&bootname, g_free);
+ }
+ 
+ /* If the underlying 'efibootmgr --bootorder ...' call fails (e.g. the
+-- 
+2.51.0
+
-- 
2.51.0

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Buildroot] [PATCH] Avoid segfault on x86-64 with invalid EFI boot entries
  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
  2026-08-26 13:36   ` Rhidian De Wit
  1 sibling, 1 reply; 4+ messages in thread
From: Fiona Klute via buildroot @ 2026-08-25 18:11 UTC (permalink / raw)
  To: Rhidian De Wit, buildroot

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Buildroot] [PATCH] Avoid segfault on x86-64 with invalid EFI boot entries
  2026-08-25 18:11 ` [Buildroot] [PATCH] Avoid segfault on x86-64 with invalid EFI boot entries Fiona Klute via buildroot
@ 2026-08-26 13:36   ` Rhidian De Wit
  0 siblings, 0 replies; 4+ messages in thread
From: Rhidian De Wit @ 2026-08-26 13:36 UTC (permalink / raw)
  To: Fiona Klute; +Cc: buildroot

Thanks for the pointers! Will fix them!


Op di 25 aug 2026 om 20:11 schreef Fiona Klute <fiona.klute@gmx.de>:
>
> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-08-26 13:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [Buildroot] [PATCH] Avoid segfault on x86-64 with invalid EFI boot entries Fiona Klute via buildroot
2026-08-26 13:36   ` Rhidian De Wit

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.