Am Samstag, den 16.01.2016, 20:43 -0500 schrieb Rich Felker: > Right now, musl's stdio setvbuf function does nothing but set the > buffering mode; it does not honor the buffer provided by the caller. > This is perfectly conforming (whether or how the buffer is used is > unspecified), but I realized from the recent thread about OpenSSH's > CVE-2016-0777 on oss-security that a non-stub setvbuf admits a nice > type of hardening: > > http://www.openwall.com/lists/oss-security/2016/01/15/15 > > In short, the application has no way to scrub implementation-internal > stdio buffers that might contain sensitive data read from or written > to files, but it can scrub buffers it provides via setvbuf. So, I'd > like to start actually using the latter, so that apps that attempt > this hardening measure can benefit from it on musl like they would on > other implementations. How about just using setvbuf as an indication that the user wants the buffer to be scrubbed? And so just zero it? I wouldn't expect setvbuf to be used in places that are performance critical, so an additional memset shouldn't do much harm, I think. Jens -- :: INRIA Nancy Grand Est ::: Camus ::::::: ICube/ICPS ::: :: ::::::::::::::: office Strasbourg : +33 368854536 :: :: :::::::::::::::::::::: gsm France : +33 651400183 :: :: ::::::::::::::: gsm international : +49 15737185122 :: :: http://icube-icps.unistra.fr/index.php/Jens_Gustedt ::