Progress On Bounds Checking in C and the Linux Kernel
summary
Effort converts trailing zero/one-length arrays into real C99 flexible array members, adds -fstrict-flex-arrays and per-struct size annotations, and wires compiler builtins like __builtin_dynamic_object_size() into FORTIFY_SOURCE and sanitizers. A transform script plus a declare_flex_array helper handles uapi and unions; a finder reports about 160 candidate counted_by attribute sites. Measured memcpy/bounds coverage rises from ~46% (6.1) to ~54% (6.3 with alloc_size hints) to ~56% (6.4 with strict flex), showing real, incremental gains.
AI-written summary · about
chapters (8)
- 0:00Bounds checking in C and Linux
- 1:48C array problems and workarounds
- 8:09One-element and zero-length arrays
- 17:52Flexible array members
- 28:29Annotating runtime sizes
- 35:17Refactoring progress
- 42:22Future challenges
- 45:18Q&A
related talks
01h 10mEnhancing Spatial Safety: Better Array-bounds Checking in C (and Linux)
01h 12mEnhancing Spatial Safety: Better Array-bounds Checking in C (and Linux)
40mUpstream Kernel Hardening: Progress on Enabling -Wflex-array-member-not-at-end
40mUpstream Kernel Hardening: Progress on Enabling -Wflex-array-member-not-at-end
47mChallenges and Innovations Towards Spatial Safety in the Linux Kernel
54mSecurity Features status update
35mUpstream Kernel Hardening: Progress on Enabling -Wflex-array-member-not-at-end
35mUpstream Kernel Hardening: Recent Progress and Challenges
