Skip to content

Commit 7c236d9

Browse files
zx2c4geertu
authored andcommitted
m68k: Process bootinfo records before saving them
The RNG seed boot record is memzeroed after processing, in order to preserve forward secrecy. By saving the bootinfo for procfs prior to that, forward secrecy is violated, since it becomes possible to recover past states. So, save the bootinfo block only after first processing them. Fixes: a1ee38a ("m68k: virt: Use RNG seed from bootinfo block") Signed-off-by: Jason A. Donenfeld <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Geert Uytterhoeven <[email protected]>
1 parent 15f9042 commit 7c236d9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

arch/m68k/kernel/setup_mm.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,9 @@ extern void paging_init(void);
109109

110110
static void __init m68k_parse_bootinfo(const struct bi_record *record)
111111
{
112+
const struct bi_record *first_record = record;
112113
uint16_t tag;
113114

114-
save_bootinfo(record);
115-
116115
while ((tag = be16_to_cpu(record->tag)) != BI_LAST) {
117116
int unknown = 0;
118117
const void *data = record->data;
@@ -182,6 +181,8 @@ static void __init m68k_parse_bootinfo(const struct bi_record *record)
182181
record = (struct bi_record *)((unsigned long)record + size);
183182
}
184183

184+
save_bootinfo(first_record);
185+
185186
m68k_realnum_memory = m68k_num_memory;
186187
#ifdef CONFIG_SINGLE_MEMORY_CHUNK
187188
if (m68k_num_memory > 1) {

0 commit comments

Comments
 (0)