From nobody Sat May 4 02:24:54 2024 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=1622525787; cv=none; d=zohomail.com; s=zohoarc; b=avlas9Iho5i+jP8PoDOaNyVRwuGsjcSdnVtuN3SeXL9AV/4CsDPN3wncq5F2fgfluexCCObI8kzXoncIXN5adVGcjkLvqTTBkV9cLUa6kpr7uE15Tp5lRwtz85iMn75mr0FacYIM4XyBurkMNyTUJKAbgE9tSAufHjY1xnDEeKI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622525787; 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=ciPhEuln0EveL7CrYSSUGf88omRcmR1D8eT41mVjqbg=; b=X98YzUnOdvJGGBjifmpmcCZyMgNVcnp76YZPjr4iQkkFJ3pVr8e2jdaurT8SN4l2u5/8hULeWUPBo8AoWqVfEr8B4IbyU/gDTvLt58WxNVmyIZZ7awXmqkkVmGrT/kE1cG7QAGmmNqe3Pr/AwsoMNffinhI2xM/4TmxOJvoI7yc= 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 162252578722527.470824500247204; Mon, 31 May 2021 22:36:27 -0700 (PDT) Received: from localhost ([::1]:51898 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lnx4j-00031L-Va for importer2@patchew.org; Tue, 01 Jun 2021 01:36:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53990) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lnx3k-00029F-Vt for qemu-devel@nongnu.org; Tue, 01 Jun 2021 01:35:25 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:48821) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lnx3j-0002Ct-GZ for qemu-devel@nongnu.org; Tue, 01 Jun 2021 01:35:24 -0400 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-241-SkAbP4OQNgq0EvkAfXG8Ow-1; Tue, 01 Jun 2021 01:35:07 -0400 Received: by mail-wm1-f72.google.com with SMTP id n2-20020a05600c4f82b0290181c444b9f1so2392734wmq.6 for ; Mon, 31 May 2021 22:35:06 -0700 (PDT) Received: from localhost.localdomain (235.red-83-57-168.dynamicip.rima-tde.net. [83.57.168.235]) by smtp.gmail.com with ESMTPSA id s8sm2198455wrr.36.2021.05.31.22.35.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 May 2021 22:35:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622525723; 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=ciPhEuln0EveL7CrYSSUGf88omRcmR1D8eT41mVjqbg=; b=eIkFni2xHCHOfbP4HfSpoV7oxMPJiCVcvJp+nOeln53dBeII1kQ57eXLomjKvLtl0gJouX lBMFB6e0L/RJxQ2FLlHNXKAwS0P0v6upmwwy/LYj65uDs3CY+CB27WzrdggtiaePypxgDL gcHaXVehOjrixiTbg5KIuJlMNQRJRu8= X-MC-Unique: SkAbP4OQNgq0EvkAfXG8Ow-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=ciPhEuln0EveL7CrYSSUGf88omRcmR1D8eT41mVjqbg=; b=OLjqgYupIh1ZL5/MdVpgr43N393RyzdzsgAVG7HENLg+YZyIAUDeps2s1MpqD7hDbX Q2GXr1XjBV8ldsESyk/YDT5lDkcqVbkfMaqDI6BhMQFbdojk4faWIwSWIv0uZSskgSdo A25IBb6DhGNeT902/JwrcNF3JSdxIyOcLQx5LxN9OZmzrkqeOvoNLo4K/PQGPcjxtaLw G8SCxGC1OvDkKW+lOmTQpgTvWkh+MaroTnqRB48MkWQniXSWu6HwRVDVbZmXrxAHmvcY tZn17jpUhUmASDtZi1CaMFI/qs+i+MyVkiFA5bi1f+3EsCbdXnHp3Kmi0vJxb/9L4U2w lZzg== X-Gm-Message-State: AOAM530dHlC8Ei5DRytdDipjNIKBQMR8KtR+PqC/vJLQXMbhQ+KJwrEV /BqzGjx0GLla6si7gt8hlJ9OH5cc+GIctl3MDUw4Uz5VPvGqlOGmFQjp/zEh2PAZzgirQyhrOSf ZxrhTOh7AnF3ETEc= X-Received: by 2002:adf:e307:: with SMTP id b7mr26236082wrj.325.1622525705960; Mon, 31 May 2021 22:35:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGF+HvS1B9yBDiIH8jVLvpeIHKfOvlvbiKkldjTZ+Dj0OQIZntSc+753QqmD0/nvMRQhtifw== X-Received: by 2002:adf:e307:: with SMTP id b7mr26236050wrj.325.1622525705791; Mon, 31 May 2021 22:35:05 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Fam Zheng , qemu-devel@nongnu.org, Vladimir Sementsov-Ogievskiy Subject: [PATCH v3] docs/secure-coding-practices: Describe how to use 'null-co' block driver Date: Tue, 1 Jun 2021 07:35:03 +0200 Message-Id: <20210601053503.1828319-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.372, 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). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Vladimir Sementsov-Ogievskiy --- 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..79a3dcd09a3 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 it this driver has to be used for secu= rity +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