All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] loader/multiboot: do not add modules before successful download
@ 2024-08-23 18:20 Valentin Gehrke
  2024-09-02 16:44 ` Daniel Kiper
  2024-09-10 13:05 ` Daniel Kiper
  0 siblings, 2 replies; 8+ messages in thread
From: Valentin Gehrke @ 2024-08-23 18:20 UTC (permalink / raw)
  To: grub-devel

Multiboot modules that could not be read successfully (e.g. via network)
should not be added to the list of modules to forward to the operating
system that is to be booted subsequently.

This patch is necessary because even if a grub.cfg checks whether or not
a module was successfully downloaded, an attempt to retry a failed
download is futile because the corrupted module will be forwarded either
way.

Signed-off-by: Valentin Gehrke <valentin.gehrke@kernkonzept.com>
---
 grub-core/loader/multiboot.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/grub-core/loader/multiboot.c b/grub-core/loader/multiboot.c
index 94be512c4..36b27a906 100644
--- a/grub-core/loader/multiboot.c
+++ b/grub-core/loader/multiboot.c
@@ -420,13 +420,6 @@ grub_cmd_module (grub_command_t cmd __attribute__
((unused)), target = 0;
     }
 
-  err = GRUB_MULTIBOOT (add_module) (target, size, argc - 1, argv + 1);
-  if (err)
-    {
-      grub_file_close (file);
-      return err;
-    }
-
   if (size && grub_file_read (file, module, size) != size)
     {
       grub_file_close (file);
@@ -437,7 +430,8 @@ grub_cmd_module (grub_command_t cmd __attribute__
((unused)), }
 
   grub_file_close (file);
-  return GRUB_ERR_NONE;
+
+  return GRUB_MULTIBOOT (add_module) (target, size, argc - 1, argv +
1); }
 
 static grub_command_t cmd_multiboot, cmd_module;
-- 
2.45.2

---
Valentin Gehrke
Software Engineer
Kernkonzept GmbH at Dresden, Germany,
HRB 31129, CEO Dr.-Ing. Michael Hohmuth

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

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

* Re: [PATCH] loader/multiboot: do not add modules before successful download
  2024-08-23 18:20 [PATCH] loader/multiboot: do not add modules before successful download Valentin Gehrke
@ 2024-09-02 16:44 ` Daniel Kiper
  2024-09-10 13:05 ` Daniel Kiper
  1 sibling, 0 replies; 8+ messages in thread
From: Daniel Kiper @ 2024-09-02 16:44 UTC (permalink / raw)
  To: Valentin Gehrke; +Cc: grub-devel

On Fri, Aug 23, 2024 at 08:20:53PM +0200, Valentin Gehrke wrote:
> Multiboot modules that could not be read successfully (e.g. via network)
> should not be added to the list of modules to forward to the operating
> system that is to be booted subsequently.
>
> This patch is necessary because even if a grub.cfg checks whether or not
> a module was successfully downloaded, an attempt to retry a failed
> download is futile because the corrupted module will be forwarded either
> way.
>
> Signed-off-by: Valentin Gehrke <valentin.gehrke@kernkonzept.com>

Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>

Daniel

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

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

* Re: [PATCH] loader/multiboot: do not add modules before successful download
  2024-08-23 18:20 [PATCH] loader/multiboot: do not add modules before successful download Valentin Gehrke
  2024-09-02 16:44 ` Daniel Kiper
@ 2024-09-10 13:05 ` Daniel Kiper
  2024-09-10 14:10   ` Valentin Gehrke
  1 sibling, 1 reply; 8+ messages in thread
From: Daniel Kiper @ 2024-09-10 13:05 UTC (permalink / raw)
  To: valentin.gehrke; +Cc: grub-devel

On Fri, Aug 23, 2024 at 08:20:53PM +0200, Valentin Gehrke wrote:
> Multiboot modules that could not be read successfully (e.g. via network)
> should not be added to the list of modules to forward to the operating
> system that is to be booted subsequently.
>
> This patch is necessary because even if a grub.cfg checks whether or not
> a module was successfully downloaded, an attempt to retry a failed
> download is futile because the corrupted module will be forwarded either
> way.
>
> Signed-off-by: Valentin Gehrke <valentin.gehrke@kernkonzept.com>

Sorry, this patch does not apply to the upstream.

Daniel

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

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

* Re: [PATCH] loader/multiboot: do not add modules before successful download
  2024-09-10 13:05 ` Daniel Kiper
@ 2024-09-10 14:10   ` Valentin Gehrke
  2024-10-25 11:59     ` Valentin Gehrke
  0 siblings, 1 reply; 8+ messages in thread
From: Valentin Gehrke @ 2024-09-10 14:10 UTC (permalink / raw)
  To: Daniel Kiper; +Cc: grub-devel

> Sorry, this patch does not apply to the upstream.
>
> Daniel

Oops. My bad. There was some unfortunate line wrapping in the diff
in the @@ lines caused by my email client. This time it should work.
I rebased the commit onto current master, just to be sure.

