* Re: [yocto] Additional hardening options
[not found] <16CDAE6528BAE915.24088@lists.yoctoproject.org>
@ 2022-01-26 21:16 ` Paul Eggleton
2022-01-26 21:31 ` Alexander Kanavin
2022-01-27 1:50 ` Khem Raj
0 siblings, 2 replies; 4+ messages in thread
From: Paul Eggleton @ 2022-01-26 21:16 UTC (permalink / raw)
To: yocto; +Cc: Paul Eggleton
On Wednesday, 26 January 2022 14:39:39 NZDT Paul Eggleton wrote:
> Hi folks
>
> I've been looking into a couple of compiler flags for hardening that I think
> we might want to consider enabling by default in security-flags.inc:
>
>
> 1) -fstack-clash-protection
>
> This option was introduced to gcc 8.x and provides protection against the
> stack clash vulnerability:
>
> https://securingsoftware.blogspot.com/2017/12/stack-clash-vulnerability.html
>
> It has been enabled in some Linux distributions already (e.g. Ubuntu,
> Fedora).
Another quirk of this - with dunfell, the buildepoxy SDK test fails on Ubuntu
18.04 with -fstack-clash-protection because the version of meson in dunfell
uses the same LDFLAGS value for both host and target, and host gcc doesn't
support that option. Not sure what to do other than just filtering out the
option from LDFLAGS in the test.
Cheers
Paul
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [yocto] Additional hardening options
2022-01-26 21:16 ` [yocto] Additional hardening options Paul Eggleton
@ 2022-01-26 21:31 ` Alexander Kanavin
2022-01-27 1:50 ` Khem Raj
1 sibling, 0 replies; 4+ messages in thread
From: Alexander Kanavin @ 2022-01-26 21:31 UTC (permalink / raw)
To: Paul Eggleton; +Cc: Yocto-mailing-list
[-- Attachment #1: Type: text/plain, Size: 1527 bytes --]
I guess you can submit a patch, and it can be taken for a spin on the
autobuilder?
Alex
On Wed, 26 Jan 2022 at 22:17, Paul Eggleton <bluelightning@bluelightning.org>
wrote:
> On Wednesday, 26 January 2022 14:39:39 NZDT Paul Eggleton wrote:
> > Hi folks
> >
> > I've been looking into a couple of compiler flags for hardening that I
> think
> > we might want to consider enabling by default in security-flags.inc:
> >
> >
> > 1) -fstack-clash-protection
> >
> > This option was introduced to gcc 8.x and provides protection against the
> > stack clash vulnerability:
> >
> >
> https://securingsoftware.blogspot.com/2017/12/stack-clash-vulnerability.html
> >
> > It has been enabled in some Linux distributions already (e.g. Ubuntu,
> > Fedora).
>
> Another quirk of this - with dunfell, the buildepoxy SDK test fails on
> Ubuntu
> 18.04 with -fstack-clash-protection because the version of meson in
> dunfell
> uses the same LDFLAGS value for both host and target, and host gcc doesn't
> support that option. Not sure what to do other than just filtering out the
> option from LDFLAGS in the test.
>
> Cheers
> Paul
>
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#55987):
> https://lists.yoctoproject.org/g/yocto/message/55987
> Mute This Topic: https://lists.yoctoproject.org/mt/88687579/1686489
> Group Owner: yocto+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [
> alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
[-- Attachment #2: Type: text/html, Size: 2567 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [yocto] Additional hardening options
2022-01-26 21:16 ` [yocto] Additional hardening options Paul Eggleton
2022-01-26 21:31 ` Alexander Kanavin
@ 2022-01-27 1:50 ` Khem Raj
1 sibling, 0 replies; 4+ messages in thread
From: Khem Raj @ 2022-01-27 1:50 UTC (permalink / raw)
To: Paul Eggleton; +Cc: Yocto-mailing-list
On Wed, Jan 26, 2022 at 1:17 PM Paul Eggleton
<bluelightning@bluelightning.org> wrote:
>
> On Wednesday, 26 January 2022 14:39:39 NZDT Paul Eggleton wrote:
> > Hi folks
> >
> > I've been looking into a couple of compiler flags for hardening that I think
> > we might want to consider enabling by default in security-flags.inc:
> >
> >
> > 1) -fstack-clash-protection
> >
> > This option was introduced to gcc 8.x and provides protection against the
> > stack clash vulnerability:
> >
> > https://securingsoftware.blogspot.com/2017/12/stack-clash-vulnerability.html
> >
> > It has been enabled in some Linux distributions already (e.g. Ubuntu,
> > Fedora).
That is good testimony, it will be good to know how this option
impacts performance
and does it work across architectures and libc's supported in OE.
>
> Another quirk of this - with dunfell, the buildepoxy SDK test fails on Ubuntu
> 18.04 with -fstack-clash-protection because the version of meson in dunfell
> uses the same LDFLAGS value for both host and target, and host gcc doesn't
> support that option. Not sure what to do other than just filtering out the
> option from LDFLAGS in the test.
>
> Cheers
> Paul
>
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> You automatically follow any topics you start or reply to.
> View/Reply Online (#55987): https://lists.yoctoproject.org/g/yocto/message/55987
> Mute This Topic: https://lists.yoctoproject.org/mt/88687579/1997914
> Group Owner: yocto+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [yocto] Additional hardening options
2022-01-26 1:39 Paul Eggleton
@ 2022-02-01 8:08 ` Richard Purdie
0 siblings, 0 replies; 4+ messages in thread
From: Richard Purdie @ 2022-02-01 8:08 UTC (permalink / raw)
To: Paul Eggleton, yocto
On Wed, 2022-01-26 at 14:39 +1300, Paul Eggleton wrote:
> Hi folks
>
> I've been looking into a couple of compiler flags for hardening that I think we
> might want to consider enabling by default in security-flags.inc:
>
>
> 1) -fstack-clash-protection
>
> This option was introduced to gcc 8.x and provides protection against the
> stack clash vulnerability:
>
> https://securingsoftware.blogspot.com/2017/12/stack-clash-vulnerability.html
>
> It has been enabled in some Linux distributions already (e.g. Ubuntu, Fedora).
>
>
> 2) -z noexecstack (or alternative mitigations)
>
> gcc will enable an executable stack under a few different circumstances - see
> here for details
>
> https://wiki.gentoo.org/wiki/Hardened/GNU_stack_quickstart
>
> I've written a check that we could add to insane.bbclass that warns/errors on
> binaries with an executable stack. Does this seem reasonable to have?
> The other possibility is we add -Wl,-z,noexecstack to LDFLAGS and then see
> what breaks, but unfortunately issues are likely only going to show up when
> the program crashes at runtime, and also it will stop the aforementioned check
> from working.
>
>
> Any opinions?
These seem like reasonable things to do, are there any downsides to them?
I'd be happy to test some patches, see if they do cause issues...
Cheers,
Richard
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-02-01 8:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <16CDAE6528BAE915.24088@lists.yoctoproject.org>
2022-01-26 21:16 ` [yocto] Additional hardening options Paul Eggleton
2022-01-26 21:31 ` Alexander Kanavin
2022-01-27 1:50 ` Khem Raj
2022-01-26 1:39 Paul Eggleton
2022-02-01 8:08 ` [yocto] " Richard Purdie
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.