Coccinelle: Finding bugs in the Linux Kernel
summary
Coccinelle is a program-matching and transformation tool that uses SmPL semantic patch language to auto-find and auto-fix kernel bugs, producing about 4000+ kernel patches and shipping 40+ scripts with Linux. It matches code fragments, uses meta-variables, disjunctions and “dot dot dot” wildcards, runs as spatch in patch/context/report modes, and finds real issues like copy_to_user under spinlocks, missing bit-macro refactors and inter-file race patterns while integrating with Python/OCaml for reports and batch fixes.
AI-written summary · about
chapters (14)
- 0:00Start
- 5:08Code Maintenance Issues
- 8:02Some useless code
- 8:24Some serious stuff
- 9:53Goals of the tool Coccinelle
- 11:25Semantic Patch Language (SmPL)
- 12:02Example 1: Using BIT macro
- 15:14Example 2: Compressing the lines
- 16:07Transformation specification
- 16:51Spatch
- 17:25Coccicheck
- 17:54Modes for the Coccinelle script
- 19:11Some other notable features
- 22:36Useful links
related talks
08mLightning Talk: Coccinelle for C++
57mModern Linux C++ debugging tools - under the covers
23mTargeted Static Analysis for OCaml C Stubs: Eliminating gremlins from the code
51mMISRA C and C++ in OSS: Yes, We Can!
29mSecuring C code that seems to work just fine
22mWriting safe and secure code
49mPets, Cattle and Automatic Clang Operations with C++ Code
35mBetter C++ using Machine Learning on Large Projects
