Skip to contentSkip to conversation

utils/genrandconfig: drop hardening Config enables

PATCH New Matthew Weber 2 participants 4 messages May 21, 2021 – May 24, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 utils/genrandconfig: drop hardening Config enables

Since 810ba387bec3c5b, some form of these options are enable by default. Specifically:

- Kept FORTIFY level 2 option as the default is now level 1.
- Removed all SSP options as the default now uses the best option based on toolchain support.
- Similar to SSP, for RELRO, the default now uses the best option based on toolchain support.
- Completely drop PIC PIE as it defaults =y

---
 utils/genrandconfig | 14 --------------
 1 file changed, 14 deletions(-)
utils/genrandconfig +0 -14
index 93dc6d898b..e1655655fa 100755
@@ -371,22 +371,8 @@ def gen_config(args):
         configlines.append("BR2_OPTIMIZE_2=y\n")
     if randint(0, 4) == 0:
         configlines.append("BR2_SYSTEM_ENABLE_NLS=y\n")
-    if randint(0, 4) == 0:
-        configlines.append("BR2_PIC_PIE=y\n")
-    if randint(0, 4) == 0:
-        configlines.append("BR2_RELRO_FULL=y\n")
-    elif randint(0, 4) == 0:
-        configlines.append("BR2_RELRO_PARTIAL=y\n")
-    if randint(0, 4) == 0:
-        configlines.append("BR2_SSP_ALL=y\n")
-    elif randint(0, 4) == 0:
-        configlines.append("BR2_SSP_REGULAR=y\n")
-    elif randint(0, 4) == 0:
-        configlines.append("BR2_SSP_STRONG=y\n")
     if randint(0, 4) == 0:
         configlines.append("BR2_FORTIFY_SOURCE_2=y\n")
-    elif randint(0, 4) == 0:
-        configlines.append("BR2_FORTIFY_SOURCE_1=y\n")
 
     # Randomly enable BR2_REPRODUCIBLE 10% of times
     # also enable tar filesystem images for testing
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 utils/genrandconfig: drop hardening Config enables

Matthew, All,

On 2021-05-21 08:17 -0500, Matthew Weber via buildroot spake thusly:

Quoted 29 lines

Since 810ba387bec3c5b, some form of these options are enable by default. Specifically:

- Kept FORTIFY level 2 option as the default is now level 1.
- Removed all SSP options as the default now uses the best option based on toolchain support.
- Similar to SSP, for RELRO, the default now uses the best option based on toolchain support.
- Completely drop PIC PIE as it defaults =y

---
 utils/genrandconfig | 14 --------------
 1 file changed, 14 deletions(-)
utils/genrandconfig +0 -6
index 93dc6d898b..e1655655fa 100755
@@ -371,22 +371,8 @@ def gen_config(args):
         configlines.append("BR2_OPTIMIZE_2=y\n")
     if randint(0, 4) == 0:
         configlines.append("BR2_SYSTEM_ENABLE_NLS=y\n")
-    if randint(0, 4) == 0:
-        configlines.append("BR2_PIC_PIE=y\n")
-    if randint(0, 4) == 0:
-        configlines.append("BR2_RELRO_FULL=y\n")
-    elif randint(0, 4) == 0:
-        configlines.append("BR2_RELRO_PARTIAL=y\n")

utils/genrandconfig def gen_config(args): · line 389

Quoted 10 lines
utils/genrandconfig +0 -8
-    if randint(0, 4) == 0:
-        configlines.append("BR2_SSP_ALL=y\n")
-    elif randint(0, 4) == 0:
-        configlines.append("BR2_SSP_REGULAR=y\n")
-    elif randint(0, 4) == 0:
-        configlines.append("BR2_SSP_STRONG=y\n")
     if randint(0, 4) == 0:
         configlines.append("BR2_FORTIFY_SOURCE_2=y\n")
