From: Philippe Mathieu-Daudé Date: Tue, 1 Jun 2021 16:25:48 +0000 (+0200) Subject: docs/secure-coding-practices: Describe how to use 'null-co' block driver X-Git-Tag: v6.1.0-rc0~89^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b317006a3f1f04191a7981cef83417cb2477213b;p=thirdparty%2Fqemu.git docs/secure-coding-practices: Describe how to use 'null-co' block driver Document that security reports must use 'null-co,read-zeroes=on' because otherwise the memory is left uninitialized (which is an on-purpose performance feature). Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20210601162548.2076631-1-philmd@redhat.com> Signed-off-by: Kevin Wolf --- diff --git a/docs/devel/secure-coding-practices.rst b/docs/devel/secure-coding-practices.rst index cbfc8af67e6..0454cc527e1 100644 --- a/docs/devel/secure-coding-practices.rst +++ b/docs/devel/secure-coding-practices.rst @@ -104,3 +104,12 @@ structures and only process the local copy. This prevents time-of-check-to-time-of-use (TOCTOU) race conditions that could cause QEMU to crash when a vCPU thread modifies guest RAM while device emulation is processing it. + +Use of null-co block drivers +---------------------------- + +The ``null-co`` block driver is designed for performance: its read accesses are +not initialized by default. In case this driver has to be used for security +research, it must be used with the ``read-zeroes=on`` option which fills read +buffers with zeroes. Security issues reported with the default +(``read-zeroes=off``) will be discarded.