Skip to contentSkip to conversation

Additional hardening options

yocto Paul Eggleton 3 participants 3 messages Jan 26, 2022 – Jan 27, 2022 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Quoted 8 lines · 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

Quoted 7 lines

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

#2 lore raw

I guess you can submit a patch, and it can be taken for a spin on the autobuilder?

Alex

Quoted 43 lines · Paul Eggleton
Quoted 3 lines · 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

Quoted 9 lines

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

Quoted 3 lines

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: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#3 lore raw
In reply to Paul Eggleton
Quoted 10 lines · Paul Eggleton
Quoted 8 lines · 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

Quoted 7 lines
Quoted 7 lines

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.

Quoted 21 lines

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: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-