~/talk

Subsystems with Object Lifetime Issues (in the Embedded Case)

links:none on file
slides:none on file

Claim: embedding a struct device inside driver-private structs and allocating the wrapper with devm_kzalloc always wrong in this context lets a platform remove free an object while it still has refs, producing use-after-free or hangs. A Coccinelle scan found ~630 structs that can embed struct device and produced a handful of real hits; demos include an MTD crash reproducer and a UART case that blocks via wait-for-completion. Fixes: subsystem-owned alloc APIs, release-hook audits, Coccinelle checks and exploring __cleanup/refcount patterns.

AI-written summary · about

  1. 0:00Object lifetime issues intro
  2. 1:50Device reference counting basics
  3. 3:14Lifetime problems rarity and danger
  4. 5:39Managed vs manual allocation
  5. 6:21devm_kzalloc trap in drivers
  6. 8:28Research with Coccinelle
  7. 11:59First results and surprises
  8. 12:44Live demo: UART behavior
  9. 15:24Live demo: MTD crash
  10. 18:40Live demo: I²C protection
  11. 23:18Analysis of I3C and NTV
  12. 24:44VirtIO subsystem investigation
  13. 26:36VirtIO devres misuse and fix
  14. 31:34Auxiliary bus API risks
  15. 33:21Preferred device lifetime solution
  16. 37:37USB gadget findings
  17. 38:18Lifecycle problems summary
  18. 40:02Solutions and future research
  19. 42:29Safety audits and process challenges
  20. 43:54Future outlook and fixes
  21. 44:38Acknowledgments
  22. 45:20Q&A: Devres and refcounted objects
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.