From: Valentin Gehrke <valentin.gehrke@kernkonzept.com>
Date: Fri, 23 Aug 2024 16:41:23 +0200
Subject: [PATCH] loader/multiboot: do not add modules before successful
 download

Multiboot modules that could not be read successfully (e.g. via network)
should not be added to the list of modules to forward to the operating
system that is to be booted subsequently.

This patch is necessary because even if a grub.cfg checks whether or not
a module was successfully downloaded, an attempt to retry a failed
download is futile because the corrupted module will be forwarded either
way.

Signed-off-by: Valentin Gehrke <valentin.gehrke@kernkonzept.com>
---
 grub-core/loader/multiboot.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/grub-core/loader/multiboot.c b/grub-core/loader/multiboot.c
index 94be512c4..36b27a906 100644
--- a/grub-core/loader/multiboot.c
+++ b/grub-core/loader/multiboot.c
@@ -420,13 +420,6 @@ grub_cmd_module (grub_command_t cmd __attribute__ ((unused)),
       target = 0;
     }
 
-  err = GRUB_MULTIBOOT (add_module) (target, size, argc - 1, argv + 1);
-  if (err)
-    {
-      grub_file_close (file);
-      return err;
-    }
-
   if (size && grub_file_read (file, module, size) != size)
     {
       grub_file_close (file);
@@ -437,7 +430,8 @@ grub_cmd_module (grub_command_t cmd __attribute__ ((unused)),
     }
 
   grub_file_close (file);
-  return GRUB_ERR_NONE;
+
+  return GRUB_MULTIBOOT (add_module) (target, size, argc - 1, argv + 1);
 }
 
 static grub_command_t cmd_multiboot, cmd_module;
-- 
2.46.0

---
Valentin Gehrke
Software Engineer
Kernkonzept GmbH at Dresden, Germany,
HRB 31129, CEO Dr.-Ing. Michael Hohmuth

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

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

* Re: [PATCH] loader/multiboot: do not add modules before successful download
  2024-09-10 14:10   ` Valentin Gehrke
@ 2024-10-25 11:59     ` Valentin Gehrke
  2024-10-30 15:15       ` Daniel Kiper
  0 siblings, 1 reply; 8+ messages in thread
From: Valentin Gehrke @ 2024-10-25 11:59 UTC (permalink / raw)
  To: Daniel Kiper; +Cc: grub-devel

Hey Daniel,

did you have time yet to give the patch in my last email
a try? I just want to make sure the email didn't get
overlooked.

Best regards,
Valentin.

On Tue, 10 Sep 2024 16:10:47 +0200
Valentin Gehrke <valentin.gehrke@kernkonzept.com> wrote:

> > Sorry, this patch does not apply to the upstream.
> >
> > Daniel  
> 
> Oops. My bad. There was some unfortunate line wrapping in the diff
> in the @@ lines caused by my email client. This time it should work.
> I rebased the commit onto current master, just to be sure.
> 
> From: Valentin Gehrke <valentin.gehrke@kernkonzept.com>
> Date: Fri, 23 Aug 2024 16:41:23 +0200
> Subject: [PATCH] loader/multiboot: do not add modules before
> successful download
> 
> Multiboot modules that could not be read successfully (e.g. via
> network) should not be added to the list of modules to forward to the
> operating system that is to be booted subsequently.
> 
> This patch is necessary because even if a grub.cfg checks whether or
> not a module was successfully downloaded, an attempt to retry a failed
> download is futile because the corrupted module will be forwarded
> either way.
> 
> Signed-off-by: Valentin Gehrke <valentin.gehrke@kernkonzept.com>


---
 grub-core/loader/multiboot.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/grub-core/loader/multiboot.c b/grub-core/loader/multiboot.c
index 94be512c4..36b27a906 100644
--- a/grub-core/loader/multiboot.c
+++ b/grub-core/loader/multiboot.c
@@ -420,13 +420,6 @@ grub_cmd_module (grub_command_t cmd __attribute__ ((unused)),
       target = 0;
     }
 
-  err = GRUB_MULTIBOOT (add_module) (target, size, argc - 1, argv + 1);
-  if (err)
-    {
-      grub_file_close (file);
-      return err;
-    }
-
   if (size && grub_file_read (file, module, size) != size)
     {
       grub_file_close (file);
@@ -437,7 +430,8 @@ grub_cmd_module (grub_command_t cmd __attribute__ ((unused)),
     }
 
   grub_file_close (file);
-  return GRUB_ERR_NONE;
+
+  return GRUB_MULTIBOOT (add_module) (target, size, argc - 1, argv + 1);
 }
 
 static grub_command_t cmd_multiboot, cmd_module;
-- 
2.46.0

---
Valentin Gehrke
Software Engineer
Kernkonzept GmbH at Dresden, Germany,
HRB 31129, CEO Dr.-Ing. Michael Hohmuth

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

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

* Re: [PATCH] loader/multiboot: do not add modules before successful download
  2024-10-25 11:59     ` Valentin Gehrke
@ 2024-10-30 15:15       ` Daniel Kiper
  2024-10-30 17:08         ` Valentin Gehrke
  0 siblings, 1 reply; 8+ messages in thread
