All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 RESEND kexec-tools] m68k: pass rng seed via BI_RNG_SEED
@ 2022-11-11  1:35 ` Jason A. Donenfeld
  0 siblings, 0 replies; 10+ messages in thread
From: Jason A. Donenfeld @ 2022-11-11  1:35 UTC (permalink / raw)
  To: Geert Uytterhoeven, linux-m68k, kexec, Simon Horman; +Cc: Jason A. Donenfeld

In order to pass fresh entropy to kexec'd kernels, use BI_RNG_SEED
for passing a seed, with the same semantics that kexec-tools currently
uses for i386's setup_data.

Link: https://git.kernel.org/torvalds/c/dc63a086daee92c63e3
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
---
Seems like this was forgotten about, so resending.

 kexec/arch/m68k/bootinfo.c       | 23 +++++++++++++++++++++++
 kexec/arch/m68k/bootinfo.h       |  5 +++++
 kexec/arch/m68k/kexec-elf-m68k.c |  1 +
 3 files changed, 29 insertions(+)

diff --git a/kexec/arch/m68k/bootinfo.c b/kexec/arch/m68k/bootinfo.c
index 18bf226..086a34b 100644
--- a/kexec/arch/m68k/bootinfo.c
+++ b/kexec/arch/m68k/bootinfo.c
@@ -2,6 +2,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <sys/random.h>
 
 #include "../../kexec.h"
 
@@ -152,6 +153,11 @@ void bootinfo_print(void)
 			printf("BI_COMMAND_LINE: %s\n", bi->string);
 			break;
 
+		case BI_RNG_SEED:
+			/* These are secret, so never print them to the console */
+			printf("BI_RNG_SEED: 0x%08x bytes\n", be16_to_cpu(bi->rng_seed.len));
+			break;
+
 		default:
 			printf("BI tag 0x%04x size %u\n", tag, size);
 			break;
@@ -212,6 +218,23 @@ void bootinfo_set_ramdisk(unsigned long ramdisk_addr,
 	bi->mem_info.size = ramdisk_size;
 }
 
+void bootinfo_add_rng_seed(void)
+{
+	enum { RNG_SEED_LEN = 32 };
+	struct bi_rec *bi;
+
+	/* Remove existing rng seed records */
+	bi_remove(BI_RNG_SEED);
+
+	/* Add new rng seed record */
+	bi = bi_add(BI_RNG_SEED, sizeof(bi->rng_seed) + RNG_SEED_LEN);
+	if (getrandom(bi->rng_seed.data, RNG_SEED_LEN, GRND_NONBLOCK) != RNG_SEED_LEN) {
+		bi_remove(BI_RNG_SEED);
+		return;
+	}
+	bi->rng_seed.len = cpu_to_be16(RNG_SEED_LEN);
+}
+
 
     /*
      * Check the bootinfo version in the kernel image
diff --git a/kexec/arch/m68k/bootinfo.h b/kexec/arch/m68k/bootinfo.h
index b6f453d..90f75ad 100644
--- a/kexec/arch/m68k/bootinfo.h
+++ b/kexec/arch/m68k/bootinfo.h
@@ -20,6 +20,10 @@ struct bi_rec {
 			__be32 size;
 		} mem_info;
 		char string[0];
+		struct {
+			__be16 len;
+			u8 data[0];
+		} rng_seed;
 	};
 };
 
@@ -39,5 +43,6 @@ extern int bootinfo_get_memory_ranges(struct memory_range **range);
 extern void bootinfo_set_cmdline(const char *cmdline);
 extern void bootinfo_set_ramdisk(unsigned long ramdisk_addr,
 				 unsigned long ramdisk_size);
+extern void bootinfo_add_rng_seed(void);
 extern void bootinfo_check_bootversion(const struct kexec_info *info);
 extern void add_bootinfo(struct kexec_info *info, unsigned long addr);
diff --git a/kexec/arch/m68k/kexec-elf-m68k.c b/kexec/arch/m68k/kexec-elf-m68k.c
index 8d00eb9..a2bf7ee 100644
--- a/kexec/arch/m68k/kexec-elf-m68k.c
+++ b/kexec/arch/m68k/kexec-elf-m68k.c
@@ -162,6 +162,7 @@ int elf_m68k_load(int argc, char **argv, const char *buf, off_t len,
 	/* Update and add bootinfo */
 	bootinfo_set_cmdline(cmdline);
 	bootinfo_set_ramdisk(ramdisk_addr, ramdisk_size);
+	bootinfo_add_rng_seed();
 	if (kexec_debug)
 		bootinfo_print();
 	add_bootinfo(info, bootinfo_addr);
-- 
2.38.1


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

* [PATCH v2 RESEND kexec-tools] m68k: pass rng seed via BI_RNG_SEED
@ 2022-11-11  1:35 ` Jason A. Donenfeld
  0 siblings, 0 replies; 10+ messages in thread
