Skip to content

Commit 2e1deaa

Browse files
committed
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
2 parents 50528fa + b7ae9f0 commit 2e1deaa

20 files changed

Lines changed: 450 additions & 201 deletions

File tree

‎Documentation/devicetree/bindings/i2c/trivial-devices.txt‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ fsl,mc13892 MC13892: Power Management Integrated Circuit (PMIC) for i.MX35/51
3535
fsl,mma8450 MMA8450Q: Xtrinsic Low-power, 3-axis Xtrinsic Accelerometer
3636
fsl,mpr121 MPR121: Proximity Capacitive Touch Sensor Controller
3737
fsl,sgtl5000 SGTL5000: Ultra Low-Power Audio Codec
38+
infineon,slb9635tt Infineon SLB9635 (Soft-) I2C TPM (old protocol, max 100khz)
39+
infineon,slb9645tt Infineon SLB9645 I2C TPM (new protocol, max 400khz)
3840
maxim,ds1050 5 Bit Programmable, Pulse-Width Modulator
3941
maxim,max1237 Low-Power, 4-/12-Channel, 2-Wire Serial, 12-Bit ADCs
4042
maxim,max6625 9-Bit/12-Bit Temperature Sensors with I²C-Compatible Serial Interface

‎Documentation/security/Smack.txt‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,17 @@ access2
117117
ambient
118118
This contains the Smack label applied to unlabeled network
119119
packets.
120+
change-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.
120131
cipso
121132
This interface allows a specific CIPSO header to be assigned
122133
to a Smack label. The format accepted on write is:

‎drivers/char/tpm/tpm.c‎

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1337,7 +1337,7 @@ int tpm_pm_suspend(struct device *dev)
13371337
{
13381338
struct tpm_chip *chip = dev_get_drvdata(dev);
13391339
struct tpm_cmd_t cmd;
1340-
int rc;
1340+
int rc, try;
13411341

13421342
u8 dummy_hash[TPM_DIGEST_SIZE] = { 0 };
13431343

@@ -1355,9 +1355,32 @@ int tpm_pm_suspend(struct device *dev)
13551355
}
13561356

13571357
/* now do the actual savestate */
1358-
cmd.header.in = savestate_header;
1359-
rc = transmit_cmd(chip, &cmd, SAVESTATE_RESULT_SIZE,
1360-
"sending savestate before suspend");
1358+
for (try = 0; try < TPM_RETRY; try++) {
1359+
cmd.header.in = savestate_header;
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+
13611384
return rc;
13621385
}
13631386
EXPORT_SYMBOL_GPL(tpm_pm_suspend);

‎drivers/char/tpm/tpm.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,12 @@ enum tpm_const {
3232
TPM_MINOR = 224, /* officially assigned */
3333
TPM_BUFSIZE = 4096,
3434
TPM_NUM_DEVICES = 256,
35+
TPM_RETRY = 50, /* 5 seconds */
3536
};
3637

3738
enum tpm_timeout {
3839
TPM_TIMEOUT = 5, /* msecs */
40+
TPM_TIMEOUT_RETRY = 100 /* msecs */
3941
};
4042

4143
/* TPM addresses */
@@ -44,6 +46,7 @@ enum tpm_addr {
4446
TPM_ADDR = 0x4E,
4547
};
4648

49+
#define TPM_WARN_RETRY 0x800
4750
#define TPM_WARN_DOING_SELFTEST 0x802
4851
#define TPM_ERR_DEACTIVATED 0x6
4952
#define TPM_ERR_DISABLED 0x7

0 commit comments

Comments
 (0)