From nobody Wed Jul 9 22:54:56 2025 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622564816; cv=none; d=zohomail.com; s=zohoarc; b=PUoAr+ey+WxjUiFizAG/b2Y9KaqZSwZs2n0xunEwZDN6KWNL9QawPrvbjQ8+qc6pcXeffxE5SLFiejvdZIzAGncozky9iedQ1QO/0T3t8alnE85eDjbWywsXfhVjXEfEiJAAlibdKoT5TDJcyAw08fOn2Vg2WwG8V/8lZf00mdY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622564816; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=kbemtu5SuRmZUgikT9P1lOnHb3c8k3upALUhB55ylRo=; b=UXcjdXS2gaCxHd5sWY7DWmpfhBpCmvP9ughl/ghnNChjmC3Ro/6DaqDNRZWmf0lUXXVoy/Y+khU2+hJeCx2Pewr3a+piOYYdO35NBswGyf9koBuzTX/+oOOmFKX0hM8KKZMYkryurrKtw8ljQ4nywnSkqpBN5l5Tc04GPBVWCSQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622564816836258.0359215703985; Tue, 1 Jun 2021 09:26:56 -0700 (PDT) Received: from localhost ([::1]:38948 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lo7EE-0000cx-RX for importer2@patchew.org; Tue, 01 Jun 2021 12:26:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39190) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lo7DO-0007rt-89 for qemu-devel@nongnu.org; Tue, 01 Jun 2021 12:26:03 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:50965) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lo7DJ-0001d7-P0 for qemu-devel@nongnu.org; Tue, 01 Jun 2021 12:26:01 -0400 Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-497-EzqY3zfwN5mQhzxwZwRMUw-1; Tue, 01 Jun 2021 12:25:51 -0400 Received: by mail-ed1-f70.google.com with SMTP id q18-20020a0564025192b02903888712212fso8103242edd.19 for ; Tue, 01 Jun 2021 09:25:51 -0700 (PDT) Received: from x1w.redhat.com (235.red-83-57-168.dynamicip.rima-tde.net. [83.57.168.235]) by smtp.gmail.com with ESMTPSA id s10sm1895658ejf.54.2021.06.01.09.25.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jun 2021 09:25:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622564754; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kbemtu5SuRmZUgikT9P1lOnHb3c8k3upALUhB55ylRo=; b=EHsqC+SDS9r5Mn9zWGN6VKkraY7hcwBQTkqp3L8ADPFNk6rbfkveJSamJ8w61OpFJXOiDb PfKP/UBkzfKA69orr6+klWFqVK+GpaLihZJWyQ6zGBGPRUW2N0+WxuCI24v3ma0ReBmLj3 T17G1yrM1Qyo/GyQy14lTsyzVAWdHmg= X-MC-Unique: EzqY3zfwN5mQhzxwZwRMUw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=kbemtu5SuRmZUgikT9P1lOnHb3c8k3upALUhB55ylRo=; b=fof8p8xXlkqBKwV2qrxTPECTwIqTYGV5Mh1Zo3NWn19ZJFA2pbOaOoKFe9z2PdwTZK 88x03aLJ5wqvQZPxiKnEPk7Sf3I6xur+W7m4g937p+dVyIXiyM4mNZIu5eG0sWlFzlU4 OtraArpCW/+kW5wLjxkR3vv807qZvg+p+GmMa8BVMYrh/2IgRbaNh+UzwMQ6eQhFor4L eifuHqJljwRIfQoF0Q2T+FvusQgH6yWp+d15bZ1gywt4xZKhm4VvkMhmGM0rexeNG51l WKeVvOX4unn//cnPt2oWUdfBo+jIwHHhRVCbnVZzuwSf8nc438M6XmlMEy4mhok7lXpW gNag== X-Gm-Message-State: AOAM530YQOPJycnlqf6V0k0n36/NhyyW6sO3JWa5eY8J7t4IBfklYcm/ iTVb1yZ2m0rrJ6TMYH6IzfPOL0tdO4Z7wINwJrSanMIVuEHBohl756mOx7/BIbynICGf50P1sSK XHs76Idiikfyb0NY= X-Received: by 2002:aa7:cfc5:: with SMTP id r5mr22061940edy.319.1622564750239; Tue, 01 Jun 2021 09:25:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycU8skpU6Zi1H+2RK2KMjeAb8lhJ/q4JhWVmUl+9e2Y7t+CfkVL/mmz+crHku04lqotJbf5Q== X-Received: by 2002:aa7:cfc5:: with SMTP id r5mr22061911edy.319.1622564750062; Tue, 01 Jun 2021 09:25:50 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Fam Zheng , qemu-devel@nongnu.org, Vladimir Sementsov-Ogievskiy Subject: [PATCH v4] docs/secure-coding-practices: Describe how to use 'null-co' block driver Date: Tue, 1 Jun 2021 18:25:48 +0200 Message-Id: <20210601162548.2076631-1-philmd@redhat.com> X-Mailer: git-send-email 2.26.3 MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.371, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , qemu-block@nongnu.org, Markus Armbruster , Prasad J Pandit , Bandan Das , Max Reitz , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Document that security reports must use 'null-co,read-zeroes=3Don' 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=C3=A9 --- v4: Fixed typo (Kevin) v3: Simplified using Vladimir suggestion. --- docs/devel/secure-coding-practices.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/devel/secure-coding-practices.rst b/docs/devel/secure-cod= ing-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 prev= ents time-of-check-to-time-of-use (TOCTOU) race conditions that could cause QEM= U 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 accesse= s are +not initialized by default. In case this driver has to be used for security +research, it must be used with the ``read-zeroes=3Don`` option which fills= read +buffers with zeroes. Security issues reported with the default +(``read-zeroes=3Doff``) will be discarded. --=20 2.26.3