[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#35283: [PATCH] mformat: initialize boot sector before writing it
From: |
Ludovic Courtès |
Subject: |
bug#35283: [PATCH] mformat: initialize boot sector before writing it |
Date: |
Sun, 21 Apr 2019 01:03:57 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) |
Hello,
While investigating reproducible ISO images for Guix¹, I found that
‘mformat’ would not initialize the boot sector before writing it. This
led to non-deterministic FAT image contents.
The attached patch fixes that.
Thanks,
Ludo’.
¹ https://issues.guix.info/issue/35283
Fix a bug whereby 'mformat' could end up passing uninitialized bytes
to write(2). This could be reproduced with:
mformat -C -f 1440 -L 16 -N 77777777 -i /tmp/x ::
where the output of /tmp/x would be non-deterministic.
Patch by Ludovic Courtès <address@hidden>.
--- mtools-4.0.23/mformat.c 2019-04-21 00:12:01.496116195 +0200
+++ mtools-4.0.23/mformat.c 2019-04-21 00:12:36.675967157 +0200
@@ -927,6 +927,7 @@ void mformat(int argc, char **argv, int
char *endptr;
+ memset(&boot.bytes, '\0', sizeof boot);
hs = hs_set = 0;
argtracks = 0;
argheads = 0;
- bug#33639: ISO installer image is broken on i686, (continued)
- bug#35283: ISO images are not reproducible, Ludovic Courtès, 2019/04/19
- bug#35283: ISO images are not reproducible, Thomas Schmitt, 2019/04/19
- bug#35283: ISO images are not reproducible, Ludovic Courtès, 2019/04/20
- bug#35283: ISO images are not reproducible, Thomas Schmitt, 2019/04/21
- bug#35283: ISO images are not reproducible, Ludovic Courtès, 2019/04/21
- bug#35283: ISO images are not reproducible, Thomas Schmitt, 2019/04/21
- bug#35283: [PATCH] mformat: initialize boot sector before writing it,
Ludovic Courtès <=
- bug#35283: [PATCH] grub-mkrescue: Allow users to specify a FAT serial number, Ludovic Courtès, 2019/04/21
- bug#33639: ISO installer image is broken on i686, Ludovic Courtès, 2019/04/14
- bug#33639: ISO installer image is broken on i686, pelzflorian (Florian Pelz), 2019/04/15
- bug#33639: ISO installer image is broken on i686, Thomas Schmitt, 2019/04/15
- bug#33639: ISO installer image is broken on i686, Gábor Boskovits, 2019/04/16
- bug#33639: ISO installer image is broken on i686, Ludovic Courtès, 2019/04/16
- bug#33639: ISO installer image is broken on i686, pelzflorian (Florian Pelz), 2019/04/17