From: Jason A. Donenfeld @ 2022-11-11  1:35 UTC (permalink / raw)
  To: Geert Uytterhoeven, linux-m68k, kexec, Simon Horman; +Cc: Jason A. Donenfeld

In order to pass fresh entropy to kexec'd kernels, use BI_RNG_SEED
for passing a seed, with the same semantics that kexec-tools currently
uses for i386's setup_data.

Link: https://git.kernel.org/torvalds/c/dc63a086daee92c63e3
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
---
Seems like this was forgotten about, so resending.

 kexec/arch/m68k/bootinfo.c       | 23 +++++++++++++++++++++++
 kexec/arch/m68k/bootinfo.h       |  5 +++++
 kexec/arch/m68k/kexec-elf-m68k.c |  1 +
 3 files changed, 29 insertions(+)

diff --git a/kexec/arch/m68k/bootinfo.c b/kexec/arch/m68k/bootinfo.c
index 18bf226..086a34b 100644
--- a/kexec/arch/m68k/bootinfo.c
+++ b/kexec/arch/m68k/bootinfo.c
@@ -2,6 +2,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <sys/random.h>
 
 #include "../../kexec.h"
 
@@ -152,6 +153,11 @@ void bootinfo_print(void)
 			printf("BI_COMMAND_LINE: %s\n", bi->string);
 			break;
 
+		case BI_RNG_SEED:
+			/* These are secret, so never print them to the console */
+			printf("BI_RNG_SEED: 0x%08x bytes\n", be16_to_cpu(bi->rng_seed.len));
+			break;
+
 		default:
 			printf("BI tag 0x%04x size %u\n", tag, size);
 			break;
@@ -212,6 +218,23 @@ void bootinfo_set_ramdisk(unsigned long ramdisk_addr,
 	bi->mem_info.size = ramdisk_size;
 }
 
