All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/efi: Do not insert timestamps in efi files
@ 2018-10-24  8:03 Bernhard M. Wiedemann
  2018-10-24  8:16 ` Andrew Cooper
  0 siblings, 1 reply; 10+ messages in thread
From: Bernhard M. Wiedemann @ 2018-10-24  8:03 UTC (permalink / raw)
  To: xen-devel; +Cc: Bernhard M. Wiedemann

in order to make builds reproducible.
See https://reproducible-builds.org/ for why this is good.

Signed-off-by: Bernhard M. Wiedemann <bwiedemann@suse.de>
---
 xen/arch/x86/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index 162b0b94c0..052bdb1e25 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -158,6 +158,7 @@ note.o: $(TARGET)-syms
 
 EFI_LDFLAGS = $(patsubst -m%,-mi386pep,$(LDFLAGS)) --subsystem=10
 EFI_LDFLAGS += --image-base=$(1) --stack=0,0 --heap=0,0 --strip-debug
+EFI_LDFLAGS += --no-insert-timestamp
 EFI_LDFLAGS += --section-alignment=0x200000 --file-alignment=0x20
 EFI_LDFLAGS += --major-image-version=$(XEN_VERSION)
 EFI_LDFLAGS += --minor-image-version=$(XEN_SUBVERSION)
-- 
2.16.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [PATCH] x86/efi: Do not insert timestamps in efi files
  2018-10-24  8:03 [PATCH] x86/efi: Do not insert timestamps in efi files Bernhard M. Wiedemann
@ 2018-10-24  8:16 ` Andrew Cooper
  2018-10-24 12:49   ` Bernhard M. Wiedemann
  0 siblings, 1 reply; 10+ messages in thread
From: Andrew Cooper @ 2018-10-24  8:16 UTC (permalink / raw)
  To: Bernhard M. Wiedemann, xen-devel; +Cc: Wei Liu, Jan Beulich

On 24/10/2018 09:03, Bernhard M. Wiedemann wrote:
> in order to make builds reproducible.
> See https://reproducible-builds.org/ for why this is good.
>
> Signed-off-by: Bernhard M. Wiedemann <bwiedemann@suse.de>

Please follow the MAINTAINERS file and CC the correct people.  I've done
so on this email.

> ---
>  xen/arch/x86/Makefile | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
> index 162b0b94c0..052bdb1e25 100644
> --- a/xen/arch/x86/Makefile
> +++ b/xen/arch/x86/Makefile
> @@ -158,6 +158,7 @@ note.o: $(TARGET)-syms
>  
>  EFI_LDFLAGS = $(patsubst -m%,-mi386pep,$(LDFLAGS)) --subsystem=10
>  EFI_LDFLAGS += --image-base=$(1) --stack=0,0 --heap=0,0 --strip-debug
> +EFI_LDFLAGS += --no-insert-timestamp
>  EFI_LDFLAGS += --section-alignment=0x200000 --file-alignment=0x20
>  EFI_LDFLAGS += --major-image-version=$(XEN_VERSION)
>  EFI_LDFLAGS += --minor-image-version=$(XEN_SUBVERSION)

This change is fine in principle, but do all i386pep compatible versions
of LD support this parameter?

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [PATCH] x86/efi: Do not insert timestamps in efi files
  2018-10-24  8:16 ` Andrew Cooper
@ 2018-10-24 12:49   ` Bernhard M. Wiedemann
  2018-10-24 13:04     ` Wei Liu
  2018-10-24 13:45     ` Bernhard M. Wiedemann
  0 siblings, 2 replies; 10+ messages in thread
From: Bernhard M. Wiedemann @ 2018-10-24 12:49 UTC (permalink / raw)
  To: Andrew Cooper, xen-devel; +Cc: Wei Liu, Jan Beulich

On 24/10/2018 10.16, Andrew Cooper wrote:
> This change is fine in principle, but do all i386pep compatible versions
> of LD support this parameter?

It seems, it was added in 2014 to GNU binutils when the default was
reversed to be unreproducible:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=eeb14e5a5b378450ca2ed139e76f317f491f4613

Don't know about other ld implementations.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [PATCH] x86/efi: Do not insert timestamps in efi files
  2018-10-24 12:49   ` Bernhard M. Wiedemann
