From: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: [PATCH] use stock embedded timestamp 2015-01-01T0000+0000
Date: Fri, 27 Mar 2015 13:27:42 +0100 [thread overview]
Message-ID: <55154CBE.5080506@gmail.com> (raw)
In-Reply-To: <1427052791-7985-1-git-send-email-dkg@fifthhorseman.net>
On 22.03.2015 20:33, Daniel Kahn Gillmor wrote:
> Variant timestamps make some grub platforms produce non-deterministic
> core images. This makes it difficult to use simple tools to audit the
> stability of a system with grub installed.
>
> This patch selects a single timestamp to use for these embedded
> timestamps so that the core images will be replicable.
> ---
> util/mkimage.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/util/mkimage.c b/util/mkimage.c
> index 7821dc5..adc1706 100644
> --- a/util/mkimage.c
> +++ b/util/mkimage.c
> @@ -55,6 +55,9 @@
>
> #define TARGET_NO_FIELD 0xffffffff
>
> +/* use 2015-01-01T00:00:00+0000 as a stock timestamp */
> +#define STABLE_EMBEDDING_TIMESTAMP 1420070400
> +
> struct grub_install_image_target_desc
> {
> const char *dirname;
> @@ -1439,7 +1442,7 @@ grub_install_generate_image (const char *dir, const char *prefix,
> c->machine = grub_host_to_target16 (image_target->pe_target);
>
> c->num_sections = grub_host_to_target16 (4);
> - c->time = grub_host_to_target32 (time (0));
> + c->time = grub_host_to_target32 (STABLE_EMBEDDING_TIMESTAMP);
> c->characteristics = grub_host_to_target16 (GRUB_PE32_EXECUTABLE_IMAGE
> | GRUB_PE32_LINE_NUMS_STRIPPED
> | ((image_target->voidp_sizeof == 4)
> @@ -1782,7 +1785,7 @@ grub_install_generate_image (const char *dir, const char *prefix,
>
> memset (hdr, 0, sizeof (*hdr));
> hdr->ih_magic = grub_cpu_to_be32_compile_time (GRUB_UBOOT_IH_MAGIC);
> - hdr->ih_time = grub_cpu_to_be32 (time (0));
> + hdr->ih_time = grub_cpu_to_be32 (STABLE_EMBEDDING_TIMESTAMP);
> hdr->ih_size = grub_cpu_to_be32 (core_size);
> hdr->ih_load = grub_cpu_to_be32 (image_target->link_addr);
> hdr->ih_ep = grub_cpu_to_be32 (image_target->link_addr);
> @@ -1856,7 +1859,7 @@ grub_install_generate_image (const char *dir, const char *prefix,
> head->magic = image_target->bigendian ? grub_host_to_target16 (0x160)
> : grub_host_to_target16 (0x166);
> head->nsec = grub_host_to_target16 (1);
> - head->time = grub_host_to_target32 (0);
> + head->time = grub_host_to_target32 (STABLE_EMBEDDING_TIMESTAMP);
I dropped this hunk as it's just changing one const to another.
> head->opt = grub_host_to_target16 (0x38);
> head->flags = image_target->bigendian
> ? grub_host_to_target16 (0x207)
>
next prev parent reply other threads:[~2015-03-27 12:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-28 11:24 Deterministic grub-mkimage Andrew Clausen
2014-12-29 6:29 ` Jonathan McCune
2014-12-29 11:08 ` Andrew Clausen
2014-12-29 19:01 ` Jonathan McCune
2015-01-22 20:08 ` Vladimir 'φ-coder/phcoder' Serbinenko
2015-03-22 19:33 ` [PATCH] use stock embedded timestamp 2015-01-01T0000+0000 Daniel Kahn Gillmor
2015-03-27 12:27 ` Vladimir 'φ-coder/phcoder' Serbinenko [this message]
2015-03-28 16:04 ` Daniel Kahn Gillmor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55154CBE.5080506@gmail.com \
--to=phcoder@gmail.com \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).