+void bootinfo_add_rng_seed(void)
+{
+	enum { RNG_SEED_LEN = 32 };
+	struct bi_rec *bi;
+
+	/* Remove existing rng seed records */
+	bi_remove(BI_RNG_SEED);
+
+	/* Add new rng seed record */
+	bi = bi_add(BI_RNG_SEED, sizeof(bi->rng_seed) + RNG_SEED_LEN);
+	if (getrandom(bi->rng_seed.data, RNG_SEED_LEN, GRND_NONBLOCK) != RNG_SEED_LEN) {
+		bi_remove(BI_RNG_SEED);
+		return;
+	}
+	bi->rng_seed.len = cpu_to_be16(RNG_SEED_LEN);
+}
+
 
     /*
      * Check the bootinfo version in the kernel image
diff --git a/kexec/arch/m68k/bootinfo.h b/kexec/arch/m68k/bootinfo.h
index b6f453d..90f75ad 100644
--- a/kexec/arch/m68k/bootinfo.h
+++ b/kexec/arch/m68k/bootinfo.h
@@ -20,6 +20,10 @@ struct bi_rec {
 			__be32 size;
 		} mem_info;
 		char string[0];
+		struct {
+			__be16 len;
+			u8 data[0];
+		} rng_seed;
 	};
 };
 
@@ -39,5 +43,6 @@ extern int bootinfo_get_memory_ranges(struct memory_range **range);
 extern void bootinfo_set_cmdline(const char *cmdline);
 extern void bootinfo_set_ramdisk(unsigned long ramdisk_addr,
 				 unsigned long ramdisk_size);
+extern void bootinfo_add_rng_seed(void);
 extern void bootinfo_check_bootversion(const struct kexec_info *info);
 extern void add_bootinfo(struct kexec_info *info, unsigned long addr);
diff --git a/kexec/arch/m68k/kexec-elf-m68k.c b/kexec/arch/m68k/kexec-elf-m68k.c
index 8d00eb9..a2bf7ee 100644
--- a/kexec/arch/m68k/kexec-elf-m68k.c
+++ b/kexec/arch/m68k/kexec-elf-m68k.c
@@ -162,6 +162,7 @@ int elf_m68k_load(int argc, char **argv, const char *buf, off_t len,
 	/* Update and add bootinfo */
 	bootinfo_set_cmdline(cmdline);
 	bootinfo_set_ramdisk(ramdisk_addr, ramdisk_size);
+	bootinfo_add_rng_seed();
 	if (kexec_debug)
 		bootinfo_print();
 	add_bootinfo(info, bootinfo_addr);
-- 
2.38.1


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

* Re: [PATCH v2 RESEND kexec-tools] m68k: pass rng seed via BI_RNG_SEED
  2022-11-11  1:35 ` Jason A. Donenfeld
@ 2022-11-14 15:31   ` Simon Horman
  -1 siblings, 0 replies; 10+ messages in thread
From: Simon Horman @ 2022-11-14 15:31 UTC (permalink / raw)
  To: Jason A. Donenfeld; +Cc: Geert Uytterhoeven, linux-m68k, kexec

On Fri, Nov 11, 2022 at 02:35:33AM +0100, Jason A. Donenfeld wrote:
> In order to pass fresh entropy to kexec'd kernels, use BI_RNG_SEED
> for passing a seed, with the same semantics that kexec-tools currently
> uses for i386's setup_data.
> 
> Link: https://git.kernel.org/torvalds/c/dc63a086daee92c63e3
> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
> ---
> Seems like this was forgotten about, so resending.

Hi Jason,

Sorry about missing this earlier.

I was planning to apply it just now, but it seems that
the github workflow flagged a problem:

In file included from ../../kexec/arch/m68k/kexec-m68k.c:19:
../../kexec/arch/m68k/bootinfo.h:25:4: error: unknown type name ‘u8’
   25 |    u8 data[0];
      |    ^~
make[1]: *** [Makefile:124: kexec/arch/m68k/kexec-m68k.o] Error 1
make[1]: *** Waiting for unfinished jobs....
In file included from ../../kexec/arch/m68k/kexec-elf-m68k.c:27:
../../kexec/arch/m68k/bootinfo.h:25:4: error: unknown type name ‘u8’
   25 |    u8 data[0];
      |    ^~
make[1]: *** [Makefile:124: kexec/arch/m68k/kexec-elf-m68k.o] Error 1
make: *** [Makefile:276: distcheck] Error 2
make[1]: Leaving directory '/home/runner/work/kexec-tools/kexec-tools/kexec-tools-2.0.25.git/_build/sub'
Error: Process completed with exit code 2.

Ref: https://github.com/horms/kexec-tools/actions/runs/3462830642/jobs/5782238446

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