@ 2018-10-24 13:04     ` Wei Liu
  2018-10-24 13:45     ` Bernhard M. Wiedemann
  1 sibling, 0 replies; 10+ messages in thread
From: Wei Liu @ 2018-10-24 13:04 UTC (permalink / raw)
  To: Bernhard M. Wiedemann; +Cc: Andrew Cooper, Wei Liu, Jan Beulich, xen-devel

On Wed, Oct 24, 2018 at 02:49:49PM +0200, Bernhard M. Wiedemann wrote:
> On 24/10/2018 10.16, Andrew Cooper wrote:
> > This change is fine in principle, but do all i386pep compatible versions
> > of LD support this parameter?
> 
> It seems, it was added in 2014 to GNU binutils when the default was
> reversed to be unreproducible:
> https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=eeb14e5a5b378450ca2ed139e76f317f491f4613

I think adding this unconditionally will break older ld? Keep in mind
that our supported binutils dates back to 2005.

Either some sort of filtering is required or we bump the required
binutils version.  For the former route see ld-ver-build-id in
Config.mk.

Wei.

> 
> Don't know about other ld implementations.


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* [PATCH] x86/efi: Do not insert timestamps in efi files
  2018-10-24 12:49   ` Bernhard M. Wiedemann
  2018-10-24 13:04     ` Wei Liu
@ 2018-10-24 13:45     ` Bernhard M. Wiedemann
  2018-10-25  8:02       ` Wei Liu
       [not found]       ` <108D0A7C020000E4CA4B4E14@prv1-mh.provo.novell.com>
  1 sibling, 2 replies; 10+ messages in thread
From: Bernhard M. Wiedemann @ 2018-10-24 13:45 UTC (permalink / raw)
  To: xen-devel; +Cc: Andrew Cooper, Wei Liu, Jan Beulich, Bernhard M. Wiedemann

in order to make builds reproducible.
See https://reproducible-builds.org/ for why this is good.

We only add the option, if ld understands it.

Signed-off-by: Bernhard M. Wiedemann <bwiedemann@suse.de>
---
 Config.mk             | 8 ++++++++
 xen/arch/x86/Makefile | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/Config.mk b/Config.mk
index 9b13e75a3e..46b064bcae 100644
--- a/Config.mk
+++ b/Config.mk
@@ -151,6 +151,14 @@ export XEN_HAS_BUILD_ID=y
 build_id_linker := --build-id=sha1
 endif
 
+ld-ver-timestamp = $(shell $(1) -mi386pep --no-insert-timestamp 2>&1 | \
+				grep -q no-insert-timestamp && echo n || echo y)
+ifeq ($(call ld-ver-timestamp,$(LD)),n)
+ld_no_insert_timestamp :=
+else
+ld_no_insert_timestamp := --no-insert-timestamp
+endif
+
 ifndef XEN_HAS_CHECKPOLICY
     CHECKPOLICY ?= checkpolicy
     XEN_HAS_CHECKPOLICY := $(shell $(CHECKPOLICY) -h 2>&1 | grep -q xen && echo y || echo n)
diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index 162b0b94c0..61ca474179 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -157,7 +157,7 @@ note.o: $(TARGET)-syms
 	rm -f $@.bin
 
 EFI_LDFLAGS = $(patsubst -m%,-mi386pep,$(LDFLAGS)) --subsystem=10
-EFI_LDFLAGS += --image-base=$(1) --stack=0,0 --heap=0,0 --strip-debug
+EFI_LDFLAGS += --image-base=$(1) --stack=0,0 --heap=0,0 --strip-debug $(ld_no_insert_timestamp)
 EFI_LDFLAGS += --section-alignment=0x200000 --file-alignment=0x20
 EFI_LDFLAGS += --major-image-version=$(XEN_VERSION)
 EFI_LDFLAGS += --minor-image-version=$(XEN_SUBVERSION)
-- 
2.16.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [PATCH] x86/efi: Do not insert timestamps in efi files
  2018-10-24 13:45     ` Bernhard M. Wiedemann
