~/talk

Why is devm_kzalloc() harmful and what can we do about it

links:none on file
slides:none on file

Argument: devm_kzalloc ties memory to the physical struct device, so unplugging or unbinding frees resources while user processes still hold file descriptors, creating real use-after-free crashes. Evidence: long-standing conversions across kernels and subsystems, DRM uses a separate drmm_kzalloc that ties allocations to the char-device lifetime and avoids the bug. Proposed fixes: add a separate device-owner lifetime object, propagate krefs automatically, or add compiler/tooling checks and clear examples; prototypes exist in DRM and V4L but full generic solution is unfinished.

AI-written summary · about

  1. 0:00Introduction to devres
  2. 10:20The use-after-free problem
  3. 18:09Current devres limitations
  4. 26:10Solutions and trade-offs
  5. 36:43Tooling and future work
  6. 42:42Q&A and closing
~/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.