-    elif randint(0, 4) == 0:
-        configlines.append("BR2_FORTIFY_SOURCE_1=y\n")

I was going to apply this, but then I was wondering: shouldn't we randomly *disable* them, now?

Indeed, as much enabling those options randomly helped uncover build issues, maybe disabling them would also help?

But I don't feel very strong either, so you should have no issue convincing me to apply as-is. ;-)

Regards,
Yann E. MORIN.

Quoted 9 lines
utils/genrandconfig +0 -0
     # Randomly enable BR2_REPRODUCIBLE 10% of times
     # also enable tar filesystem images for testing
Signature · 6 lines
2.17.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#2 lore raw

PATCH 1/1 utils/genrandconfig: drop hardening Config enables

Matthew, All,

On 2021-05-24 15:16 +0200, Yann E. MORIN spake thusly:

Quoted 13 lines

On 2021-05-21 08:17 -0500, Matthew Weber via buildroot spake thusly:

Quoted 12 lines

Since 810ba387bec3c5b, some form of these options are enable by default. Specifically:

- Kept FORTIFY level 2 option as the default is now level 1.
- Removed all SSP options as the default now uses the best option based on toolchain support.
- Similar to SSP, for RELRO, the default now uses the best option based on toolchain support.
- Completely drop PIC PIE as it defaults =y

---

[--SNIP--]

Quoted 8 lines

I was going to apply this, but then I was wondering: shouldn't we randomly *disable* them, now?

Indeed, as much enabling those options randomly helped uncover build issues, maybe disabling them would also help?

But I don't feel very strong either, so you should have no issue convincing me to apply as-is. ;-)

As discussed on IRC: if there is an issue with any of those disabled, we can handle them as they are reported by users.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#3 lore raw

PATCH 1/1 utils/genrandconfig: drop hardening Config enables

In reply to Matthew Weber

Matthew, All,

On 2021-05-21 08:17 -0500, Matthew Weber via buildroot spake thusly:

Quoted 11 lines

Since 810ba387bec3c5b, some form of these options are enable by default. Specifically:

- Kept FORTIFY level 2 option as the default is now level 1.
- Removed all SSP options as the default now uses the best option based on toolchain support.
- Similar to SSP, for RELRO, the default now uses the best option based on toolchain support.
- Completely drop PIC PIE as it defaults =y

Applied to master, thanks.

Regards,
Yann E. MORIN.

Quoted 38 lines
---
 utils/genrandconfig | 14 --------------
 1 file changed, 14 deletions(-)
utils/genrandconfig +0 -14
index 93dc6d898b..e1655655fa 100755
@@ -371,22 +371,8 @@ def gen_config(args):
         configlines.append("BR2_OPTIMIZE_2=y\n")
     if randint(0, 4) == 0:
         configlines.append("BR2_SYSTEM_ENABLE_NLS=y\n")
-    if randint(0, 4) == 0:
-        configlines.append("BR2_PIC_PIE=y\n")
-    if randint(0, 4) == 0:
-        configlines.append("BR2_RELRO_FULL=y\n")
-    elif randint(0, 4) == 0:
-        configlines.append("BR2_RELRO_PARTIAL=y\n")
-    if randint(0, 4) == 0:
-        configlines.append("BR2_SSP_ALL=y\n")
-    elif randint(0, 4) == 0:
-        configlines.append("BR2_SSP_REGULAR=y\n")
-    elif randint(0, 4) == 0:
-        configlines.append("BR2_SSP_STRONG=y\n")
     if randint(0, 4) == 0:
         configlines.append("BR2_FORTIFY_SOURCE_2=y\n")
-    elif randint(0, 4) == 0:
-        configlines.append("BR2_FORTIFY_SOURCE_1=y\n")
 
     # Randomly enable BR2_REPRODUCIBLE 10% of times
     # also enable tar filesystem images for testing
Signature · 6 lines
2.17.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'