lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 16 May 2016 12:30:51 +0200
From:	Ingo Molnar <>
To:	"H. Peter Anvin" <>
Cc:	Kees Cook <>, Borislav Petkov <>,
	Baoquan He <>, Yinghai Lu <>,
	Thomas Gleixner <>,
	Ingo Molnar <>,
	"" <>,
	Andrew Morton <>,
	Josh Poimboeuf <>,
	Andrey Ryabinin <>,
	"H.J. Lu" <>,
	Dmitry Vyukov <>,
	LKML <>
Subject: Re: [PATCH] x86/boot: Refuse to build with data relocations

* H. Peter Anvin <> wrote:

> On 05/12/16 15:54, Kees Cook wrote:
> >>
> >> It would be far better to warn on the *type* of relocations rather than in which section they feel.
> > 
> > I'm open to specific changes. What's the best way to detect what you want here?
> > 
> Use readelf -r and look for inappropriate relocation types (which are
> basically the same ones that we should have to muck with for the main
> kernel in relocs.c.)

I suspect initially we are good if we don't allow any relocations in 

 fomalhaut:~/linux/linux> readelf -r arch/x86/boot/compressed/vmlinux | grep -q  'There are no relocations in this file' ; echo $?

versus a regular object file with lots of relocations:

 fomalhaut:~/linux/linux> readelf -r arch/x86/built-in.o | grep -q 'There are no relocations in this file' ; echo $?

I.e. the relevant portion of Kees's patch would do something like:

quiet_cmd_check_data_rel = DATAREL $@
define cmd_check_data_rel
       for obj in $(filter %.o,$^); do \
               readelf -r $$obj | grep -qF 'There are no relocations in this file' && exit 0 || { \
                       echo "error: $$obj has data relocations!" >&2; \
                       exit 1; \
               } \

(totally untested)




Powered by blists - more mailing lists