* Re: [PATCH v2 RESEND kexec-tools] m68k: pass rng seed via BI_RNG_SEED
@ 2022-11-14 15:31   ` Simon Horman
  0 siblings, 0 replies; 10+ messages in thread
From: Simon Horman @ 2022-11-14 15:31 UTC (permalink / raw)
  To: Jason A. Donenfeld; +Cc: Geert Uytterhoeven, linux-m68k, kexec

On Fri, Nov 11, 2022 at 02:35:33AM +0100, Jason A. Donenfeld wrote:
> In order to pass fresh entropy to kexec'd kernels, use BI_RNG_SEED
> for passing a seed, with the same semantics that kexec-tools currently
> uses for i386's setup_data.
> 
> Link: https://git.kernel.org/torvalds/c/dc63a086daee92c63e3
> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
> ---
> Seems like this was forgotten about, so resending.

Hi Jason,

Sorry about missing this earlier.

I was planning to apply it just now, but it seems that
the github workflow flagged a problem:

In file included from ../../kexec/arch/m68k/kexec-m68k.c:19:
../../kexec/arch/m68k/bootinfo.h:25:4: error: unknown type name ‘u8’
   25 |    u8 data[0];
      |    ^~
make[1]: *** [Makefile:124: kexec/arch/m68k/kexec-m68k.o] Error 1
make[1]: *** Waiting for unfinished jobs....
In file included from ../../kexec/arch/m68k/kexec-elf-m68k.c:27:
../../kexec/arch/m68k/bootinfo.h:25:4: error: unknown type name ‘u8’
   25 |    u8 data[0];
      |    ^~
make[1]: *** [Makefile:124: kexec/arch/m68k/kexec-elf-m68k.o] Error 1
make: *** [Makefile:276: distcheck] Error 2
make[1]: Leaving directory '/home/runner/work/kexec-tools/kexec-tools/kexec-tools-2.0.25.git/_build/sub'
Error: Process completed with exit code 2.

Ref: https://github.com/horms/kexec-tools/actions/runs/3462830642/jobs/5782238446

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

* Re: [PATCH v2 RESEND kexec-tools] m68k: pass rng seed via BI_RNG_SEED
  2022-11-14 15:31   ` Simon Horman
@ 2022-11-14 15:39     ` Jason A. Donenfeld
  -1 siblings, 0 replies; 10+ messages in thread
From: Jason A. Donenfeld @ 2022-11-14 15:39 UTC (permalink / raw)
  To: horms; +Cc: Geert Uytterhoeven, linux-m68k, kexec

Hi Simon,

Sorry about that. Not sure why my toolchain missed it. v3 coming up.

Jason

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

* Re: [PATCH v2 RESEND kexec-tools] m68k: pass rng seed via BI_RNG_SEED
@ 2022-11-14 15:39     ` Jason A. Donenfeld
  0 siblings, 0 replies; 10+ messages in thread
From: Jason A. Donenfeld @ 2022-11-14 15:39 UTC (permalink / raw)
  To: horms; +Cc: Geert Uytterhoeven, linux-m68k, kexec

Hi Simon,

Sorry about that. Not sure why my toolchain missed it. v3 coming up.

Jason

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

* [PATCH kexec-tools v3] m68k: pass rng seed via BI_RNG_SEED
  2022-11-14 15:39     ` Jason A. Donenfeld
@ 2022-11-14 15:43       ` Jason A. Donenfeld
  -1 siblings, 0 replies; 10+ messages in thread
From: Jason A. Donenfeld @ 2022-11-14 15:43 UTC (permalink / raw)
  To: horms, Geert Uytterhoeven, linux-m68k, kexec; +Cc: Jason A. Donenfeld

In order to pass fresh entropy to kexec'd kernels, use BI_RNG_SEED
for passing a seed, with the same semantics that kexec-tools currently
uses for i386's setup_data.

Link: https://git.kernel.org/torvalds/c/dc63a086daee92c63e3
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
---
 kexec/arch/m68k/bootinfo.c       | 23 +++++++++++++++++++++++
 kexec/arch/m68k/bootinfo.h       | 10 ++++++++++
 kexec/arch/m68k/kexec-elf-m68k.c |  1 +
 3 files changed, 34 insertions(+)