@ 2018-10-25  8:02       ` Wei Liu
       [not found]       ` <108D0A7C020000E4CA4B4E14@prv1-mh.provo.novell.com>
  1 sibling, 0 replies; 10+ messages in thread
From: Wei Liu @ 2018-10-25  8:02 UTC (permalink / raw)
  To: Bernhard M. Wiedemann; +Cc: Andrew Cooper, Wei Liu, Jan Beulich, xen-devel

On Wed, Oct 24, 2018 at 03:45:22PM +0200, Bernhard M. Wiedemann wrote:
> in order to make builds reproducible.
> See https://reproducible-builds.org/ for why this is good.
> 
> We only add the option, if ld understands it.
> 
> Signed-off-by: Bernhard M. Wiedemann <bwiedemann@suse.de>

Reviewed-by: Wei Liu <wei.liu2@citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [PATCH] x86/efi: Do not insert timestamps in efi files
       [not found]         ` <74F2501302000079CA4B4E14@prv1-mh.provo.novell.com>
@ 2018-10-25 12:35           ` Jan Beulich
  2018-10-25 14:00             ` Andrew Cooper
  0 siblings, 1 reply; 10+ messages in thread
From: Jan Beulich @ 2018-10-25 12:35 UTC (permalink / raw)
  To: Bernhard M.Wiedemann; +Cc: Andrew Cooper, Wei Liu, xen-devel

>>> On 24.10.18 at 15:45, <bwiedemann@suse.de> wrote:
> in order to make builds reproducible.
> See https://reproducible-builds.org/ for why this is good.

But is this something everyone wants, unconditionally? I'm
generally happy to have this basic indication of when a certain
image was built; I regret that ELF images have no such
indication.

> --- a/Config.mk
> +++ b/Config.mk
> @@ -151,6 +151,14 @@ export XEN_HAS_BUILD_ID=y
>  build_id_linker := --build-id=sha1
>  endif
>  
> +ld-ver-timestamp = $(shell $(1) -mi386pep --no-insert-timestamp 2>&1 | \
> +				grep -q no-insert-timestamp && echo n || echo y)
> +ifeq ($(call ld-ver-timestamp,$(LD)),n)
> +ld_no_insert_timestamp :=
> +else
> +ld_no_insert_timestamp := --no-insert-timestamp
> +endif

Irrespective of build_id_linker also living here - is this the
right place? And can't you simplify things by using the
common list model, i.e. populate ld_no_insert_timestamp-$(...)
and ...

> --- a/xen/arch/x86/Makefile
> +++ b/xen/arch/x86/Makefile
> @@ -157,7 +157,7 @@ note.o: $(TARGET)-syms
>  	rm -f $@.bin
>  
>  EFI_LDFLAGS = $(patsubst -m%,-mi386pep,$(LDFLAGS)) --subsystem=10
> -EFI_LDFLAGS += --image-base=$(1) --stack=0,0 --heap=0,0 --strip-debug
> +EFI_LDFLAGS += --image-base=$(1) --stack=0,0 --heap=0,0 --strip-debug $(ld_no_insert_timestamp)

... use $(ld_no_insert_timestamp-y) here?

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [PATCH] x86/efi: Do not insert timestamps in efi files
  2018-10-25 12:35           ` Jan Beulich
@ 2018-10-25 14:00             ` Andrew Cooper
  2018-10-25 14:08               ` Jan Beulich
  0 siblings, 1 reply; 10+ messages in thread
From: Andrew Cooper @ 2018-10-25 14:00 UTC (permalink / raw)
  To: Jan Beulich, Bernhard M.Wiedemann; +Cc: Wei Liu, xen-devel

On 25/10/18 13:35, Jan Beulich wrote:
>>>> On 24.10.18 at 15:45, <bwiedemann@suse.de> wrote:
>> in order to make builds reproducible.
>> See https://reproducible-builds.org/ for why this is good.
> But is this something everyone wants, unconditionally? I'm
> generally happy to have this basic indication of when a certain
> image was built; I regret that ELF images have no such
> indication.

