Enhancing Spatial Safety: Better Array-bounds Checking in C (and Linux)
Talkat Open Source Summit Japan + AI_dev: Open Source GenAI & ML Summit + Automotive Linux Summit 2025 · 2025-12-08..12-10·
summary
Six years of kernel hardening turns into concrete fixes: memcpy is rewritten to use __builtin_object_size(mode=1) then __builtin_dynamic_object_size paired with the new counted_by attribute (Clang 18 / GCC 15) so flexible members get runtime bounds checks, and -fstrict-flex-arrays=3 lands in Linux 6.5 after a five-year push converting one‑element and zero‑length arrays to true flex members. A true_group macro removes hundreds of false positives; one flag initially reports >60,000 warnings (650 unique) and the changes are enabled via CONFIG_FORTIFY_SOURCE.
AI-written summary · about
chapters (10)
- 0:00Spatial safety in C
- 3:12Arrays and flexible members
- 12:26Flexible arrays in Linux
- 21:19Hardening memcpy
- 29:53Trailing array ambiguity
- 36:13Strict flex arrays
- 43:18Flexible array challenges
- 51:46Counted by attribute
- 1:00:12BleedingTooth hardening
- 1:03:26Conclusions
related talks
47mChallenges and Innovations Towards Spatial Safety in the Linux Kernel
46mProgress On Bounds Checking in C and the Linux Kernel
35mUpstream Kernel Hardening: Recent Progress and Challenges
40mUpstream Kernel Hardening: Progress on Enabling -Wflex-array-member-not-at-end
54mSecurity Features status update
52mWelcome & Opening Remarks & Meaningful Bounds Checking in the Linux Kernel
34mMaking C Less Dangerous
01h 26mA Path to Practically Safe C++