diff --git a/kexec/arch/m68k/bootinfo.c b/kexec/arch/m68k/bootinfo.c
index 18bf226..086a34b 100644
--- a/kexec/arch/m68k/bootinfo.c
+++ b/kexec/arch/m68k/bootinfo.c
@@ -2,6 +2,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <sys/random.h>
 
 #include "../../kexec.h"
 
@@ -152,6 +153,11 @@ void bootinfo_print(void)
 			printf("BI_COMMAND_LINE: %s\n", bi->string);
 			break;
 
+		case BI_RNG_SEED:
+			/* These are secret, so never print them to the console */
+			printf("BI_RNG_SEED: 0x%08x bytes\n", be16_to_cpu(bi->rng_seed.len));
+			break;
+
 		default:
 			printf("BI tag 0x%04x size %u\n", tag, size);
 			break;
@@ -212,6 +218,23 @@ void bootinfo_set_ramdisk(unsigned long ramdisk_addr,
 	bi->mem_info.size = ramdisk_size;
 }
 
+void bootinfo_add_rng_seed(void)
+{
+	enum { RNG_SEED_LEN = 32 };
+	struct bi_rec *bi;
+
+	/* Remove existing rng seed records */
+	bi_remove(BI_RNG_SEED);
+
+	/* Add new rng seed record */
+	bi = bi_add(BI_RNG_SEED, sizeof(bi->rng_seed) + RNG_SEED_LEN);
+	if (getrandom(bi->rng_seed.data, RNG_SEED_LEN, GRND_NONBLOCK) != RNG_SEED_LEN) {
+		bi_remove(BI_RNG_SEED);
+		return;
+	}
+	bi->rng_seed.len = cpu_to_be16(RNG_SEED_LEN);
+}
+
 
     /*
      * Check the bootinfo version in the kernel image
diff --git a/kexec/arch/m68k/bootinfo.h b/kexec/arch/m68k/bootinfo.h
index b6f453d..bb8a03a 100644
--- a/kexec/arch/m68k/bootinfo.h
+++ b/kexec/arch/m68k/bootinfo.h
@@ -3,6 +3,11 @@
 #define DEFAULT_BOOTINFO_FILE	"/proc/bootinfo"
 #define MAX_BOOTINFO_SIZE	1536
 
+/* New in 6.2's <asm/bootinfo.h>. Remove once 6.2 is baseline version. */
+#ifndef BI_RNG_SEED
+#define BI_RNG_SEED             0x0008
+#endif
+
 
     /*
      *  Convenience overlay of several struct bi_record variants
@@ -20,6 +25,10 @@ struct bi_rec {
 			__be32 size;
 		} mem_info;
 		char string[0];
+		struct {
+			__be16 len;
+			__u8 data[0];
+		} rng_seed;
 	};
 };
 
@@ -39,5 +48,6 @@ extern int bootinfo_get_memory_ranges(struct memory_range **range);
 extern void bootinfo_set_cmdline(const char *cmdline);
 extern void bootinfo_set_ramdisk(unsigned long ramdisk_addr,
 				 unsigned long ramdisk_size);
+extern void bootinfo_add_rng_seed(void);
 extern void bootinfo_check_bootversion(const struct kexec_info *info);
 extern void add_bootinfo(struct kexec_info *info, unsigned long addr);
diff --git a/kexec/arch/m68k/kexec-elf-m68k.c b/kexec/arch/m68k/kexec-elf-m68k.c
index 8d00eb9..a2bf7ee 100644
--- a/kexec/arch/m68k/kexec-elf-m68k.c
+++ b/kexec/arch/m68k/kexec-elf-m68k.c
@@ -162,6 +162,7 @@ int elf_m68k_load(int argc, char **argv, const char *buf, off_t len,
 	/* Update and add bootinfo */
 	bootinfo_set_cmdline(cmdline);
 	bootinfo_set_ramdisk(ramdisk_addr, ramdisk_size);
