From 8a3f4de7aa7dbd01d59bca75f0ba855cb6189de9 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sun, 13 Feb 2011 07:50:50 -0800 Subject: [PATCH] Revert "pci: use security_capable() when checking capablities during config space read" This reverts commit b8c41aba50c78a0a8b876f6c5529b7749a427bc0. 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 Acked-by: David Airlie Acked-by: Alex Riesen Cc: Eric Paris Cc: Chris Wright Cc: James Morris Signed-off-by: Linus Torvalds --- drivers/pci/pci-sysfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c index f7771f336b7d0..8ecaac983923d 100644 --- a/drivers/pci/pci-sysfs.c +++ b/drivers/pci/pci-sysfs.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include "pci.h" @@ -369,7 +368,7 @@ pci_read_config(struct file *filp, struct kobject *kobj, u8 *data = (u8*) buf; /* Several chips lock up trying to read undefined config space */ - if (security_capable(filp->f_cred, CAP_SYS_ADMIN)) { + if (cap_raised(filp->f_cred->cap_effective, CAP_SYS_ADMIN)) { size = dev->cfg_size; } else if (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS) { size = 128; -- 2.39.5