svn commit: r255567 - stable/9/sys/geom/zero

Alexander Motin mav at FreeBSD.org
Mon Sep 16 12:42:20 UTC 2013


On 16.09.2013 15:20, Ivan Voras wrote:
> On 14 September 2013 12:12, Alexander Motin <mav at freebsd.org> wrote:
>
>>    Add unmapped BIO support to GEOM ZERO if kern.geom.zero.clear is cleared.
>
>> +               if (g_zero_clear && (bp->bio_flags & BIO_UNMAPPED) == 0)
>>                          memset(bp->bio_data, g_zero_byte, bp->bio_length);
>
>
> Umm, I might be wrong, but won't this basically export random kernel
> memory to anyone reading from /dev/gzero?

I may be wrong, but I think it won't. Buffer for reading is provided by 
the caller, mapped to KVA and then unmapped back without modifications. 
If there was some garbage in the buffer, it will remain there, but that 
is a caller's garbage. There may be exceptions in case of of gstripe and 
graid3 that allocate own buffers I am not sure they clean before use, 
but do you know many people using graid3 on top of gzero?

-- 
Alexander Motin


More information about the svn-src-all mailing list