aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-04-30 19:27:51 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-30 19:27:51 -0400
commit2e1deaad1e48453cea782854ab87df3f78c121c2 (patch)
treeda0fe592dcc9ef6b0c4cd104a67af3c1d9e4c5d5
parent50528fabeb25f9883e2845f5147f5e00a1c57cf7 (diff)
parentb7ae9f064bec903bd4a9f257a35da4d1e9bbcc99 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security
Pull security subsystem update from James Morris: "Just some minor updates across the subsystem" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: ima: eliminate passing d_name.name to process_measurement() TPM: Retry SaveState command in suspend path tpm/tpm_i2c_infineon: Add small comment about return value of __i2c_transfer tpm/tpm_i2c_infineon.c: Add OF attributes type and name to the of_device_id table entries tpm_i2c_stm_st33: Remove duplicate inclusion of header files tpm: Add support for new Infineon I2C TPM (SLB 9645 TT 1.2 I2C) char/tpm: Convert struct i2c_msg initialization to C99 format drivers/char/tpm/tpm_ppi: use strlcpy instead of strncpy tpm/tpm_i2c_stm_st33: formatting and white space changes Smack: include magic.h in smackfs.c selinux: make security_sb_clone_mnt_opts return an error on context mismatch seccomp: allow BPF_XOR based ALU instructions. Fix NULL pointer dereference in smack_inode_unlink() and smack_inode_rmdir() Smack: add support for modification of existing rules smack: SMACK_MAGIC to include/uapi/linux/magic.h Smack: add missing support for transmute bit in smack_str_from_perm() Smack: prevent revoke-subject from failing when unseen label is written to it tomoyo: use DEFINE_SRCU() to define tomoyo_ss tomoyo: use DEFINE_SRCU() to define tomoyo_ss
-rw-r--r--Documentation/devicetree/bindings/i2c/trivial-devices.txt2
-rw-r--r--Documentation/security/Smack.txt11
-rw-r--r--drivers/char/tpm/tpm.c31
-rw-r--r--drivers/char/tpm/tpm.h3
-rw-r--r--drivers/char/tpm/tpm_i2c_infineon.c180
-rw-r--r--drivers/char/tpm/tpm_i2c_stm_st33.c64
-rw-r--r--drivers/char/tpm/tpm_ppi.c14
-rw-r--r--fs/nfs/super.c3
-rw-r--r--include/linux/security.h10
-rw-r--r--include/uapi/linux/magic.h1
-rw-r--r--kernel/seccomp.c2
-rw-r--r--security/capability.c3
-rw-r--r--security/integrity/ima/ima_main.c14
-rw-r--r--security/security.c4
-rw-r--r--security/selinux/hooks.c39
-rw-r--r--security/smack/smack.h5
-rw-r--r--security/smack/smack_access.c2
-rw-r--r--security/smack/smack_lsm.c4
-rw-r--r--security/smack/smackfs.c254
-rw-r--r--security/tomoyo/tomoyo.c5
20 files changed, 450 insertions, 201 deletions
diff --git a/Documentation/devicetree/bindings/i2c/trivial-devices.txt b/Documentation/devicetree/bindings/i2c/trivial-devices.txt
index 446859fcdca4..ad6a73852f08 100644
--- a/Documentation/devicetree/bindings/i2c/trivial-devices.txt
+++ b/Documentation/devicetree/bindings/i2c/trivial-devices.txt
@@ -35,6 +35,8 @@ fsl,mc13892 MC13892: Power Management Integrated Circuit (PMIC) for i.MX35/51
35fsl,mma8450 MMA8450Q: Xtrinsic Low-power, 3-axis Xtrinsic Accelerometer 35fsl,mma8450 MMA8450Q: Xtrinsic Low-power, 3-axis Xtrinsic Accelerometer
36fsl,mpr121 MPR121: Proximity Capacitive Touch Sensor Controller 36fsl,mpr121 MPR121: Proximity Capacitive Touch Sensor Controller
37fsl,sgtl5000 SGTL5000: Ultra Low-Power Audio Codec 37fsl,sgtl5000 SGTL5000: Ultra Low-Power Audio Codec
38infineon,slb9635tt Infineon SLB9635 (Soft-) I2C TPM (old protocol, max 100khz)
39infineon,slb9645tt Infineon SLB9645 I2C TPM (new protocol, max 400khz)
38maxim,ds1050 5 Bit Programmable, Pulse-Width Modulator 40maxim,ds1050 5 Bit Programmable, Pulse-Width Modulator
39maxim,max1237 Low-Power, 4-/12-Channel, 2-Wire Serial, 12-Bit ADCs 41maxim,max1237 Low-Power, 4-/12-Channel, 2-Wire Serial, 12-Bit ADCs
40maxim,max6625 9-Bit/12-Bit Temperature Sensors with I²C-Compatible Serial Interface 42maxim,max6625 9-Bit/12-Bit Temperature Sensors with I²C-Compatible Serial Interface
diff --git a/Documentation/security/Smack.txt b/Documentation/security/Smack.txt
index 8a177e4b6e21..7a2d30c132e3 100644
--- a/Documentation/security/Smack.txt
+++ b/Documentation/security/Smack.txt
@@ -117,6 +117,17 @@ access2
117ambient 117ambient
118 This contains the Smack label applied to unlabeled network 118 This contains the Smack label applied to unlabeled network
119 packets. 119 packets.
120change-rule
121 This interface allows modification of existing access control rules.
122 The format accepted on write is:
123 "%s %s %s %s"
124 where the first string is the subject label, the second the
125 object label, the third the access to allow and the fourth the
126 access to deny. The access strings may contain only the characters
127 "rwxat-". If a rule for a given subject and object exists it will be
128 modified by enabling the permissions in the third string and disabling
129 those in the fourth string. If there is no such rule it will be
130 created using the access specified in the third and the fourth strings.
120cipso 131cipso
121 This interface allows a specific CIPSO header to be assigned 132 This interface allows a specific CIPSO header to be assigned
122 to a Smack label. The format accepted on write is: 133 to a Smack label. The format accepted on write is:
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c
index 0d2e82f95577..7c3b3dcbfbc8 100644
--- a/drivers/char/tpm/tpm.c
+++ b/drivers/char/tpm/tpm.c
@@ -1337,7 +1337,7 @@ int tpm_pm_suspend(struct device *dev)
1337{ 1337{
1338 struct tpm_chip *chip = dev_get_drvdata(dev); 1338 struct tpm_chip *chip = dev_get_drvdata(dev);
1339 struct tpm_cmd_t cmd; 1339 struct tpm_cmd_t cmd;
1340 int rc; 1340 int rc, try;
1341 1341
1342 u8 dummy_hash[TPM_DIGEST_SIZE] = { 0 }; 1342 u8 dummy_hash[TPM_DIGEST_SIZE] = { 0 };
1343 1343
@@ -1355,9 +1355,32 @@ int tpm_pm_suspend(struct device *dev)
1355 } 1355 }
1356 1356
1357 /* now do the actual savestate */ 1357 /* now do the actual savestate */
1358 cmd.header.in = savestate_header; 1358 for (try = 0; try < TPM_RETRY; try++) {
1359 rc = transmit_cmd(chip, &cmd, SAVESTATE_RESULT_SIZE, 1359 cmd.header.in = savestate_header;
1360 "sending savestate before suspend"); 1360 rc = transmit_cmd(chip, &cmd, SAVESTATE_RESULT_SIZE, NULL);
1361
1362 /*
1363 * If the TPM indicates that it is too busy to respond to
1364 * this command then retry before giving up. It can take
1365 * several seconds for this TPM to be ready.
1366 *
1367 * This can happen if the TPM has already been sent the
1368 * SaveState command before the driver has loaded. TCG 1.2
1369 * specification states that any communication after SaveState
1370 * may cause the TPM to invalidate previously saved state.
1371 */
1372 if (rc != TPM_WARN_RETRY)
1373 break;
1374 msleep(TPM_TIMEOUT_RETRY);
1375 }
1376
1377 if (rc)
1378 dev_err(chip->dev,
1379 "Error (%d) sending savestate before suspend\n", rc);
1380 else if (try > 0)
1381 dev_warn(chip->dev, "TPM savestate took %dms\n",
1382 try * TPM_TIMEOUT_RETRY);
1383
1361 return rc; 1384 return rc;
1362} 1385}
1363EXPORT_SYMBOL_GPL(tpm_pm_suspend); 1386EXPORT_SYMBOL_GPL(tpm_pm_suspend);
diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h
index 81b52015f669..0770d1d79366 100644
--- a/drivers/char/tpm/tpm.h
+++ b/drivers/char/tpm/tpm.h
@@ -32,10 +32,12 @@ enum tpm_const {
32 TPM_MINOR = 224, /* officially assigned */ 32 TPM_MINOR = 224, /* officially assigned */
33 TPM_BUFSIZE = 4096, 33 TPM_BUFSIZE = 4096,
34 TPM_NUM_DEVICES = 256, 34 TPM_NUM_DEVICES = 256,
35 TPM_RETRY = 50, /* 5 seconds */
35}; 36};
36 37
37enum tpm_timeout { 38enum tpm_timeout {
38 TPM_TIMEOUT = 5, /* msecs */ 39 TPM_TIMEOUT = 5, /* msecs */
40 TPM_TIMEOUT_RETRY = 100 /* msecs */
39}; 41};
40 42
41/* TPM addresses */ 43/* TPM addresses */
@@ -44,6 +46,7 @@ enum tpm_addr {
44 TPM_ADDR = 0x4E, 46 TPM_ADDR = 0x4E,
45}; 47};
46 48
49#define TPM_WARN_RETRY 0x800
47#define TPM_WARN_DOING_SELFTEST 0x802 50#define TPM_WARN_DOING_SELFTEST 0x802
48#define TPM_ERR_DEACTIVATED 0x6 51#define TPM_ERR_DEACTIVATED 0x6
49#define TPM_ERR_DISABLED 0x7 52#define TPM_ERR_DISABLED 0x7
diff --git a/drivers/char/tpm/tpm_i2c_infineon.c b/drivers/char/tpm/tpm_i2c_infineon.c
index 8fe7ac3d095b..37d5dcc10ea7 100644
--- a/drivers/char/tpm/tpm_i2c_infineon.c
+++ b/drivers/char/tpm/tpm_i2c_infineon.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2012 Infineon Technologies 2 * Copyright (C) 2012,2013 Infineon Technologies
3 * 3 *
4 * Authors: 4 * Authors:
5 * Peter Huewe <peter.huewe@infineon.com> 5 * Peter Huewe <peter.huewe@infineon.com>
@@ -56,13 +56,21 @@
56#define TPM_TIMEOUT_US_HI (TPM_TIMEOUT_US_LOW + 2000) 56#define TPM_TIMEOUT_US_HI (TPM_TIMEOUT_US_LOW + 2000)
57 57
58/* expected value for DIDVID register */ 58/* expected value for DIDVID register */
59#define TPM_TIS_I2C_DID_VID 0x000b15d1L 59#define TPM_TIS_I2C_DID_VID_9635 0xd1150b00L
60#define TPM_TIS_I2C_DID_VID_9645 0x001a15d1L
61
62enum i2c_chip_type {
63 SLB9635,
64 SLB9645,
65 UNKNOWN,
66};
60 67
61/* Structure to store I2C TPM specific stuff */ 68/* Structure to store I2C TPM specific stuff */
62struct tpm_inf_dev { 69struct tpm_inf_dev {
63 struct i2c_client *client; 70 struct i2c_client *client;
64 u8 buf[TPM_BUFSIZE + sizeof(u8)]; /* max. buffer size + addr */ 71 u8 buf[TPM_BUFSIZE + sizeof(u8)]; /* max. buffer size + addr */
65 struct tpm_chip *chip; 72 struct tpm_chip *chip;
73 enum i2c_chip_type chip_type;
66}; 74};
67 75
68static struct tpm_inf_dev tpm_dev;