aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-04-14 15:00:21 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-04-14 15:56:09 -0400
commitab0fa82b2df96ddadb327ac39f26b5d80cb3d104 (patch)
tree087b6c1be81d9312d12011d4eee852a740b25f16
parent34dbbcdbf63360661ff7bda6c5f52f99ac515f92 (diff)
pci-sysfs: use proper file capability helper function
The PCI config access checked the file capabilities correctly, but used the itnernal security capability check rather than the helper function that is actually meant for that. The security_capable() has unusual return values and is not meant to be used elsewhere (the only other use is in the capability checking functions that we actually intend people to use, and this odd PCI usage really stood out when looking around the capability code. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/pci/pci-sysfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index e982010f0ed1..342b6918bbde 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -636,7 +636,7 @@ static ssize_t pci_read_config(struct file *filp, struct kobject *kobj,
636 u8 *data = (u8 *) buf; 636 u8 *data = (u8 *) buf;
637 637
638 /* Several chips lock up trying to read undefined config space */ 638 /* Several chips lock up trying to read undefined config space */
639 if (security_capable(filp->f_cred, &init_user_ns, CAP_SYS_ADMIN) == 0) 639 if (file_ns_capable(filp, &init_user_ns, CAP_SYS_ADMIN))
640 size = dev->cfg_size; 640 size = dev->cfg_size;
641 else if (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS) 641 else if (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)
642 size = 128; 642 size = 128;