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]
Message-ID: <20061017145403.GK22289@parisc-linux.org>
Date:	Tue, 17 Oct 2006 08:54:04 -0600
From:	Matthew Wilcox <matthew@....cx>
To:	linux-pci@...ey.karlin.mff.cuni.cz, linux-pm@...ts.osdl.org,
	linux-kernel@...r.kernel.org
Cc:	Alan Cox <alan@...rguk.ukuu.org.uk>, Greg KH <greg@...ah.com>,
	Adam Belay <abelay@....EDU>
Subject: Re: [PATCH] Block on access to temporarily unavailable pci device

On Tue, Oct 17, 2006 at 08:51:46AM -0600, Matthew Wilcox wrote:
> I'll post the patch I used to test blocking device accesses separately.

Here it is.  Not for applying.

Nacked-by: Matthew Wilcox <matthew@....cx>

diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index a1d2e97..267bf76 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -175,6 +175,20 @@ msi_bus_store(struct device *dev, struct
 	return count;
 }
 
+static ssize_t
+block_store(struct device *dev, struct device_attribute *attr,
+	      const char *buf, size_t count)
+{
+	struct pci_dev *pdev = to_pci_dev(dev);
+
+	if (*buf == '0')
+		pci_unblock_user_cfg_access(pdev);
+	else if (*buf == '1')
+		pci_block_user_cfg_access(pdev);
+
+	return count;
+}
+
 struct device_attribute pci_dev_attrs[] = {
 	__ATTR_RO(resource),
 	__ATTR_RO(vendor),
@@ -189,6 +203,7 @@ struct device_attribute pci_dev_attrs[] 
 	__ATTR(broken_parity_status,(S_IRUGO|S_IWUSR),
 		broken_parity_status_show,broken_parity_status_store),
 	__ATTR(msi_bus, 0644, msi_bus_show, msi_bus_store),
+	__ATTR(block, 0200, NULL, block_store),
 	__ATTR_NULL,
 };
 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