Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6:
pci: use security_capable() when checking capablities during config space read
security: add cred argument to security_capable()
tpm_tis: Use timeouts returned from TPM

+29 -11
+16 -2
drivers/char/tpm/tpm.c
··· 577 577 if (rc) 578 578 return; 579 579 580 - if (be32_to_cpu(tpm_cmd.header.out.return_code) 581 - != 3 * sizeof(u32)) 580 + if (be32_to_cpu(tpm_cmd.header.out.return_code) != 0 || 581 + be32_to_cpu(tpm_cmd.header.out.length) 582 + != sizeof(tpm_cmd.header.out) + sizeof(u32) + 3 * sizeof(u32)) 582 583 return; 584 + 583 585 duration_cap = &tpm_cmd.params.getcap_out.cap.duration; 584 586 chip->vendor.duration[TPM_SHORT] = 585 587 usecs_to_jiffies(be32_to_cpu(duration_cap->tpm_short)); ··· 940 938 return str - buf; 941 939 } 942 940 EXPORT_SYMBOL_GPL(tpm_show_caps_1_2); 941 + 942 + ssize_t tpm_show_timeouts(struct device *dev, struct device_attribute *attr, 943 + char *buf) 944 + { 945 + struct tpm_chip *chip = dev_get_drvdata(dev); 946 + 947 + return sprintf(buf, "%d %d %d\n", 948 + jiffies_to_usecs(chip->vendor.duration[TPM_SHORT]), 949 + jiffies_to_usecs(chip->vendor.duration[TPM_MEDIUM]), 950 + jiffies_to_usecs(chip->vendor.duration[TPM_LONG])); 951 + } 952 + EXPORT_SYMBOL_GPL(tpm_show_timeouts); 943 953 944 954 ssize_t tpm_store_cancel(struct device *dev, struct device_attribute *attr, 945 955 const char *buf, size_t count)
+2
drivers/char/tpm/tpm.h
··· 56 56 char *); 57 57 extern ssize_t tpm_show_temp_deactivated(struct device *, 58 58 struct device_attribute *attr, char *); 59 + extern ssize_t tpm_show_timeouts(struct device *, 60 + struct device_attribute *attr, char *); 59 61 60 62 struct tpm_chip; 61 63
+3 -1
drivers/char/tpm/tpm_tis.c
··· 376 376 NULL); 377 377 static DEVICE_ATTR(caps, S_IRUGO, tpm_show_caps_1_2, NULL); 378 378 static DEVICE_ATTR(cancel, S_IWUSR | S_IWGRP, NULL, tpm_store_cancel); 379 + static DEVICE_ATTR(timeouts, S_IRUGO, tpm_show_timeouts, NULL); 379 380 380 381 static struct attribute *tis_attrs[] = { 381 382 &dev_attr_pubek.attr, ··· 386 385 &dev_attr_owned.attr, 387 386 &dev_attr_temp_deactivated.attr, 388 387 &dev_attr_caps.attr, 389 - &dev_attr_cancel.attr, NULL, 388 + &dev_attr_cancel.attr, 389 + &dev_attr_timeouts.attr, NULL, 390 390 }; 391 391 392 392 static struct attribute_group tis_attr_grp = {
+2 -1
drivers/pci/pci-sysfs.c
··· 23 23 #include <linux/mm.h> 24 24 #include <linux/fs.h> 25 25 #include <linux/capability.h> 26 + #include <linux/security.h> 26 27 #include <linux/pci-aspm.h> 27 28 #include <linux/slab.h> 28 29 #include "pci.h" ··· 369 368 u8 *data = (u8*) buf; 370 369 371 370 /* Several chips lock up trying to read undefined config space */ 372 - if (cap_raised(filp->f_cred->cap_effective, CAP_SYS_ADMIN)) { 371 + if (security_capable(filp->f_cred, CAP_SYS_ADMIN)) { 373 372 size = dev->cfg_size; 374 373 } else if (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS) { 375 374 size = 128;
+3 -3
include/linux/security.h
··· 1662 1662 const kernel_cap_t *effective, 1663 1663 const kernel_cap_t *inheritable, 1664 1664 const kernel_cap_t *permitted); 1665 - int security_capable(int cap); 1665 + int security_capable(const struct cred *cred, int cap); 1666 1666 int security_real_capable(struct task_struct *tsk, int cap); 1667 1667 int security_real_capable_noaudit(struct task_struct *tsk, int cap); 1668 1668 int security_sysctl(struct ctl_table *table, int op); ··· 1856 1856 return cap_capset(new, old, effective, inheritable, permitted); 1857 1857 } 1858 1858 1859 - static inline int security_capable(int cap) 1859 + static inline int security_capable(const struct cred *cred, int cap) 1860 1860 { 1861 - return cap_capable(current, current_cred(), cap, SECURITY_CAP_AUDIT); 1861 + return cap_capable(current, cred, cap, SECURITY_CAP_AUDIT); 1862 1862 } 1863 1863 1864 1864 static inline int security_real_capable(struct task_struct *tsk, int cap)
+1 -1
kernel/capability.c
··· 306 306 BUG(); 307 307 } 308 308 309 - if (security_capable(cap) == 0) { 309 + if (security_capable(current_cred(), cap) == 0) { 310 310 current->flags |= PF_SUPERPRIV; 311 311 return 1; 312 312 }
+2 -3
security/security.c
··· 154 154 effective, inheritable, permitted); 155 155 } 156 156 157 - int security_capable(int cap) 157 + int security_capable(const struct cred *cred, int cap) 158 158 { 159 - return security_ops->capable(current, current_cred(), cap, 160 - SECURITY_CAP_AUDIT); 159 + return security_ops->capable(current, cred, cap, SECURITY_CAP_AUDIT); 161 160 } 162 161 163 162 int security_real_capable(struct task_struct *tsk, int cap)