


























Version 6.1.0 was released yesterday.
Much of the recent work has focused on code review and hardening. Making sure the code handles exceptions appropriately. For example, if out of memory prevents additional mem allocation, does the code handle this sensibly.
In case it might be of interest to others, here are some build options we're using (They're all in the meson.build file)
* -fanalyzer : # confirmed there are no warnings at all when sd-boot is compiled with this turned on
Compiler:
* -fstack-protector-strong, # Protect function calls with stack canaries
* -fstack-clash-protection, # Prevents stack-clash exploits
* -ftrivial-auto-var-init=zero, # Eliminate uninitialized stack memory leaks
* -fzero-call-used-regs=used-gpr, # Wipe general registers before returning
* -mshstk, # Intel Shadow Stack protection
* -fcf-protection, # Control-flow enforcement
* -Wshadow, # Warn if local variable/decl shadows another
* -Wconversion, # Warn about type conversions that may alter value
* -Wformat=2, # Warn about format/args mismatch printf, scanf etc
* -Werror=format-security, # Also warn about insecure printf format strings
* -fvisibility=hidden # Only explicitly exported symbols are put into the shared lib symbol table
* -Wp,-D_FORTIFY_SOURCE=3 # buffer-overflow protection
Loader:
* -Wl,--as-needed, # Limit shared to 'as needed'
* -Wl,-z,relro, # Mark relocation tables read-only
* -Wl,-z,now, # Force immediate binding (Full RELRO)
* -Wl,-z,noexecstack, # Strictly enforce non-executable stack
* -Wl,-z,pack-relative-relocs, # Optimize layout with DT_RELR packing
* -Wl,-z,defs, # Catch unresolved symbols at link time, not at runtime
Some of what we're using are also in Arch /etc/makepkg.conf. Side note. some of the arch ones are legacy and probably should be reconsidered
(For example -Wl,-O1 and -Wl,--sort-common )
I found Claude quite helpful in this review.
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。