lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 2 Feb 2018 04:47:54 +0200
From:   "Michael S. Tsirkin" <mst@...hat.com>
To:     Marc-André Lureau <marcandre.lureau@...hat.com>
Cc:     linux-kernel@...r.kernel.org, slp@...hat.com, bhe@...hat.com,
        somlo@....edu, xiaolong.ye@...el.com
Subject: Re: [PATCH v11 2/4] fw_cfg: do DMA read operation

On Thu, Feb 01, 2018 at 02:02:58PM +0100, Marc-André Lureau wrote:
> Modify fw_cfg_read_blob() to use DMA if the device supports it.
> Return errors, because the operation may fail.
> 
> The DMA operation is expected to run synchronously with today qemu,
> but the specification states that it may become async, so we run
> "control" field check in a loop for eventual changes.
> 
> We may want to switch all the *buf addresses to use only kmalloc'ed
> buffers (instead of using stack/image addresses with dma=false).
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@...hat.com>

This seems to cause no end of pain. I see no reason to keep
pushing this patch until it's all much more stable.

Something like the below would disable it temporarily.


commit 05054fca8b96900f6b54ab0056458f92b616d74c
Author: Michael S. Tsirkin <mst@...hat.com>
Date:   Fri Feb 2 04:29:59 2018 +0200

    fixup! fw_cfg: do DMA read operation

diff --git a/drivers/firmware/qemu_fw_cfg.c b/drivers/firmware/qemu_fw_cfg.c
index d86ad92..33e0256 100644
--- a/drivers/firmware/qemu_fw_cfg.c
+++ b/drivers/firmware/qemu_fw_cfg.c
@@ -41,6 +41,9 @@ MODULE_AUTHOR("Gabriel L. Somlo <somlo@....edu>");
 MODULE_DESCRIPTION("QEMU fw_cfg sysfs support");
 MODULE_LICENSE("GPL");
 
+/* enable DMA for all accesses */
+#define FW_CFG_DMA_READ_ENABLE 0
+
 /* selector key values for "well-known" fw_cfg entries */
 #define FW_CFG_SIGNATURE  0x00
 #define FW_CFG_ID         0x01
@@ -171,7 +174,7 @@ static ssize_t fw_cfg_read_blob(struct device *dev, u16 key,
 	}
 
 	mutex_lock(&fw_cfg_dev_lock);
-	if (dma && fw_cfg_dma_enabled()) {
+	if (FW_CFG_DMA_READ_ENABLE && dma && fw_cfg_dma_enabled()) {
 		if (pos == 0) {
 			ret = fw_cfg_dma_transfer(dev, buf, count, key << 16
 						  | FW_CFG_DMA_CTL_SELECT

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