Skip to content

Commit

Permalink
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/…
Browse files Browse the repository at this point in the history
…jmorris/linux-security

Pull security subsystem updates from James Morris:
 "Generally pretty quiet for this release. Highlights:

  Yama:
   - allow ptrace access for original parent after re-parenting

  TPM:
   - add documentation
   - many bugfixes & cleanups
   - define a generic open() method for ascii & bios measurements

  Integrity:
   - Harden against malformed xattrs

  SELinux:
   - bugfixes & cleanups

  Smack:
   - Remove unnecessary smack_known_invalid label
   - Do not apply star label in smack_setprocattr hook
   - parse mnt opts after privileges check (fixes unpriv DoS vuln)"

* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: (56 commits)
  Yama: allow access for the current ptrace parent
  tpm: adjust return value of tpm_read_log
  tpm: vtpm_proxy: conditionally call tpm_chip_unregister
  tpm: Fix handling of missing event log
  tpm: Check the bios_dir entry for NULL before accessing it
  tpm: return -ENODEV if np is not set
  tpm: cleanup of printk error messages
  tpm: replace of_find_node_by_name() with dev of_node property
  tpm: redefine read_log() to handle ACPI/OF at runtime
  tpm: fix the missing .owner in tpm_bios_measurements_ops
  tpm: have event log use the tpm_chip
  tpm: drop tpm1_chip_register(/unregister)
  tpm: replace dynamically allocated bios_dir with a static array
  tpm: replace symbolic permission with octal for securityfs files
  char: tpm: fix kerneldoc tpm2_unseal_trusted name typo
  tpm_tis: Allow tpm_tis to be bound using DT
  tpm, tpm_vtpm_proxy: add kdoc comments for VTPM_PROXY_IOC_NEW_DEV
  tpm: Only call pm_runtime_get_sync if device has a parent
  tpm: define a generic open() method for ascii & bios measurements
  Documentation: tpm: add the Physical TPM device tree binding documentation
  ...
  • Loading branch information
torvalds committed Dec 14, 2016
2 parents 0f1d6df + 50523a2 commit 683b96f
Show file tree
Hide file tree
Showing 43 changed files with 832 additions and 567 deletions.
41 changes: 41 additions & 0 deletions Documentation/devicetree/bindings/security/tpm/ibmvtpm.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
* Device Tree Bindings for IBM Virtual Trusted Platform Module(vtpm)

Required properties:

- compatible : property name that conveys the platform architecture
identifiers, as 'IBM,vtpm'
- device_type : specifies type of virtual device
- interrupts : property specifying the interrupt source number and
sense code associated with this virtual I/O Adapters
- ibm,my-drc-index : integer index for the connector between the device
and its parent - present only if Dynamic
Reconfiguration(DR) Connector is enabled
- ibm,#dma-address-cells: specifies the number of cells that are used to
encode the physical address field of dma-window
properties
- ibm,#dma-size-cells : specifies the number of cells that are used to
encode the size field of dma-window properties
- ibm,my-dma-window : specifies DMA window associated with this virtual
IOA
- ibm,loc-code : specifies the unique and persistent location code
associated with this virtual I/O Adapters
- linux,sml-base : 64-bit base address of the reserved memory allocated
for the firmware event log
- linux,sml-size : size of the memory allocated for the firmware event log

Example (IBM Virtual Trusted Platform Module)
---------------------------------------------

vtpm@30000003 {
ibm,#dma-size-cells = <0x2>;
compatible = "IBM,vtpm";
device_type = "IBM,vtpm";
ibm,my-drc-index = <0x30000003>;
ibm,#dma-address-cells = <0x2>;
linux,sml-base = <0xc60e 0x0>;
interrupts = <0xa0003 0x0>;
ibm,my-dma-window = <0x10000003 0x0 0x0 0x0 0x10000000>;
ibm,loc-code = "U8286.41A.10082DV-V3-C3";
reg = <0x30000003>;
linux,sml-size = <0xbce10200>;
};
21 changes: 21 additions & 0 deletions Documentation/devicetree/bindings/security/tpm/tpm-i2c.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
* Device Tree Bindings for I2C based Trusted Platform Module(TPM)

Required properties:

- compatible : 'manufacturer,model', eg. nuvoton,npct650
- label : human readable string describing the device, eg. "tpm"
- linux,sml-base : 64-bit base address of the reserved memory allocated for
the firmware event log
- linux,sml-size : size of the memory allocated for the firmware event log

Example (for OpenPower Systems with Nuvoton TPM 2.0 on I2C)
----------------------------------------------------------

tpm@57 {
reg = <0x57>;
label = "tpm";
compatible = "nuvoton,npct650", "nuvoton,npct601";
linux,sml-base = <0x7f 0xfd450000>;
linux,sml-size = <0x10000>;
status = "okay";
};
25 changes: 25 additions & 0 deletions Documentation/devicetree/bindings/security/tpm/tpm_tis_mmio.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Trusted Computing Group MMIO Trusted Platform Module

The TCG defines multi vendor standard for accessing a TPM chip, this
is the standard protocol defined to access the TPM via MMIO. Typically
this interface will be implemented over Intel's LPC bus.

