[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 05/10] block/null: Mark 'read-zeroes=off' option as unsafe
From: |
Philippe Mathieu-Daudé |
Subject: |
[RFC PATCH 05/10] block/null: Mark 'read-zeroes=off' option as unsafe |
Date: |
Thu, 9 Sep 2021 01:20:19 +0200 |
See commit b317006a3f1 ("docs/secure-coding-practices: Describe how
to use 'null-co' block driver") for rationale.
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
block/null.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/block/null.c b/block/null.c
index cc9b1d4ea72..11e428f3cc2 100644
--- a/block/null.c
+++ b/block/null.c
@@ -99,6 +99,13 @@ static int null_file_open(BlockDriverState *bs, QDict
*options, int flags,
return ret;
}
+static bool null_taints_security_policy(BlockDriverState *bs)
+{
+ BDRVNullState *s = bs->opaque;
+
+ return !s->read_zeroes;
+}
+
static int64_t null_getlength(BlockDriverState *bs)
{
BDRVNullState *s = bs->opaque;
@@ -283,6 +290,7 @@ static BlockDriver bdrv_null_co = {
.bdrv_parse_filename = null_co_parse_filename,
.bdrv_getlength = null_getlength,
.bdrv_get_allocated_file_size = null_allocated_file_size,
+ .bdrv_taints_security_policy = null_taints_security_policy,
.bdrv_co_preadv = null_co_preadv,
.bdrv_co_pwritev = null_co_pwritev,
--
2.31.1
- Re: [RFC PATCH 01/10] sysemu: Introduce qemu_security_policy_taint() API, (continued)
- [RFC PATCH 02/10] accel: Use qemu_security_policy_taint(), mark KVM and Xen as safe, Philippe Mathieu-Daudé, 2021/09/08
- [RFC PATCH 03/10] block: Use qemu_security_policy_taint() API, Philippe Mathieu-Daudé, 2021/09/08
- [RFC PATCH 04/10] block/vvfat: Mark the driver as unsafe, Philippe Mathieu-Daudé, 2021/09/08
- [RFC PATCH 05/10] block/null: Mark 'read-zeroes=off' option as unsafe,
Philippe Mathieu-Daudé <=
- [RFC PATCH 06/10] qdev: Use qemu_security_policy_taint() API, Philippe Mathieu-Daudé, 2021/09/08
- [RFC PATCH 07/10] hw/display: Mark ATI and Artist devices as unsafe, Philippe Mathieu-Daudé, 2021/09/08
- [RFC PATCH 08/10] hw/misc: Mark testdev devices as unsafe, Philippe Mathieu-Daudé, 2021/09/08
- [RFC PATCH 09/10] hw/net: Mark Tulip device as unsafe, Philippe Mathieu-Daudé, 2021/09/08
- [RFC PATCH 10/10] hw/sd: Mark sdhci-pci device as unsafe, Philippe Mathieu-Daudé, 2021/09/08
- Re: [RFC PATCH 00/10] security: Introduce qemu_security_policy_taint() API, Daniel P . Berrangé, 2021/09/09