On 8/2/17 2:37 AM, Laszlo Ersek wrote:
> //
>> +  // Zero the shared memory so that hypervisor no longer able to get 
>> intelligentable
>> +  // data.
>> +  //
>> +  SetMem ((VOID *) (UINTN)MapInfo->DeviceAddress, MapInfo->NumberOfBytes, 
>> 0);
> Please use ZeroMem().
>
> Furthermore, ZeroMem() should occur just before every FreePages() call:
> - when Unmap() releases the implicitly allocated bounce buffer
> - when FreeBuffer() releases the explicitly allocated common buffer
>   (I thought I spelled this out in my previous email(s), but in
>   retrospect it seems I only intended to :/ )
> - in the virtio drivers' exit-boot-services callbacks, FreeBuffer()
>   can't be called (only Unmap(), after the virtio reset), so the
>   ZeroMem() should be done manually there.

Not sure why do we need to ZeroMem() when FreeBuffer()  is called for
explicitly allocated common buffer ? I thought before calling the
FreeBuffer() on common buffer, client will call Unmap() which will
restore the C-bit state on the common buffer and also update the
contents (i.e now common buffer will contain encrypted data).
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to