Repository navigation
kernel-kasan: a debug kernel that reports a bad write where it happens - #217
Merged
Merged
Conversation
Slab debugging found whole slab pages zeroed while in use on 2026-11-15, minutes after the fact and with nothing to name the writer. It checks an object when it is next allocated or freed; it cannot see the access. `just kernel-kasan` builds the debug kernel with, on top: - KASAN, generic and inline, with vmalloc covered: a use after free, an out-of-bounds access or a write into a red zone is reported at the access, with the stacks that allocated, freed and (for call_rcu) queued the free. - DEBUG_VM: the page descriptor is checked on every allocation and free. - DEBUG_VFS: the inode reference-count assertions. - DEBUG_LIST. The fragment stacks on the debug one through merge-fragments.sh, and the result goes to .build/kernel-arm64.kasan. Nothing shipped changes. Not built: this sandbox cannot run the kernel build. The merge of the three fragments was run and yields no symbol decided twice; whether every line survives olddefconfig is for the first build to say. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: closer-claudio <claudio@farcloser.world>
closer-claudio
enabled auto-merge
November 15, 2026 19:35
Contributor
Author
|
Reviewed at f68f0de |
apostasie
approved these changes
Nov 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 Why
Slab debugging on the debug kernel found whole slab pages zeroed while in use on 2026-11-15 (#214 (comment)). It checks an object when it is next allocated or freed, so it names the damaged page minutes late and cannot name the writer. Finding the writer needs a kernel that checks the access itself.
🛠️ What
kernel/config/kernel-kasan-fragment: KASAN (generic, inline, vmalloc covered),DEBUG_VM,DEBUG_VFS,DEBUG_LIST, each with what it reports and what it costs.just kernel-kasan: merges the ship fragment, the debug fragment, then this one withkernel/merge-fragments.sh, and builds.build/kernel-arm64.kasan(localversionossein-kasan). It mirrorskernel-debug, including skippingkernel-verify-config.Nothing shipped changes.
🧪 How
just lintexit 0,just testexit 0,just do lint commitsPASS, on the committed tree.KASAN_INLINEis the default instrumentation; arm64 selectsKASAN_VMALLOCunder KASAN andVMAP_STACKdepends on it;DEBUG_VM,DEBUG_VFSandDEBUG_LISTdepend only onDEBUG_KERNEL; KASAN depends onSYSFSand!SLUB_TINY, which the ship fragment satisfies.just kernel*. Whether every line survivesolddefconfig(build.sh checks each), whether the image links under ThinLTO, and whether the Virtualization framework boots it, are for the firstjust kernel-kasanto say.