All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/1] qemu: explicitly disable SSP support
Date: Tue, 10 Nov 2015 22:11:20 +0100	[thread overview]
Message-ID: <56425D78.80103@mind.be> (raw)
In-Reply-To: <1447175937-18022-1-git-send-email-rprebello@gmail.com>

On 10-11-15 18:18, Rodrigo Rebello wrote:
> Even though the QEMU configure script does a full compile and link test
> to detect SSP support, it does so by using the compiler option
> -fstack-protector-strong (and then -fstack-protector-all if that fails).
> 
> The problem with this method is that the test program passes the check
> with -fstack-protector-strong even when SSP support is not available in
> the toolchain, since that option restricts stack protection to only a
> subset of all the functions in a program and (in the case of the test
> program) no "canary" code gets inserted, producing a false-positive.
> This causes a subsequent failure when the probe for pthreads is
> performed.
> 
> To avoid patching the configure script, fix that by simply disabling the
> use of stack protector when SSP is known to be unavailable in the
> toolchain.

 Actually, it doesn't look too hard to patch the configure script, and that
would be upstreamable.

 But if you feel that that is too difficult, I'm OK with this patch.

 Regards,
 Arnout

> 
> Fixes:
> 
>   http://autobuild.buildroot.net/results/efb/efbb4e940543894b8745bb405478a096c90a5ae2/
>   http://autobuild.buildroot.net/results/32d/32d6d984febad2dee1f0d31c5fa0aea823297096/
>   http://autobuild.buildroot.net/results/aa6/aa6e71c957fb6f07e7bded35a8e47be4dadd042c/
>   ...and many others.
> 
> Signed-off-by: Rodrigo Rebello <rprebello@gmail.com>
> ---
>  package/qemu/qemu.mk | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/package/qemu/qemu.mk b/package/qemu/qemu.mk
> index 94e1bcf..0161b10 100644
> --- a/package/qemu/qemu.mk
> +++ b/package/qemu/qemu.mk
> @@ -133,6 +133,12 @@ QEMU_VARS = \
>  	PYTHON=$(HOST_DIR)/usr/bin/python2 \
>  	PYTHONPATH=$(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages
>  
> +# Force disable stack protector when SSP isn't available in toolchain as
> +# QEMU configure script fails to properly detect that.
> +ifeq ($(BR2_TOOLCHAIN_HAS_SSP),)
> +QEMU_OPTS += --disable-stack-protector
> +endif
> +
>  # If we want to specify only a subset of targets, we must still enable all
>  # of them, so that QEMU properly builds its list of default targets, from
>  # which it then checks if the specified sub-set is valid. That's what we
> 


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

  parent reply	other threads:[~2015-11-10 21:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-10 17:18 [Buildroot] [PATCH 1/1] qemu: explicitly disable SSP support Rodrigo Rebello
2015-11-10 19:49 ` Ryan Barnett
2015-11-10 20:47   ` Rodrigo Rebello
2015-11-10 21:11 ` Arnout Vandecappelle [this message]
2015-11-10 21:22   ` Rodrigo Rebello

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=56425D78.80103@mind.be \
    --to=arnout@mind.be \
    --cc=buildroot@busybox.net \
    /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 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.