From nobody Wed Nov 19 08:21:14 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1615376618; cv=none; d=zohomail.com; s=zohoarc; b=XGmV88egSBX74B7eXhmi4w5oo5ydRvCUjXcFQHjfQq4k5cBUsjyRmHiggeHa7/L11ApEkgJGVA+Sta5FSt13vNLIbGrADscbEK/VmlCXjuKRUBJteO9tByeDgUo+RXqKPNnjOnIDH4FcbJP9iwVoj1c2gpcUz9MahQo09hI8jW0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615376618; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=xmU97g3yCSvowNV3dVLIyMyV2ifLrSyLIAewZEA5cDo=; b=YmCJ8AA8L7MefGnhbRnkLl5AlFTxAF1dTBD7KqlfXz0I/KlF89t6N5SWkg3k5Tg6Vz+R2tkG4I0BcuSDPsHX0UPFysQbcxGavxOkgBBSE2KgUtAJW65pA2b+Hs4TsB3ulusiV5uE1GSYPCgWINwXoKqCnlXBcIZZBsKIeciJWJE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1615376618383556.0314016237329; Wed, 10 Mar 2021 03:43:38 -0800 (PST) Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-25-uNV9cVMDMXW5EmsGyeFE4A-1; Wed, 10 Mar 2021 06:43:34 -0500 Received: by mail-ed1-f71.google.com with SMTP id k8so8201348edn.19 for ; Wed, 10 Mar 2021 03:43:34 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (68.red-83-57-175.dynamicip.rima-tde.net. [83.57.175.68]) by smtp.gmail.com with ESMTPSA id t15sm11296255edc.34.2021.03.10.03.43.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Mar 2021 03:43:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615376617; 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: in-reply-to:in-reply-to:references:references; bh=xmU97g3yCSvowNV3dVLIyMyV2ifLrSyLIAewZEA5cDo=; b=DtiT2TRaHDWyvqh2cVU+L3sU2ideIALoy8BZoALrGKG3YV33LHCmznOlVQpV/BeyXJFddB 9+csHCeLU8SEE6OvsyNjQ7cpHcNnDI0PGDxLYb6Nqv9Bq5jCUNraRqcTfxMfMxXPf7u2E0 kLzLaf9ZjlzcJOFLiwX30nQp5IhHHY8= X-MC-Unique: uNV9cVMDMXW5EmsGyeFE4A-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:in-reply-to :references:mime-version:content-transfer-encoding; bh=xmU97g3yCSvowNV3dVLIyMyV2ifLrSyLIAewZEA5cDo=; b=YNZdTTJn6cZlbcTLfgXytGs/leIloW0Q3MHIKcgm6/0B59kogZmzWDQgNHhJAN99sP dN5aEby4BWN8lmrCBhGjBDpRK7g4XGpwF0DqgAjdxaLznOLJByleixfkqDfC6NLZzi3/ 51dghGSqWyDUfuZZtVqtkQpjkqD5cvkpGX6nrhsHkp5jTYmMIHeY6vfnohvoa9vpcIcR 9pox6BSFS18N81ZfHAR/sj/VKo4X4i9GWNKMfXkLPFrryikV22DON18gj2YBpGlc2FHb lLla+ydNVqgWIllAzLQNQ9/nMRPUJZu40Se6D7TT3KRnVtFHyNzo6CMRga5b3EXTUtG3 R24A== X-Gm-Message-State: AOAM531K+jvq5wC9FCJg/U/NnE6jWjmLOMHzqeLQ3g/+JjjE6k7AYcLZ fnlHPhb2Mvwde8vetmHxQSQm0mfvSGBAVbPWmm5WS3cdb8Y18LtwJur+xt0FOim5b/s9+bECgqR 5YZOXYfE8PvbKfg== X-Received: by 2002:a17:906:29c3:: with SMTP id y3mr3070646eje.430.1615376613012; Wed, 10 Mar 2021 03:43:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJwIakCl/er47hJdGlBH5tYMCMBi3Kecazf8CS4Z+rX+TsCtQD1HN9tmsIfqxlL0902RNzHT0w== X-Received: by 2002:a17:906:29c3:: with SMTP id y3mr3070642eje.430.1615376612904; Wed, 10 Mar 2021 03:43:32 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Fam Zheng , Markus Armbruster , qemu-block@nongnu.org, Vladimir Sementsov-Ogievskiy , Kevin Wolf , Max Reitz , Prasad J Pandit , Bandan Das , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 3/3] docs/secure-coding-practices: Describe null-co/zeroes-co block drivers Date: Wed, 10 Mar 2021 12:43:14 +0100 Message-Id: <20210310114314.1068957-4-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210310114314.1068957-1-philmd@redhat.com> References: <20210310114314.1068957-1-philmd@redhat.com> 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 X-ZohoMail-DKIM: pass (identity @redhat.com) Document that security reports must not use the 'null-co' block driver, as it leaves memory uninitialized on purposed (this is a performance feature). Reports must be send using the 'zeroes-co' driver. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- docs/devel/secure-coding-practices.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/devel/secure-coding-practices.rst b/docs/devel/secure-cod= ing-practices.rst index cbfc8af67e6..64d61085804 100644 --- a/docs/devel/secure-coding-practices.rst +++ b/docs/devel/secure-coding-practices.rst @@ -104,3 +104,10 @@ 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 / zeroes-co block drivers +---------------------------------------- + +When reporting security issues, the null-co block driver must not be used, +as it is designed for performance and its read accesses are not initialize= d. +The zeroes-co block driver must be used instead. --=20 2.26.2