What practical purpose does having a time stamp serve?  If you really
need to see, what is wrong with the mtime in your build tree?

For shipped binaries to customers, exactly when it was built is
irrelevant, whereas peoples ability to independently verify the
integrity of the binary is important.

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [PATCH] x86/efi: Do not insert timestamps in efi files
  2018-10-25 14:00             ` Andrew Cooper
@ 2018-10-25 14:08               ` Jan Beulich
  2018-10-26 11:11                 ` Bernhard M. Wiedemann
  0 siblings, 1 reply; 10+ messages in thread
From: Jan Beulich @ 2018-10-25 14:08 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: Bernhard M.Wiedemann, Wei Liu, xen-devel

>>> On 25.10.18 at 16:00, <andrew.cooper3@citrix.com> wrote:
> On 25/10/18 13:35, Jan Beulich wrote:
>>>>> On 24.10.18 at 15:45, <bwiedemann@suse.de> wrote:
>>> in order to make builds reproducible.
>>> See https://reproducible-builds.org/ for why this is good.
>> But is this something everyone wants, unconditionally? I'm
>> generally happy to have this basic indication of when a certain
>> image was built; I regret that ELF images have no such
>> indication.
> 
> What practical purpose does having a time stamp serve?  If you really
> need to see, what is wrong with the mtime in your build tree?

This can be changed by simple "cp" to another location.

> For shipped binaries to customers, exactly when it was built is
> irrelevant, whereas peoples ability to independently verify the
> integrity of the binary is important.

Correct, which is why I appreciate the _option_ of zapping the
timestamp.

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [PATCH] x86/efi: Do not insert timestamps in efi files
  2018-10-25 14:08               ` Jan Beulich
@ 2018-10-26 11:11                 ` Bernhard M. Wiedemann
  0 siblings, 0 replies; 10+ messages in thread
From: Bernhard M. Wiedemann @ 2018-10-26 11:11 UTC (permalink / raw)
  To: Jan Beulich, Andrew Cooper; +Cc: Wei Liu, xen-devel


[-- Attachment #1.1.1: Type: text/plain, Size: 773 bytes --]

On 25/10/2018 16.08, Jan Beulich wrote:
>>>> On 25.10.18 at 16:00, <andrew.cooper3@citrix.com> wrote:
>> For shipped binaries to customers, exactly when it was built is
>> irrelevant, whereas peoples ability to independently verify the
>> integrity of the binary is important.
> 
> Correct, which is why I appreciate the _option_ of zapping the
> timestamp.

Adding an option for this, would make the (already somewhat ugly) patch
even more ugly, so I thought, that fixing it in binutils might be the
better way, because other projects will also want to create reproducible
PE binaries and we do not want to add such ugly patches to all of them.
=> https://sourceware.org/ml/binutils/2018-10/msg00279.html


Let's see what they say.

Ciao
Bernhard M.


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 261 bytes --]

[-- Attachment #2: Type: text/plain, Size: 157 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

end of thread, other threads:[~2018-10-26 11:11 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-24  8:03 [PATCH] x86/efi: Do not insert timestamps in efi files Bernhard M. Wiedemann
2018-10-24  8:16 ` Andrew Cooper
2018-10-24 12:49   ` Bernhard M. Wiedemann
2018-10-24 13:04     ` Wei Liu
2018-10-24 13:45     ` Bernhard M. Wiedemann
2018-10-25  8:02       ` Wei Liu
     [not found]       ` <108D0A7C020000E4CA4B4E14@prv1-mh.provo.novell.com>
     [not found]         ` <74F2501302000079CA4B4E14@prv1-mh.provo.novell.com>
2018-10-25 12:35           ` Jan Beulich
2018-10-25 14:00             ` Andrew Cooper
2018-10-25 14:08               ` Jan Beulich
2018-10-26 11:11                 ` Bernhard M. Wiedemann

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.