From nobody Sun May 19 22:21:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1622564754; cv=none; d=zohomail.com; s=zohoarc; b=PLGbLXig+59uQWf0iKkG3SbZ+AtM26LORQr8fBIrltdShzhTZhBi6HQx/UnIuEu6a/RuvVxrN2VRzKmwLj2KXsJgTKhKdW8dqpsGWsfmeNnecW/98OhSX3xF6lNd5jEsGr8QIYjsa9o58DNYKgFFTxVQPrcdeaomlnfTkpv2Fs4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622564754; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:MIME-Version:Message-ID:Subject:To; bh=kbemtu5SuRmZUgikT9P1lOnHb3c8k3upALUhB55ylRo=; b=Zg0D0ZysLpn+ZFaakKPgAYNvISzhpcPJocOgF15ieLkJ8Kt/C6OWAuwW6q5lp81nswmxifFWZgYgfPgF2DBItNiluYskAb1pwhvo/jbTo247t+P2VoefDFvudmBWrujSrfzgBb0IP4ehFg4cjl28hgM/bT7hd3rcFGDKJZqGRWc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.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 [170.10.133.124]) by mx.zohomail.com with SMTPS id 1622564754010159.60877889213646; Tue, 1 Jun 2021 09:25:54 -0700 (PDT) Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-562-jhQiX-OuMUmm5a7WolKq7g-1; Tue, 01 Jun 2021 12:25:51 -0400 Received: by mail-ed1-f69.google.com with SMTP id cn20-20020a0564020cb4b029038d0b0e183fso617799edb.22 for ; Tue, 01 Jun 2021 09:25:51 -0700 (PDT) Return-Path: Return-Path: 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=1622564753; 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=Ggz8rDUIUpFASCNzG3L4dkalnInjX6qFywgZauv1LNqk9VB+/6Q+d8qOAOnSrjPe1M7H/O oef2wYGeHi9mGsW37qDj6ACe6W9u/4z/uaRREzco9izril2KpIOplHLWZt+164S1ugoi80 acdHRDNUIvzo7L9HiFUrZo5bmfAu6f4= X-MC-Unique: jhQiX-OuMUmm5a7WolKq7g-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=McKwjH7Mm0sFRcAhXQr8HeoNBJIsdviNPDCIzScsniCehjZEa7a7p3NJ1OKfiftMX7 dduThXHu7mZXJNJkTqAcUs+8m77Igq3CwTSu2nEeGgdAv5yIaSzUBt12x2LE2flQi6J1 31jOb07//RflCgdyFMXCDBVunyKtGoUuk11ZqeJGKGI8VKd6b27sleKNBzA1lB+mSbMA kiEm9vpwTbRCoc7qZu/XfEi0/wxFujjITiS68572OVkqyV+iYeQmJZOFNgy0ZSQ/aNnL P6talGiox+YMnad4Agaq543S9ExTYi77G1bFNyZvpYVtPyVyfmiYWn0d9Xh377/uuDMr sk4A== X-Gm-Message-State: AOAM531oHxZ1dEwXLHA3XLyOWjRFNWW9inDU0ACrGCttZ1gz8kUMHHue eAn1RmyB1aa/b530TO3Rkgv6bg1n/StLDI197p8f7/lsopWdAzcFRh89MHy0TIs+qX44dImoiP6 70K4j4X33qNsqng== X-Received: by 2002:aa7:cfc5:: with SMTP id r5mr22061934edy.319.1622564750218; 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 Cc: Kevin Wolf , Markus Armbruster , qemu-block@nongnu.org, Max Reitz , Prasad J Pandit , Bandan Das , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= 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 X-ZohoMail-DKIM: pass (identity @redhat.com) 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