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-next>] [day] [month] [year] [list]
Message-Id: <1549875840-10582-1-git-send-email-wen.yang99@zte.com.cn>
Date:   Mon, 11 Feb 2019 17:04:00 +0800
From:   Wen Yang <wen.yang99@....com.cn>
To:     kishon@...com
Cc:     lorenzo.pieralisi@....com, bhelgaas@...gle.com,
        gustavo.pimentel@...opsys.com, niklas.cassel@...s.com,
        baijiaju1990@...il.com, linux-pci@...r.kernel.org,
        linux-kernel@...r.kernel.org, xue.zhihong@....com.cn,
        wang.yi59@....com.cn, Wen Yang <wen.yang99@....com.cn>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Cyrille Pitchen <cyrille.pitchen@...e-electrons.com>
Subject: [PATCH] PCI: endpoint: functions: use memcpy_fromio()/memcpy_toio()

Use the IO memcpy() functions when copying from/to IO memory.
These locations were found via sparse.

Signed-off-by: Wen Yang <wen.yang99@....com.cn>
Suggested-by: Kishon Vijay Abraham I <kishon@...com>
CC: Lorenzo Pieralisi <lorenzo.pieralisi@....com>
CC: Bjorn Helgaas <bhelgaas@...gle.com>
CC: Gustavo Pimentel <gustavo.pimentel@...opsys.com>
CC: Niklas Cassel <niklas.cassel@...s.com>
CC: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
CC: Cyrille Pitchen <cyrille.pitchen@...e-electrons.com>
CC: linux-pci@...r.kernel.org
CC: linux-kernel@...r.kernel.org
---
 drivers/pci/endpoint/functions/pci-epf-test.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c
index 3e86fa3..4bbd26e 100644
--- a/drivers/pci/endpoint/functions/pci-epf-test.c
+++ b/drivers/pci/endpoint/functions/pci-epf-test.c
@@ -175,7 +175,7 @@ static int pci_epf_test_read(struct pci_epf_test *epf_test)
 		goto err_map_addr;
 	}
 
-	memcpy(buf, src_addr, reg->size);
+	memcpy_fromio(buf, src_addr, reg->size);
 
 	crc32 = crc32_le(~0, buf, reg->size);
 	if (crc32 != reg->checksum)
@@ -230,7 +230,7 @@ static int pci_epf_test_write(struct pci_epf_test *epf_test)
 	get_random_bytes(buf, reg->size);
 	reg->checksum = crc32_le(~0, buf, reg->size);
 
-	memcpy(dst_addr, buf, reg->size);
+	memcpy_toio(dst_addr, buf, reg->size);
 
 	/*
 	 * wait 1ms inorder for the write to complete. Without this delay L3
-- 
2.9.5

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