Refer to the 'TCG PC Client Specific TPM Interface Specification (TIS)' TCG
publication for the specification.

Required properties:

- compatible: should contain a string below for the chip, followed by
"tcg,tpm-tis-mmio". Valid chip strings are:
* "atmel,at97sc3204"
- reg: The location of the MMIO registers, should be at least 0x5000 bytes
- interrupt-parent/interrupts: An optional interrupt indicating command completion.

Example:

tpm_tis@90000 {
compatible = "atmel,at97sc3204", "tcg,tpm-tis-mmio";
reg = <0x90000 0x5000>;
interrupt-parent = <&EIC0>;
interrupts = <1 2>;
};
2 changes: 0 additions & 2 deletions Documentation/security/keys-trusted-encrypted.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ Usage:
(40 ascii zeros)
blobauth= ascii hex auth for sealed data default 0x00...
(40 ascii zeros)
blobauth= ascii hex auth for sealed data default 0x00...
(40 ascii zeros)
pcrinfo= ascii hex of PCR_INFO or PCR_INFO_LONG (no default)
pcrlock= pcr number to be extended to "lock" blob
migratable= 0|1 indicating permission to reseal to new PCR values,
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/tpm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ config TCG_TIS_CORE

config TCG_TIS
tristate "TPM Interface Specification 1.2 Interface / TPM 2.0 FIFO Interface"
depends on X86
depends on X86 || OF
select TCG_TIS_CORE
---help---
If you have a TPM security chip that is compliant with the
Expand Down
14 changes: 4 additions & 10 deletions drivers/char/tpm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,10 @@
# Makefile for the kernel tpm device drivers.
#
obj-$(CONFIG_TCG_TPM) += tpm.o
tpm-y := tpm-interface.o tpm-dev.o tpm-sysfs.o tpm-chip.o tpm2-cmd.o
tpm-$(CONFIG_ACPI) += tpm_ppi.o

ifdef CONFIG_ACPI
tpm-y += tpm_eventlog.o tpm_acpi.o
else
ifdef CONFIG_TCG_IBMVTPM
tpm-y += tpm_eventlog.o tpm_of.o
endif
endif
tpm-y := tpm-interface.o tpm-dev.o tpm-sysfs.o tpm-chip.o tpm2-cmd.o \
tpm_eventlog.o
tpm-$(CONFIG_ACPI) += tpm_ppi.o tpm_acpi.o
tpm-$(CONFIG_OF) += tpm_of.o
obj-$(CONFIG_TCG_TIS_CORE) += tpm_tis_core.o
obj-$(CONFIG_TCG_TIS) += tpm_tis.o
obj-$(CONFIG_TCG_TIS_SPI) += tpm_tis_spi.o
Expand Down
38 changes: 7 additions & 31 deletions drivers/char/tpm/tpm-chip.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ static void tpm_dev_release(struct device *dev)
idr_remove(&dev_nums_idr, chip->dev_num);
mutex_unlock(&idr_lock);

kfree(chip->log.bios_event_log);
kfree(chip);
}

Expand Down Expand Up @@ -276,27 +277,6 @@ static void tpm_del_char_device(struct tpm_chip *chip)
up_write(&chip->ops_sem);
}

static int tpm1_chip_register(struct tpm_chip *chip)
{
if (chip->flags & TPM_CHIP_FLAG_TPM2)
return 0;

tpm_sysfs_add_device(chip);

chip->bios_dir = tpm_bios_log_setup(dev_name(&chip->dev));

return 0;
}

static void tpm1_chip_unregister(struct tpm_chip *chip)
{
if (chip->flags & TPM_CHIP_FLAG_TPM2)
return;

if (chip->bios_dir)
tpm_bios_log_teardown(chip->bios_dir);
}

static void tpm_del_legacy_sysfs(struct tpm_chip *chip)
{
struct attribute **i;
Expand Down Expand Up @@ -363,20 +343,20 @@ int tpm_chip_register(struct tpm_chip *chip)
return rc;
}

rc = tpm1_chip_register(chip);
if (rc)
tpm_sysfs_add_device(chip);

rc = tpm_bios_log_setup(chip);
if (rc != 0 && rc != -ENODEV)
return rc;

tpm_add_ppi(chip);

rc = tpm_add_char_device(chip);
if (rc) {
tpm1_chip_unregister(chip);
tpm_bios_log_teardown(chip);
return rc;
}

chip->flags |= TPM_CHIP_FLAG_REGISTERED;

rc = tpm_add_legacy_sysfs(chip);
if (rc) {
tpm_chip_unregister(chip);
Expand All @@ -402,12 +382,8 @@ EXPORT_SYMBOL_GPL(tpm_chip_register);
*/
void tpm_chip_unregister(struct tpm_chip *chip)
{
if (!(chip->flags & TPM_CHIP_FLAG_REGISTERED))
return;

tpm_del_legacy_sysfs(chip);

tpm1_chip_unregister(chip);
tpm_bios_log_teardown(chip);
tpm_del_char_device(chip);
}
EXPORT_SYMBOL_GPL(tpm_chip_unregister);
Loading

0 comments on commit 683b96f

Please sign in to comment.