From: Daniel Kiper @ 2024-10-30 15:15 UTC (permalink / raw)
  To: Valentin Gehrke; +Cc: grub-devel

Hey,

On Fri, Oct 25, 2024 at 01:59:25PM +0200, Valentin Gehrke wrote:
> Hey Daniel,
>
> did you have time yet to give the patch in my last email
> a try? I just want to make sure the email didn't get
> overlooked.

Sorry, it looks it fell through the cracks.

Anyway, I think I was going to ask you to use "git send-email" to send
the patch. So, please do. You can add Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
to the patch...

Daniel

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

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

* [PATCH] loader/multiboot: do not add modules before successful download
  2024-10-30 15:15       ` Daniel Kiper
@ 2024-10-30 17:08         ` Valentin Gehrke
  0 siblings, 0 replies; 8+ messages in thread
From: Valentin Gehrke @ 2024-10-30 17:08 UTC (permalink / raw)
  To: dkiper; +Cc: grub-devel, Valentin Gehrke, Daniel Kiper

Multiboot modules that could not be read successfully (e.g. via network)
should not be added to the list of modules to forward to the operating
system that is to be booted subsequently.

This patch is necessary because even if a grub.cfg checks whether or not
a module was successfully downloaded, it is futile to retry a failed
download as the corrupted module will be forwarded either way.

Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
---
 grub-core/loader/multiboot.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/grub-core/loader/multiboot.c b/grub-core/loader/multiboot.c
index 94be512c4..36b27a906 100644
--- a/grub-core/loader/multiboot.c
+++ b/grub-core/loader/multiboot.c
@@ -420,13 +420,6 @@ grub_cmd_module (grub_command_t cmd __attribute__ ((unused)),
       target = 0;
     }
 
-  err = GRUB_MULTIBOOT (add_module) (target, size, argc - 1, argv + 1);
-  if (err)
-    {
-      grub_file_close (file);
-      return err;
-    }
-
   if (size && grub_file_read (file, module, size) != size)
     {
       grub_file_close (file);
@@ -437,7 +430,8 @@ grub_cmd_module (grub_command_t cmd __attribute__ ((unused)),
     }
 
   grub_file_close (file);
-  return GRUB_ERR_NONE;
+
+  return GRUB_MULTIBOOT (add_module) (target, size, argc - 1, argv + 1);
 }
 
 static grub_command_t cmd_multiboot, cmd_module;
-- 
2.46.1


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

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

* [PATCH] loader/multiboot: do not add modules before successful download
       [not found] <ZyJoC5WLe+vhuUzs@tomti.i.net-space.pl>
@ 2024-10-30 17:12 ` Valentin Gehrke
  0 siblings, 0 replies; 8+ messages in thread
From: Valentin Gehrke @ 2024-10-30 17:12 UTC (permalink / raw)
  To: dkiper; +Cc: grub-devel, Valentin Gehrke, Daniel Kiper

Multiboot modules that could not be read successfully (e.g. via network)
should not be added to the list of modules to forward to the operating
system that is to be booted subsequently.

This patch is necessary because even if a grub.cfg checks whether or not
a module was successfully downloaded, it is futile to retry a failed
download as the corrupted module will be forwarded either way.

Signed-off-by: Valentin Gehrke <valentin.gehrke@kernkonzept.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
---
 grub-core/loader/multiboot.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/grub-core/loader/multiboot.c b/grub-core/loader/multiboot.c
index 94be512c4..36b27a906 100644
--- a/grub-core/loader/multiboot.c
+++ b/grub-core/loader/multiboot.c
@@ -420,13 +420,6 @@ grub_cmd_module (grub_command_t cmd __attribute__ ((unused)),
       target = 0;
     }
 
-  err = GRUB_MULTIBOOT (add_module) (target, size, argc - 1, argv + 1);
-  if (err)
-    {
-      grub_file_close (file);
-      return err;
-    }
-
   if (size && grub_file_read (file, module, size) != size)
     {
       grub_file_close (file);
@@ -437,7 +430,8 @@ grub_cmd_module (grub_command_t cmd __attribute__ ((unused)),
     }
 
   grub_file_close (file);
-  return GRUB_ERR_NONE;
+
+  return GRUB_MULTIBOOT (add_module) (target, size, argc - 1, argv + 1);
 }
 
 static grub_command_t cmd_multiboot, cmd_module;
-- 
2.46.1


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

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

end of thread, other threads:[~2024-10-30 17:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-23 18:20 [PATCH] loader/multiboot: do not add modules before successful download Valentin Gehrke
2024-09-02 16:44 ` Daniel Kiper
2024-09-10 13:05 ` Daniel Kiper
2024-09-10 14:10   ` Valentin Gehrke
2024-10-25 11:59     ` Valentin Gehrke
2024-10-30 15:15       ` Daniel Kiper
2024-10-30 17:08         ` Valentin Gehrke
     [not found] <ZyJoC5WLe+vhuUzs@tomti.i.net-space.pl>
2024-10-30 17:12 ` Valentin Gehrke

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.