Should it not be standard practice that if a user passes an N-byte buffer and the kernel has
less than N bytes to store in it, the rest should nevertheless be written (for example
zeroed)? This would avoid the possibility of latent bugs such as this one biting years later.
Instead, they'd probably bite while the original code was being debugged, and even if not, the
bug would clearly be seen to be a latent memory-corruption bug in userspace and not anything
that's the kernel's fault.
Posted Aug 7, 2008 20:30 UTC (Thu) by davecb (subscriber, #1574)
[Link]
That might be an interesting thing to propose to the LKML
as a janitorial project. Of course, it would need to
default off for the interfaces we find broken right now (;-))
but over time it would close this ABI hole...
--dave (ex-ABI team guy) c-b