]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.5-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 3 May 2016 00:03:35 +0000 (17:03 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 3 May 2016 00:03:35 +0000 (17:03 -0700)
added patches:
extcon-max77843-use-correct-size-for-reading-the-interrupt-register.patch
stm-class-select-config_srcu.patch
tpm-fix-checks-for-policy-digest-existence-in-tpm2_seal_trusted.patch
tpm-fix-set-continuesession-attribute-for-the-unseal-operation.patch

queue-4.5/extcon-max77843-use-correct-size-for-reading-the-interrupt-register.patch [new file with mode: 0644]
queue-4.5/series
queue-4.5/stm-class-select-config_srcu.patch [new file with mode: 0644]
queue-4.5/tpm-fix-checks-for-policy-digest-existence-in-tpm2_seal_trusted.patch [new file with mode: 0644]
queue-4.5/tpm-fix-set-continuesession-attribute-for-the-unseal-operation.patch [new file with mode: 0644]

diff --git a/queue-4.5/extcon-max77843-use-correct-size-for-reading-the-interrupt-register.patch b/queue-4.5/extcon-max77843-use-correct-size-for-reading-the-interrupt-register.patch
new file mode 100644 (file)
index 0000000..bfaee29
--- /dev/null
@@ -0,0 +1,36 @@
+From c4924e92442d7218bd725e47fa3988c73aae84c9 Mon Sep 17 00:00:00 2001
+From: Dan Carpenter <dan.carpenter@oracle.com>
+Date: Thu, 4 Feb 2016 14:36:09 +0300
+Subject: extcon: max77843: Use correct size for reading the interrupt register
+
+From: Dan Carpenter <dan.carpenter@oracle.com>
+
+commit c4924e92442d7218bd725e47fa3988c73aae84c9 upstream.
+
+The info->status[] array has 3 elements.  We are using size
+MAX77843_MUIC_IRQ_NUM (16) instead of MAX77843_MUIC_STATUS_NUM (3) as
+intended.
+
+Fixes: 135d9f7d135a ('extcon: max77843: Clear IRQ bits state before request IRQ')
+Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
+Reviewed-by: Jaewon Kim <jaewon02.kim@samsung.com>
+Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
+[cw00.choi: Modify the patch title]
+Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/extcon/extcon-max77843.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/extcon/extcon-max77843.c
++++ b/drivers/extcon/extcon-max77843.c
+@@ -803,7 +803,7 @@ static int max77843_muic_probe(struct pl
+       /* Clear IRQ bits before request IRQs */
+       ret = regmap_bulk_read(max77843->regmap_muic,
+                       MAX77843_MUIC_REG_INT1, info->status,
+-                      MAX77843_MUIC_IRQ_NUM);
++                      MAX77843_MUIC_STATUS_NUM);
+       if (ret) {
+               dev_err(&pdev->dev, "Failed to Clear IRQ bits\n");
+               goto err_muic_irq;
index fe03cf7861aeafef85bcdae699fd204349d28327..a30a2fba7505a7d4ecbb88de4a57c0aad607e27b 100644 (file)
@@ -194,3 +194,7 @@ unbreak-allmodconfig-kconfig_allconfig.patch
 thermal-rockchip-fix-a-impossible-condition-caused-by-the-warning.patch
 sunrpc-cache-drop-reference-when-sunrpc_cache_pipe_upcall-detects-a-race.patch
 megaraid_sas-add-missing-curly-braces-in-ioctl-handler.patch
+tpm-fix-checks-for-policy-digest-existence-in-tpm2_seal_trusted.patch
+tpm-fix-set-continuesession-attribute-for-the-unseal-operation.patch
+stm-class-select-config_srcu.patch
+extcon-max77843-use-correct-size-for-reading-the-interrupt-register.patch
diff --git a/queue-4.5/stm-class-select-config_srcu.patch b/queue-4.5/stm-class-select-config_srcu.patch
new file mode 100644 (file)
index 0000000..c9b5ea9
--- /dev/null
@@ -0,0 +1,41 @@
+From 042d4460b5b4379a12f375045ff9065cf6758735 Mon Sep 17 00:00:00 2001
+From: Arnd Bergmann <arnd@arndb.de>
+Date: Tue, 22 Dec 2015 17:25:17 +0200
+Subject: stm class: Select CONFIG_SRCU
+
+From: Arnd Bergmann <arnd@arndb.de>
+
+commit 042d4460b5b4379a12f375045ff9065cf6758735 upstream.
+
+The newly added STM code uses SRCU, but does not ensure that
+this code is part of the kernel:
+
+drivers/built-in.o: In function `stm_source_link_show':
+include/linux/srcu.h:221: undefined reference to `__srcu_read_lock'
+include/linux/srcu.h:238: undefined reference to `__srcu_read_unlock'
+drivers/built-in.o: In function `stm_source_link_drop':
+include/linux/srcu.h:221: undefined reference to `__srcu_read_lock'
+include/linux/srcu.h:238: undefined reference to `__srcu_read_unlock'
+
+This adds a Kconfig 'select' statement like all the other SRCU using
+drivers have.
+
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+Fixes: 7bd1d4093c2f ("stm class: Introduce an abstraction for System Trace Module devices")
+Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/hwtracing/stm/Kconfig |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/hwtracing/stm/Kconfig
++++ b/drivers/hwtracing/stm/Kconfig
+@@ -1,6 +1,7 @@
+ config STM
+       tristate "System Trace Module devices"
+       select CONFIGFS_FS
++      select SRCU
+       help
+         A System Trace Module (STM) is a device exporting data in System
+         Trace Protocol (STP) format as defined by MIPI STP standards.
diff --git a/queue-4.5/tpm-fix-checks-for-policy-digest-existence-in-tpm2_seal_trusted.patch b/queue-4.5/tpm-fix-checks-for-policy-digest-existence-in-tpm2_seal_trusted.patch
new file mode 100644 (file)
index 0000000..7219ce6
--- /dev/null
@@ -0,0 +1,108 @@
+From f3c82ade7c59303167d56b0be3e0707751fc45e2 Mon Sep 17 00:00:00 2001
+From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
+Date: Wed, 6 Jan 2016 16:43:30 +0200
+Subject: tpm: fix checks for policy digest existence in tpm2_seal_trusted()
+
+From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
+
+commit f3c82ade7c59303167d56b0be3e0707751fc45e2 upstream.
+
+In my original patch sealing with policy was done with dynamically
+allocated buffer that I changed later into an array so the checks in
+tpm2-cmd.c became invalid. This patch fixes the issue.
+
+Fixes: 5beb0c435bdd ("keys, trusted: seal with a TPM2 authorization policy")
+Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
+Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
+Acked-by: Peter Huewe <peterhuewe@gmx.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/char/tpm/tpm2-cmd.c |   12 ++++--------
+ include/keys/trusted-type.h |    2 +-
+ security/keys/trusted.c     |   11 +++++------
+ 3 files changed, 10 insertions(+), 15 deletions(-)
+
+--- a/drivers/char/tpm/tpm2-cmd.c
++++ b/drivers/char/tpm/tpm2-cmd.c
+@@ -478,20 +478,16 @@ int tpm2_seal_trusted(struct tpm_chip *c
+       tpm_buf_append_u8(&buf, payload->migratable);
+       /* public */
+-      if (options->policydigest)
+-              tpm_buf_append_u16(&buf, 14 + options->digest_len);
+-      else
+-              tpm_buf_append_u16(&buf, 14);
+-
++      tpm_buf_append_u16(&buf, 14 + options->policydigest_len);
+       tpm_buf_append_u16(&buf, TPM2_ALG_KEYEDHASH);
+       tpm_buf_append_u16(&buf, hash);
+       /* policy */
+-      if (options->policydigest) {
++      if (options->policydigest_len) {
+               tpm_buf_append_u32(&buf, 0);
+-              tpm_buf_append_u16(&buf, options->digest_len);
++              tpm_buf_append_u16(&buf, options->policydigest_len);
+               tpm_buf_append(&buf, options->policydigest,
+-                             options->digest_len);
++                             options->policydigest_len);
+       } else {
+               tpm_buf_append_u32(&buf, TPM2_ATTR_USER_WITH_AUTH);
+               tpm_buf_append_u16(&buf, 0);
+--- a/include/keys/trusted-type.h
++++ b/include/keys/trusted-type.h
+@@ -38,7 +38,7 @@ struct trusted_key_options {
+       unsigned char pcrinfo[MAX_PCRINFO_SIZE];
+       int pcrlock;
+       uint32_t hash;
+-      uint32_t digest_len;
++      uint32_t policydigest_len;
+       unsigned char policydigest[MAX_DIGEST_SIZE];
+       uint32_t policyhandle;
+ };
+--- a/security/keys/trusted.c
++++ b/security/keys/trusted.c
+@@ -744,6 +744,7 @@ static int getoptions(char *c, struct tr
+       unsigned long handle;
+       unsigned long lock;
+       unsigned long token_mask = 0;
++      unsigned int digest_len;
+       int i;
+       int tpm2;
+@@ -752,7 +753,6 @@ static int getoptions(char *c, struct tr
+               return tpm2;
+       opt->hash = tpm2 ? HASH_ALGO_SHA256 : HASH_ALGO_SHA1;
+-      opt->digest_len = hash_digest_size[opt->hash];
+       while ((p = strsep(&c, " \t"))) {
+               if (*p == '\0' || *p == ' ' || *p == '\t')
+@@ -812,8 +812,6 @@ static int getoptions(char *c, struct tr
+                       for (i = 0; i < HASH_ALGO__LAST; i++) {
+                               if (!strcmp(args[0].from, hash_algo_name[i])) {
+                                       opt->hash = i;
+-                                      opt->digest_len =
+-                                              hash_digest_size[opt->hash];
+                                       break;
+                               }
+                       }
+@@ -825,13 +823,14 @@ static int getoptions(char *c, struct tr
+                       }
+                       break;
+               case Opt_policydigest:
+-                      if (!tpm2 ||
+-                          strlen(args[0].from) != (2 * opt->digest_len))
++                      digest_len = hash_digest_size[opt->hash];
++                      if (!tpm2 || strlen(args[0].from) != (2 * digest_len))
+                               return -EINVAL;
+                       res = hex2bin(opt->policydigest, args[0].from,
+-                                    opt->digest_len);
++                                    digest_len);
+                       if (res < 0)
+                               return -EINVAL;
++                      opt->policydigest_len = digest_len;
+                       break;
+               case Opt_policyhandle:
+                       if (!tpm2)
diff --git a/queue-4.5/tpm-fix-set-continuesession-attribute-for-the-unseal-operation.patch b/queue-4.5/tpm-fix-set-continuesession-attribute-for-the-unseal-operation.patch
new file mode 100644 (file)
index 0000000..cf527f5
--- /dev/null
@@ -0,0 +1,55 @@
+From c0b5eed110dcf520aadafefbcc40658cbdd18b95 Mon Sep 17 00:00:00 2001
+From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
+Date: Sat, 13 Feb 2016 11:51:23 +0200
+Subject: tpm: fix: set continueSession attribute for the unseal operation
+
+From: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
+
+commit c0b5eed110dcf520aadafefbcc40658cbdd18b95 upstream.
+
+It's better to set the continueSession attribute for the unseal
+operation so that the session object is not removed as a side-effect
+when the operation is successful. Since a user process created the
+session, it should be also decide when the session is destroyed.
+
+Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
+Fixes: 5beb0c435b ("keys, trusted: seal with a TPM2 authorization policy")
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/char/tpm/tpm2-cmd.c |   10 +++++++---
+ 1 file changed, 7 insertions(+), 3 deletions(-)
+
+--- a/drivers/char/tpm/tpm2-cmd.c
++++ b/drivers/char/tpm/tpm2-cmd.c
+@@ -20,7 +20,11 @@
+ #include <keys/trusted-type.h>
+ enum tpm2_object_attributes {
+-      TPM2_ATTR_USER_WITH_AUTH        = BIT(6),
++      TPM2_OA_USER_WITH_AUTH          = BIT(6),
++};
++
++enum tpm2_session_attributes {
++      TPM2_SA_CONTINUE_SESSION        = BIT(0),
+ };
+ struct tpm2_startup_in {
+@@ -489,7 +493,7 @@ int tpm2_seal_trusted(struct tpm_chip *c
+               tpm_buf_append(&buf, options->policydigest,
+                              options->policydigest_len);
+       } else {
+-              tpm_buf_append_u32(&buf, TPM2_ATTR_USER_WITH_AUTH);
++              tpm_buf_append_u32(&buf, TPM2_OA_USER_WITH_AUTH);
+               tpm_buf_append_u16(&buf, 0);
+       }
+@@ -627,7 +631,7 @@ static int tpm2_unseal(struct tpm_chip *
+                            options->policyhandle ?
+                            options->policyhandle : TPM2_RS_PW,
+                            NULL /* nonce */, 0,
+-                           0 /* session_attributes */,
++                           TPM2_SA_CONTINUE_SESSION,
+                            options->blobauth /* hmac */,
+                            TPM_DIGEST_SIZE);