+	bootinfo_add_rng_seed();
 	if (kexec_debug)
 		bootinfo_print();
 	add_bootinfo(info, bootinfo_addr);
-- 
2.38.1


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

* [PATCH kexec-tools v3] m68k: pass rng seed via BI_RNG_SEED
@ 2022-11-14 15:43       ` Jason A. Donenfeld
  0 siblings, 0 replies; 10+ messages in thread
From: Jason A. Donenfeld @ 2022-11-14 15:43 UTC (permalink / raw)
  To: horms, Geert Uytterhoeven, linux-m68k, kexec; +Cc: Jason A. Donenfeld

In order to pass fresh entropy to kexec'd kernels, use BI_RNG_SEED
for passing a seed, with the same semantics that kexec-tools currently
uses for i386's setup_data.

Link: https://git.kernel.org/torvalds/c/dc63a086daee92c63e3
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
---
 kexec/arch/m68k/bootinfo.c       | 23 +++++++++++++++++++++++
 kexec/arch/m68k/bootinfo.h       | 10 ++++++++++
 kexec/arch/m68k/kexec-elf-m68k.c |  1 +
 3 files changed, 34 insertions(+)

diff --git a/kexec/arch/m68k/bootinfo.c b/kexec/arch/m68k/bootinfo.c
index 18bf226..086a34b 100644
--- a/kexec/arch/m68k/bootinfo.c
+++ b/kexec/arch/m68k/bootinfo.c
@@ -2,6 +2,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <sys/random.h>
 
 #include "../../kexec.h"
 
@@ -152,6 +153,11 @@ void bootinfo_print(void)
 			printf("BI_COMMAND_LINE: %s\n", bi->string);
 			break;
 
+		case BI_RNG_SEED:
+			/* These are secret, so never print them to the console */
+			printf("BI_RNG_SEED: 0x%08x bytes\n", be16_to_cpu(bi->rng_seed.len));
+			break;
+
 		default:
 			printf("BI tag 0x%04x size %u\n", tag, size);
 			break;
@@ -212,6 +218,23 @@ void bootinfo_set_ramdisk(unsigned long ramdisk_addr,
 	bi->mem_info.size = ramdisk_size;
 }
 
+void bootinfo_add_rng_seed(void)
+{
+	enum { RNG_SEED_LEN = 32 };
+	struct bi_rec *bi;
+
+	/* Remove existing rng seed records */
+	bi_remove(BI_RNG_SEED);
+
+	/* Add new rng seed record */
+	bi = bi_add(BI_RNG_SEED, sizeof(bi->rng_seed) + RNG_SEED_LEN);
+	if (getrandom(bi->rng_seed.data, RNG_SEED_LEN, GRND_NONBLOCK) != RNG_SEED_LEN) {
+		bi_remove(BI_RNG_SEED);
+		return;
+	}
+	bi->rng_seed.len = cpu_to_be16(RNG_SEED_LEN);
+}
+
 
     /*
      * Check the bootinfo version in the kernel image
diff --git a/kexec/arch/m68k/bootinfo.h b/kexec/arch/m68k/bootinfo.h
index b6f453d..bb8a03a 100644
--- a/kexec/arch/m68k/bootinfo.h
+++ b/kexec/arch/m68k/bootinfo.h
@@ -3,6 +3,11 @@
 #define DEFAULT_BOOTINFO_FILE	"/proc/bootinfo"
 #define MAX_BOOTINFO_SIZE	1536
 
+/* New in 6.2's <asm/bootinfo.h>. Remove once 6.2 is baseline version. */
+#ifndef BI_RNG_SEED
+#define BI_RNG_SEED             0x0008
+#endif
+
 
     /*
      *  Convenience overlay of several struct bi_record variants
@@ -20,6 +25,10 @@ struct bi_rec {
 			__be32 size;
 		} mem_info;
 		char string[0];
+		struct {
+			__be16 len;
+			__u8 data[0];
+		} rng_seed;
 	};
 };
 
@@ -39,5 +48,6 @@ extern int bootinfo_get_memory_ranges(struct memory_range **range);
 extern void bootinfo_set_cmdline(const char *cmdline);
 extern void bootinfo_set_ramdisk(unsigned long ramdisk_addr,
 				 unsigned long ramdisk_size);
+extern void bootinfo_add_rng_seed(void);
 extern void bootinfo_check_bootversion(const struct kexec_info *info);
 extern void add_bootinfo(struct kexec_info *info, unsigned long addr);
diff --git a/kexec/arch/m68k/kexec-elf-m68k.c b/kexec/arch/m68k/kexec-elf-m68k.c
index 8d00eb9..a2bf7ee 100644
--- a/kexec/arch/m68k/kexec-elf-m68k.c
+++ b/kexec/arch/m68k/kexec-elf-m68k.c
@@ -162,6 +162,7 @@ int elf_m68k_load(int argc, char **argv, const char *buf, off_t len,
 	/* Update and add bootinfo */
 	bootinfo_set_cmdline(cmdline);
 	bootinfo_set_ramdisk(ramdisk_addr, ramdisk_size);
+	bootinfo_add_rng_seed();
 	if (kexec_debug)
 		bootinfo_print();
 	add_bootinfo(info, bootinfo_addr);
-- 
2.38.1


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

* Re: [PATCH kexec-tools v3] m68k: pass rng seed via BI_RNG_SEED
  2022-11-14 15:43       ` Jason A. Donenfeld
