diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-02-13 10:50:50 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-02-13 10:50:50 -0500 |
commit | f00eaeea7a42b5ea327e9ce8839cb0b53d3bdb4e (patch) | |
tree | 9c87581db9131af941027f34f7504c61e632d392 /drivers/pci | |
parent | a0dc00b430b7f515904aa6dd62296b577e94c7aa (diff) |
Revert "pci: use security_capable() when checking capablities during config space read"
This reverts commit 47970b1b2aa64464bc0a9543e86361a622ae7c03.
It turns out it breaks several distributions. Looks like the stricter
selinux checks fail due to selinux policies not being set to allow the
access - breaking X, but also lspci.
So while the change was clearly the RightThing(tm) to do in theory, in
practice we have backwards compatibility issues making it not work.
Reported-by: Dave Young <hidave.darkstar@gmail.com>
Acked-by: David Airlie <airlied@linux.ie>
Acked-by: Alex Riesen <raa.lkml@gmail.com>
Cc: Eric Paris <eparis@redhat.com>
Cc: Chris Wright <chrisw@sous-sol.org>
Cc: James Morris <jmorris@namei.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/pci-sysfs.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c index f7771f336b7d..8ecaac983923 100644 --- a/drivers/pci/pci-sysfs.c +++ b/drivers/pci/pci-sysfs.c | |||
@@ -23,7 +23,6 @@ | |||
23 | #include <linux/mm.h> | 23 | #include <linux/mm.h> |
24 | #include <linux/fs.h> | 24 | #include <linux/fs.h> |
25 | #include <linux/capability.h> | 25 | #include <linux/capability.h> |
26 | #include <linux/security.h> | ||
27 | #include <linux/pci-aspm.h> | 26 | #include <linux/pci-aspm.h> |
28 | #include <linux/slab.h> | 27 | #include <linux/slab.h> |
29 | #include "pci.h" | 28 | #include "pci.h" |
@@ -369,7 +368,7 @@ pci_read_config(struct file *filp, struct kobject *kobj, | |||
369 | u8 *data = (u8*) buf; | 368 | u8 *data = (u8*) buf; |
370 | 369 | ||
371 | /* Several chips lock up trying to read undefined config space */ | 370 | /* Several chips lock up trying to read undefined config space */ |
372 | if (security_capable(filp->f_cred, CAP_SYS_ADMIN)) { | 371 | if (cap_raised(filp->f_cred->cap_effective, CAP_SYS_ADMIN)) { |
373 | size = dev->cfg_size; | 372 | size = dev->cfg_size; |
374 | } else if (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS) { | 373 | } else if (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS) { |
375 | size = 128; | 374 | size = 128; |