From: Eric Wong Date: 2012-03-24T10:46:31+09:00 Subject: Re: Write to kernel buffer? ruby rub wrote: > It takes the password as input from the user, holds it in memory for > some period of time, and then overwrites it. It also doesn't > echo when the password is typed in. This is great but I also want to > make sure the password is overwritten in the kernel buffer. Does anyone > have any suggestions? Really I would just like to be pointed in the > right direction :). I don't think there's a good way to force this from userspace (in any programming language). Kernels will zero any memory it gives to userspace (via brk(2)/mmap(2)), but kernels will internally reuse buffers any way it sees fit. Even if you could clear the kernel memory right away (via custom kernel module/syscall), you can't guarantee hardware buffers (keyboard/network/console/video card/etc...) are cleared.