From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 97E4CC433DB for ; Wed, 10 Mar 2021 12:34:05 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 237D964FE3 for ; Wed, 10 Mar 2021 12:34:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 237D964FE3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:50276 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJy2O-00010S-5V for qemu-devel@archiver.kernel.org; Wed, 10 Mar 2021 07:34:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36188) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJy1S-00006j-Si; Wed, 10 Mar 2021 07:33:06 -0500 Received: from mail-lf1-x142.google.com ([2a00:1450:4864:20::142]:37460) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lJy1R-00088N-22; Wed, 10 Mar 2021 07:33:06 -0500 Received: by mail-lf1-x142.google.com with SMTP id n16so33182382lfb.4; Wed, 10 Mar 2021 04:33:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jPUpRn0F6/k/OsOOeiNMtE1/tySRxUWTl0ra42QnME8=; b=ZIIDxpoMVx5ww7zDIwk2jINRYRTDlbrmNmIASV17WvaNhwNZlbcMl+mD+9U4YU9VDw nEENQVOckX/JdvNZzgJ75agv3N6xjA3CPuPrE6cFIvUD71u1Uju3yZ9ORO26iPtJ8CND nqYKUI7ZtBly8mpBt91w0+75rej2KqYdTt89bQD1bhVHrKslGh5aNYJ3EA75Srubrufh 2syepSTD20LGY2zF+fEQ2mxcXnXE0nIc4Xd5sDqmnwLFK1l9UEz2iCuNaoh6VmDPSQJa YMM1600/k0iJ0Y/pfIkUOE8E9g2TLCYdKXDuLC4VOaJK2k2jCKRBFywimoXzwMAEofsS G1RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jPUpRn0F6/k/OsOOeiNMtE1/tySRxUWTl0ra42QnME8=; b=NyZnR1kLDrQ9FokMbDNITPt/ZFxxIGM5G2JXCsn1HST2Lqd44+fzonKsanuW32g4h/ 3aJcGvdDnAEm1kTySEzkyTpfG3m26eIce2GDJq3giw2WyjBfedgP+t+c85hWEWBqIx4P KuoYTnO486M/6UAv2D0pdv6Jk/FxXd/IqfpklP8HPTxls1kF8dLD+ho1tNz4XG+WSHgU 5E77sHQZ/GQ+/+VOa5Bsqgdu3P1Te28b/xgddUuCqbWwSsACj6jvLnvuPpwvRK54WNOp 5HDBJkdKR7TZDmjJfhe2D8sDOMVf2zA85mCa6Guj3vgXd+2L+/ppDxbREMPn7JKy9xlA ywGg== X-Gm-Message-State: AOAM531pEeMHEO8+NQgvpLTI+FKBqCf9hKLK8lcKvJVZz/wEZqLwgLKT UqGOmQ6IxKwNVyJgWrdRU8JqzOKms3gdzDw3C1Q= X-Google-Smtp-Source: ABdhPJyLboMzCB02+uU/WOHrxOYJn8mwug+odI5uVsfYff5KEhxuOAC7hz5hEzdK/pDpPFx/lTAWgIkOpYjtVUaOxgk= X-Received: by 2002:ac2:46db:: with SMTP id p27mr1913234lfo.396.1615379581948; Wed, 10 Mar 2021 04:33:01 -0800 (PST) MIME-Version: 1.0 References: <20210310114314.1068957-1-philmd@redhat.com> In-Reply-To: <20210310114314.1068957-1-philmd@redhat.com> From: Fam Zheng Date: Wed, 10 Mar 2021 12:32:51 +0000 Message-ID: Subject: Re: [PATCH 0/3] block: Introduce the 'zeroes-co' driver to help security reports To: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= Content-Type: multipart/alternative; boundary="00000000000028d74905bd2ddeca" Received-SPF: pass client-ip=2a00:1450:4864:20::142; envelope-from=famforupstream@gmail.com; helo=mail-lf1-x142.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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: Fam Zheng , Kevin Wolf , Vladimir Sementsov-Ogievskiy , qemu-block@nongnu.org, qemu-devel@nongnu.org, Markus Armbruster , Prasad J Pandit , Bandan Das , Max Reitz Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" --00000000000028d74905bd2ddeca Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 10 Mar 2021 at 11:44, Philippe Mathieu-Daud=C3=A9 wrote: > Hi, > > This is an alternative approach to changing null-co driver > default 'read-zeroes' option to true: > https://www.mail-archive.com/qemu-block@nongnu.org/msg80873.html > > Instead we introduce yet another block driver with an explicit > name: 'zeroes-co'. We then clarify in secure-coding-practices.rst > that security reports have to be sent using this new driver. > > The 2nd patch is RFC because I won't spend time converting the > tests until the first patch is discussed, as I already spent enough > time doing that in the previous mentioned series. > > Regards, > > Phil. > > Philippe Mathieu-Daud=C3=A9 (3): > block: Introduce the 'zeroes-co' driver > tests/test-blockjob: Use zeroes-co instead of null-co,read-zeroes=3Don > docs/secure-coding-practices: Describe null-co/zeroes-co block drivers > > docs/devel/secure-coding-practices.rst | 7 + > block/zeroes.c | 306 +++++++++++++++++++++++++ > Why not add another BlockDriver struct to block/null.c and set the read_zeroes field in the .bdrv_file_open callback? It would make the patch much simpler. Fam > tests/test-blockjob.c | 4 +- > block/meson.build | 1 + > 4 files changed, 315 insertions(+), 3 deletions(-) > create mode 100644 block/zeroes.c > > -- > 2.26.2 > > > > --00000000000028d74905bd2ddeca Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Wed, 10 Mar 2021 at 11:44, Philipp= e Mathieu-Daud=C3=A9 <philmd@redhat= .com> wrote:
Hi,

This is an alternative approach to changing null-co driver
default 'read-zeroes' option to true:
https://www.mail-archive.com/qemu-bl= ock@nongnu.org/msg80873.html

Instead we introduce yet another block driver with an explicit
name: 'zeroes-co'. We then clarify in secure-coding-practices.rst that security reports have to be sent using this new driver.

The 2nd patch is RFC because I won't spend time converting the
tests until the first patch is discussed, as I already spent enough
time doing that in the previous mentioned series.

Regards,

Phil.

Philippe Mathieu-Daud=C3=A9 (3):
=C2=A0 block: Introduce the 'zeroes-co' driver
=C2=A0 tests/test-blockjob: Use zeroes-co instead of null-co,read-zeroes=3D= on
=C2=A0 docs/secure-coding-practices: Describe null-co/zeroes-co block drive= rs

=C2=A0docs/devel/secure-coding-practices.rst |=C2=A0 =C2=A07 +
=C2=A0block/zeroes.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| 306 +++++++++++++++++++++++++


Why not add another BlockDriver = struct to block/null.c and set the read_zeroes field in the .bdrv_file_open= callback? It would make the patch much simpler.

Fam<= br>
=C2=A0