Skip to contentSkip to conversation

docs/system/security: exclude uninitialized stack variables as bugs

PATCH In review Daniel P. Berrangé 2 participants 3 messages Jul 23

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 docs/system/security: exclude uninitialized stack variables as bugs

The -ftrivial-auto-var-init=zero usage guarantees implicit zero initializers for all stack variables. Thus most bug reports relying on undefined behaviour from lack of variable initialization will not be security issues, or even bugs.

---
 docs/system/security.rst | 10 ++++++++++
 1 file changed, 10 insertions(+)
docs/system/security.rst +10 -0
index 52bbf0cc7a..bbc462457e 100644
@@ -133,6 +133,16 @@ an issue as a normal bug.
   that affect the level 0 QEMU process. While these bugs should be
   fixed, they will not be triaged as security flaws at this time.
 
+* **uninitialized stack variables**. If the bug scenario relies on
+  undefined behaviour from stack variables that lack explicit
+  initialization, it will not usually be considered a security flaw.
+  The build system adds '-ftrivial-auto-var-init=zero', which is
+  available in both the supported compilers (GCC and CLang) and
+  ensures all stack variables have implicit zero-initializers.
+  This eliminates undefined behaviour and usually gives the
+  correct desired initialization value, eliminating most of the
+  bug scenarios wrt uninitialized stack variables.
+
 * **low severity impact**. As a catch all rule, issues which
   are judged to have a "low" severity impact on the system will
   usually not justify handling as security bugs, nor assignment
Signature · 1 line
2.55.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Daniel P. Berrangé

The -ftrivial-auto-var-init=zero usage guarantees implicit zero initializers for all stack variables. Thus most bug reports relying on undefined behaviour from lack of variable initialization will not be security issues, or even bugs.

Still worth to explicitly clear or set the variable though, since it's not standard C otherwise and sometimes 0 is not the correct value.

Quoted 29 lines
---
 docs/system/security.rst | 10 ++++++++++
 1 file changed, 10 insertions(+)
docs/system/security.rst +10 -1
index 52bbf0cc7a..bbc462457e 100644
@@ -133,6 +133,16 @@ an issue as a normal bug.
   that affect the level 0 QEMU process. While these bugs should be
   fixed, they will not be triaged as security flaws at this time.
 
+* **uninitialized stack variables**. If the bug scenario relies on
+  undefined behaviour from stack variables that lack explicit
+  initialization, it will not usually be considered a security flaw.
+  The build system adds '-ftrivial-auto-var-init=zero', which is
+  available in both the supported compilers (GCC and CLang) and
+  ensures all stack variables have implicit zero-initializers.
+  This eliminates undefined behaviour and usually gives the
+  correct desired initialization value, eliminating most of the
+  bug scenarios wrt uninitialized stack variables.
+
 * **low severity impact**. As a catch all rule, issues which
   are judged to have a "low" severity impact on the system will
   usually not justify handling as security bugs, nor assignment
--

2.55.0

Signature · 1 line
Marc-André Lureau
#2 lore raw
Quoted 11 lines · Marc-André Lureau
Quoted 7 lines · Daniel P. Berrangé

The -ftrivial-auto-var-init=zero usage guarantees implicit zero initializers for all stack variables. Thus most bug reports relying on undefined behaviour from lack of variable initialization will not be security issues, or even bugs.

Still worth to explicitly clear or set the variable though, since it's not standard C otherwise and sometimes 0 is not the correct value.

Yes, certainly we should make it explicit for reviewer sanity if nothing else.

With regards,
Daniel

Signature · 3 lines
|: https://berrange.com       ~~        https://hachyderm.io/@berrange :|
|: https://libvirt.org          ~~          https://entangle-photo.org :|
|: https://pixelfed.art/berrange   ~~    https://fstop138.berrange.com :|