@ 2022-11-18 15:15         ` Simon Horman
  -1 siblings, 0 replies; 10+ messages in thread
From: Simon Horman @ 2022-11-18 15:15 UTC (permalink / raw)
  To: Jason A. Donenfeld; +Cc: horms, Geert Uytterhoeven, linux-m68k, kexec

On Mon, Nov 14, 2022 at 04:43:03PM +0100, Jason A. Donenfeld wrote:
> In order to pass fresh entropy to kexec'd kernels, use BI_RNG_SEED
> for passing a seed, with the same semantics that kexec-tools currently
> uses for i386's setup_data.
> 
> Link: https://git.kernel.org/torvalds/c/dc63a086daee92c63e3
> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>

Thanks Jason,

applied.

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

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

* Re: [PATCH kexec-tools v3] m68k: pass rng seed via BI_RNG_SEED
@ 2022-11-18 15:15         ` Simon Horman
  0 siblings, 0 replies; 10+ messages in thread
From: Simon Horman @ 2022-11-18 15:15 UTC (permalink / raw)
  To: Jason A. Donenfeld; +Cc: horms, Geert Uytterhoeven, linux-m68k, kexec

On Mon, Nov 14, 2022 at 04:43:03PM +0100, Jason A. Donenfeld wrote:
> In order to pass fresh entropy to kexec'd kernels, use BI_RNG_SEED
> for passing a seed, with the same semantics that kexec-tools currently
> uses for i386's setup_data.
> 
> Link: https://git.kernel.org/torvalds/c/dc63a086daee92c63e3
> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>

Thanks Jason,

applied.

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

end of thread, other threads:[~2022-11-18 15:24 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-11  1:35 [PATCH v2 RESEND kexec-tools] m68k: pass rng seed via BI_RNG_SEED Jason A. Donenfeld
2022-11-11  1:35 ` Jason A. Donenfeld
2022-11-14 15:31 ` Simon Horman
2022-11-14 15:31   ` Simon Horman
2022-11-14 15:39   ` Jason A. Donenfeld
2022-11-14 15:39     ` Jason A. Donenfeld
2022-11-14 15:43     ` [PATCH kexec-tools v3] " Jason A. Donenfeld
2022-11-14 15:43       ` Jason A. Donenfeld
2022-11-18 15:15       ` Simon Horman
2022-11-18 15:15         ` Simon Horman

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.