From: Greg Kroah-Hartman Date: Thu, 21 Mar 2019 10:24:35 +0000 (+0100) Subject: 4.14-stable patches X-Git-Tag: v3.18.137~23 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e8b5be624230c1b58414606b5e4d8d93efafef85;p=thirdparty%2Fkernel%2Fstable-queue.git 4.14-stable patches added patches: md-fix-failed-allocation-of-md_register_thread.patch perf-auxtrace-define-auxtrace-record-alignment.patch perf-intel-pt-fix-cyc-timestamp-calculation-after-ovf.patch perf-intel-pt-fix-divide-by-zero-when-tsc-is-not-available.patch perf-intel-pt-fix-overlap-calculation-for-padding.patch tpm-tpm_crb-avoid-unaligned-reads-in-crb_recv.patch tpm-unify-the-send-callback-behaviour.patch x86-unwind-orc-fix-orc-unwind-table-alignment.patch --- diff --git a/queue-4.14/md-fix-failed-allocation-of-md_register_thread.patch b/queue-4.14/md-fix-failed-allocation-of-md_register_thread.patch new file mode 100644 index 00000000000..d2c8e0b8453 --- /dev/null +++ b/queue-4.14/md-fix-failed-allocation-of-md_register_thread.patch @@ -0,0 +1,49 @@ +From e406f12dde1a8375d77ea02d91f313fb1a9c6aec Mon Sep 17 00:00:00 2001 +From: Aditya Pakki +Date: Mon, 4 Mar 2019 16:48:54 -0600 +Subject: md: Fix failed allocation of md_register_thread + +From: Aditya Pakki + +commit e406f12dde1a8375d77ea02d91f313fb1a9c6aec upstream. + +mddev->sync_thread can be set to NULL on kzalloc failure downstream. +The patch checks for such a scenario and frees allocated resources. + +Committer node: + +Added similar fix to raid5.c, as suggested by Guoqing. + +Cc: stable@vger.kernel.org # v3.16+ +Acked-by: Guoqing Jiang +Signed-off-by: Aditya Pakki +Signed-off-by: Song Liu +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/md/raid10.c | 2 ++ + drivers/md/raid5.c | 2 ++ + 2 files changed, 4 insertions(+) + +--- a/drivers/md/raid10.c ++++ b/drivers/md/raid10.c +@@ -3821,6 +3821,8 @@ static int raid10_run(struct mddev *mdde + set_bit(MD_RECOVERY_RUNNING, &mddev->recovery); + mddev->sync_thread = md_register_thread(md_do_sync, mddev, + "reshape"); ++ if (!mddev->sync_thread) ++ goto out_free_conf; + } + + return 0; +--- a/drivers/md/raid5.c ++++ b/drivers/md/raid5.c +@@ -7370,6 +7370,8 @@ static int raid5_run(struct mddev *mddev + set_bit(MD_RECOVERY_RUNNING, &mddev->recovery); + mddev->sync_thread = md_register_thread(md_do_sync, mddev, + "reshape"); ++ if (!mddev->sync_thread) ++ goto abort; + } + + /* Ok, everything is just fine now */ diff --git a/queue-4.14/perf-auxtrace-define-auxtrace-record-alignment.patch b/queue-4.14/perf-auxtrace-define-auxtrace-record-alignment.patch new file mode 100644 index 00000000000..138f1997d2c --- /dev/null +++ b/queue-4.14/perf-auxtrace-define-auxtrace-record-alignment.patch @@ -0,0 +1,52 @@ +From c3fcadf0bb765faf45d6d562246e1d08885466df Mon Sep 17 00:00:00 2001 +From: Adrian Hunter +Date: Wed, 6 Feb 2019 12:39:43 +0200 +Subject: perf auxtrace: Define auxtrace record alignment + +From: Adrian Hunter + +commit c3fcadf0bb765faf45d6d562246e1d08885466df upstream. + +Define auxtrace record alignment so that it can be referenced elsewhere. + +Note this is preparation for patch "perf intel-pt: Fix overlap calculation +for padding" + +Signed-off-by: Adrian Hunter +Cc: Jiri Olsa +Cc: stable@vger.kernel.org +Link: http://lkml.kernel.org/r/20190206103947.15750-2-adrian.hunter@intel.com +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Greg Kroah-Hartman + +--- + tools/perf/util/auxtrace.c | 4 ++-- + tools/perf/util/auxtrace.h | 3 +++ + 2 files changed, 5 insertions(+), 2 deletions(-) + +--- a/tools/perf/util/auxtrace.c ++++ b/tools/perf/util/auxtrace.c +@@ -1264,9 +1264,9 @@ static int __auxtrace_mmap__read(struct + } + + /* padding must be written by fn() e.g. record__process_auxtrace() */ +- padding = size & 7; ++ padding = size & (PERF_AUXTRACE_RECORD_ALIGNMENT - 1); + if (padding) +- padding = 8 - padding; ++ padding = PERF_AUXTRACE_RECORD_ALIGNMENT - padding; + + memset(&ev, 0, sizeof(ev)); + ev.auxtrace.header.type = PERF_RECORD_AUXTRACE; +--- a/tools/perf/util/auxtrace.h ++++ b/tools/perf/util/auxtrace.h +@@ -38,6 +38,9 @@ struct record_opts; + struct auxtrace_info_event; + struct events_stats; + ++/* Auxtrace records must have the same alignment as perf event records */ ++#define PERF_AUXTRACE_RECORD_ALIGNMENT 8 ++ + enum auxtrace_type { + PERF_AUXTRACE_UNKNOWN, + PERF_AUXTRACE_INTEL_PT, diff --git a/queue-4.14/perf-intel-pt-fix-cyc-timestamp-calculation-after-ovf.patch b/queue-4.14/perf-intel-pt-fix-cyc-timestamp-calculation-after-ovf.patch new file mode 100644 index 00000000000..5d3ad56fda9 --- /dev/null +++ b/queue-4.14/perf-intel-pt-fix-cyc-timestamp-calculation-after-ovf.patch @@ -0,0 +1,36 @@ +From 03997612904866abe7cdcc992784ef65cb3a4b81 Mon Sep 17 00:00:00 2001 +From: Adrian Hunter +Date: Wed, 6 Feb 2019 12:39:45 +0200 +Subject: perf intel-pt: Fix CYC timestamp calculation after OVF + +From: Adrian Hunter + +commit 03997612904866abe7cdcc992784ef65cb3a4b81 upstream. + +CYC packet timestamp calculation depends upon CBR which was being +cleared upon overflow (OVF). That can cause errors due to failing to +synchronize with sideband events. Even if a CBR change has been lost, +the old CBR is still a better estimate than zero. So remove the clearing +of CBR. + +Signed-off-by: Adrian Hunter +Cc: Jiri Olsa +Cc: stable@vger.kernel.org +Link: http://lkml.kernel.org/r/20190206103947.15750-4-adrian.hunter@intel.com +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Greg Kroah-Hartman + +--- + tools/perf/util/intel-pt-decoder/intel-pt-decoder.c | 1 - + 1 file changed, 1 deletion(-) + +--- a/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c ++++ b/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c +@@ -1389,7 +1389,6 @@ static int intel_pt_overflow(struct inte + { + intel_pt_log("ERROR: Buffer overflow\n"); + intel_pt_clear_tx_flags(decoder); +- decoder->cbr = 0; + decoder->timestamp_insn_cnt = 0; + decoder->pkt_state = INTEL_PT_STATE_ERR_RESYNC; + decoder->overflow = true; diff --git a/queue-4.14/perf-intel-pt-fix-divide-by-zero-when-tsc-is-not-available.patch b/queue-4.14/perf-intel-pt-fix-divide-by-zero-when-tsc-is-not-available.patch new file mode 100644 index 00000000000..f862730fa24 --- /dev/null +++ b/queue-4.14/perf-intel-pt-fix-divide-by-zero-when-tsc-is-not-available.patch @@ -0,0 +1,36 @@ +From 076333870c2f5bdd9b6d31e7ca1909cf0c84cbfa Mon Sep 17 00:00:00 2001 +From: Adrian Hunter +Date: Fri, 1 Mar 2019 12:35:36 +0200 +Subject: perf intel-pt: Fix divide by zero when TSC is not available + +From: Adrian Hunter + +commit 076333870c2f5bdd9b6d31e7ca1909cf0c84cbfa upstream. + +When TSC is not available, "timeless" decoding is used but a divide by +zero occurs if perf_time_to_tsc() is called. + +Ensure the divisor is not zero. + +Signed-off-by: Adrian Hunter +Cc: Jiri Olsa +Cc: stable@vger.kernel.org # v4.9+ +Link: https://lkml.kernel.org/n/tip-1i4j0wqoc8vlbkcizqqxpsf4@git.kernel.org +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Greg Kroah-Hartman + +--- + tools/perf/util/intel-pt.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/tools/perf/util/intel-pt.c ++++ b/tools/perf/util/intel-pt.c +@@ -2545,6 +2545,8 @@ int intel_pt_process_auxtrace_info(union + } + + pt->timeless_decoding = intel_pt_timeless_decoding(pt); ++ if (pt->timeless_decoding && !pt->tc.time_mult) ++ pt->tc.time_mult = 1; + pt->have_tsc = intel_pt_have_tsc(pt); + pt->sampling_mode = false; + pt->est_tsc = !pt->timeless_decoding; diff --git a/queue-4.14/perf-intel-pt-fix-overlap-calculation-for-padding.patch b/queue-4.14/perf-intel-pt-fix-overlap-calculation-for-padding.patch new file mode 100644 index 00000000000..9abad24bcef --- /dev/null +++ b/queue-4.14/perf-intel-pt-fix-overlap-calculation-for-padding.patch @@ -0,0 +1,90 @@ +From 5a99d99e3310a565b0cf63f785b347be9ee0da45 Mon Sep 17 00:00:00 2001 +From: Adrian Hunter +Date: Wed, 6 Feb 2019 12:39:44 +0200 +Subject: perf intel-pt: Fix overlap calculation for padding + +From: Adrian Hunter + +commit 5a99d99e3310a565b0cf63f785b347be9ee0da45 upstream. + +Auxtrace records might have up to 7 bytes of padding appended. Adjust +the overlap accordingly. + +Signed-off-by: Adrian Hunter +Cc: Jiri Olsa +Cc: stable@vger.kernel.org +Link: http://lkml.kernel.org/r/20190206103947.15750-3-adrian.hunter@intel.com +Signed-off-by: Arnaldo Carvalho de Melo +Signed-off-by: Greg Kroah-Hartman + +--- + tools/perf/util/intel-pt-decoder/intel-pt-decoder.c | 36 ++++++++++++++++++-- + 1 file changed, 34 insertions(+), 2 deletions(-) + +--- a/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c ++++ b/tools/perf/util/intel-pt-decoder/intel-pt-decoder.c +@@ -26,6 +26,7 @@ + + #include "../cache.h" + #include "../util.h" ++#include "../auxtrace.h" + + #include "intel-pt-insn-decoder.h" + #include "intel-pt-pkt-decoder.h" +@@ -2558,6 +2559,34 @@ static int intel_pt_tsc_cmp(uint64_t tsc + } + } + ++#define MAX_PADDING (PERF_AUXTRACE_RECORD_ALIGNMENT - 1) ++ ++/** ++ * adj_for_padding - adjust overlap to account for padding. ++ * @buf_b: second buffer ++ * @buf_a: first buffer ++ * @len_a: size of first buffer ++ * ++ * @buf_a might have up to 7 bytes of padding appended. Adjust the overlap ++ * accordingly. ++ * ++ * Return: A pointer into @buf_b from where non-overlapped data starts ++ */ ++static unsigned char *adj_for_padding(unsigned char *buf_b, ++ unsigned char *buf_a, size_t len_a) ++{ ++ unsigned char *p = buf_b - MAX_PADDING; ++ unsigned char *q = buf_a + len_a - MAX_PADDING; ++ int i; ++ ++ for (i = MAX_PADDING; i; i--, p++, q++) { ++ if (*p != *q) ++ break; ++ } ++ ++ return p; ++} ++ + /** + * intel_pt_find_overlap_tsc - determine start of non-overlapped trace data + * using TSC. +@@ -2608,8 +2637,11 @@ static unsigned char *intel_pt_find_over + + /* Same TSC, so buffers are consecutive */ + if (!cmp && rem_b >= rem_a) { ++ unsigned char *start; ++ + *consecutive = true; +- return buf_b + len_b - (rem_b - rem_a); ++ start = buf_b + len_b - (rem_b - rem_a); ++ return adj_for_padding(start, buf_a, len_a); + } + if (cmp < 0) + return buf_b; /* tsc_a < tsc_b => no overlap */ +@@ -2672,7 +2704,7 @@ unsigned char *intel_pt_find_overlap(uns + found = memmem(buf_a, len_a, buf_b, len_a); + if (found) { + *consecutive = true; +- return buf_b + len_a; ++ return adj_for_padding(buf_b + len_a, buf_a, len_a); + } + + /* Try again at next PSB in buffer 'a' */ diff --git a/queue-4.14/series b/queue-4.14/series index 6754e7b8e4e..cd3d657c426 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -159,3 +159,11 @@ nfsd-fix-wrong-check-in-write_v4_end_grace.patch nfsv4.1-reinitialise-sequence-results-before-retransmitting-a-request.patch pm-wakeup-rework-wakeup-source-timer-cancellation.patch bcache-never-writeback-a-discard-operation.patch +x86-unwind-orc-fix-orc-unwind-table-alignment.patch +perf-intel-pt-fix-cyc-timestamp-calculation-after-ovf.patch +perf-auxtrace-define-auxtrace-record-alignment.patch +perf-intel-pt-fix-overlap-calculation-for-padding.patch +perf-intel-pt-fix-divide-by-zero-when-tsc-is-not-available.patch +md-fix-failed-allocation-of-md_register_thread.patch +tpm-tpm_crb-avoid-unaligned-reads-in-crb_recv.patch +tpm-unify-the-send-callback-behaviour.patch diff --git a/queue-4.14/tpm-tpm_crb-avoid-unaligned-reads-in-crb_recv.patch b/queue-4.14/tpm-tpm_crb-avoid-unaligned-reads-in-crb_recv.patch new file mode 100644 index 00000000000..d36edf4f005 --- /dev/null +++ b/queue-4.14/tpm-tpm_crb-avoid-unaligned-reads-in-crb_recv.patch @@ -0,0 +1,75 @@ +From 3d7a850fdc1a2e4d2adbc95cc0fc962974725e88 Mon Sep 17 00:00:00 2001 +From: Jarkko Sakkinen +Date: Mon, 4 Feb 2019 15:59:43 +0200 +Subject: tpm/tpm_crb: Avoid unaligned reads in crb_recv() + +From: Jarkko Sakkinen + +commit 3d7a850fdc1a2e4d2adbc95cc0fc962974725e88 upstream. + +The current approach to read first 6 bytes from the response and then tail +of the response, can cause the 2nd memcpy_fromio() to do an unaligned read +(e.g. read 32-bit word from address aligned to a 16-bits), depending on how +memcpy_fromio() is implemented. If this happens, the read will fail and the +memory controller will fill the read with 1's. + +This was triggered by 170d13ca3a2f, which should be probably refined to +check and react to the address alignment. Before that commit, on x86 +memcpy_fromio() turned out to be memcpy(). By a luck GCC has done the right +thing (from tpm_crb's perspective) for us so far, but we should not rely on +that. Thus, it makes sense to fix this also in tpm_crb, not least because +the fix can be then backported to stable kernels and make them more robust +when compiled in differing environments. + +Cc: stable@vger.kernel.org +Cc: James Morris +Cc: Tomas Winkler +Cc: Jerry Snitselaar +Fixes: 30fc8d138e91 ("tpm: TPM 2.0 CRB Interface") +Signed-off-by: Jarkko Sakkinen +Reviewed-by: Jerry Snitselaar +Acked-by: Tomas Winkler +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/char/tpm/tpm_crb.c | 22 ++++++++++++++++------ + 1 file changed, 16 insertions(+), 6 deletions(-) + +--- a/drivers/char/tpm/tpm_crb.c ++++ b/drivers/char/tpm/tpm_crb.c +@@ -288,19 +288,29 @@ static int crb_recv(struct tpm_chip *chi + struct crb_priv *priv = dev_get_drvdata(&chip->dev); + unsigned int expected; + +- /* sanity check */ +- if (count < 6) ++ /* A sanity check that the upper layer wants to get at least the header ++ * as that is the minimum size for any TPM response. ++ */ ++ if (count < TPM_HEADER_SIZE) + return -EIO; + ++ /* If this bit is set, according to the spec, the TPM is in ++ * unrecoverable condition. ++ */ + if (ioread32(&priv->regs_t->ctrl_sts) & CRB_CTRL_STS_ERROR) + return -EIO; + +- memcpy_fromio(buf, priv->rsp, 6); +- expected = be32_to_cpup((__be32 *) &buf[2]); +- if (expected > count || expected < 6) ++ /* Read the first 8 bytes in order to get the length of the response. ++ * We read exactly a quad word in order to make sure that the remaining ++ * reads will be aligned. ++ */ ++ memcpy_fromio(buf, priv->rsp, 8); ++ ++ expected = be32_to_cpup((__be32 *)&buf[2]); ++ if (expected > count || expected < TPM_HEADER_SIZE) + return -EIO; + +- memcpy_fromio(&buf[6], &priv->rsp[6], expected - 6); ++ memcpy_fromio(&buf[8], &priv->rsp[8], expected - 8); + + return expected; + } diff --git a/queue-4.14/tpm-unify-the-send-callback-behaviour.patch b/queue-4.14/tpm-unify-the-send-callback-behaviour.patch new file mode 100644 index 00000000000..61617448e94 --- /dev/null +++ b/queue-4.14/tpm-unify-the-send-callback-behaviour.patch @@ -0,0 +1,211 @@ +From f5595f5baa30e009bf54d0d7653a9a0cc465be60 Mon Sep 17 00:00:00 2001 +From: Jarkko Sakkinen +Date: Fri, 8 Feb 2019 18:30:58 +0200 +Subject: tpm: Unify the send callback behaviour + +From: Jarkko Sakkinen + +commit f5595f5baa30e009bf54d0d7653a9a0cc465be60 upstream. + +The send() callback should never return length as it does not in every +driver except tpm_crb in the success case. The reason is that the main +transmit functionality only cares about whether the transmit was +successful or not and ignores the count completely. + +Suggested-by: Stefan Berger +Cc: stable@vger.kernel.org +Signed-off-by: Jarkko Sakkinen +Reviewed-by: Stefan Berger +Reviewed-by: Jerry Snitselaar +Tested-by: Alexander Steffen +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/char/tpm/st33zp24/st33zp24.c | 2 +- + drivers/char/tpm/tpm-interface.c | 11 ++++++++++- + drivers/char/tpm/tpm_atmel.c | 2 +- + drivers/char/tpm/tpm_i2c_atmel.c | 6 +++++- + drivers/char/tpm/tpm_i2c_infineon.c | 2 +- + drivers/char/tpm/tpm_i2c_nuvoton.c | 2 +- + drivers/char/tpm/tpm_ibmvtpm.c | 8 ++++---- + drivers/char/tpm/tpm_infineon.c | 2 +- + drivers/char/tpm/tpm_nsc.c | 2 +- + drivers/char/tpm/tpm_tis_core.c | 2 +- + drivers/char/tpm/tpm_vtpm_proxy.c | 3 +-- + drivers/char/tpm/xen-tpmfront.c | 2 +- + 12 files changed, 28 insertions(+), 16 deletions(-) + +--- a/drivers/char/tpm/st33zp24/st33zp24.c ++++ b/drivers/char/tpm/st33zp24/st33zp24.c +@@ -438,7 +438,7 @@ static int st33zp24_send(struct tpm_chip + goto out_err; + } + +- return len; ++ return 0; + out_err: + st33zp24_cancel(chip); + release_locality(chip); +--- a/drivers/char/tpm/tpm-interface.c ++++ b/drivers/char/tpm/tpm-interface.c +@@ -497,10 +497,19 @@ static ssize_t tpm_try_transmit(struct t + if (rc < 0) { + if (rc != -EPIPE) + dev_err(&chip->dev, +- "%s: tpm_send: error %d\n", __func__, rc); ++ "%s: send(): error %d\n", __func__, rc); + goto out; + } + ++ /* A sanity check. send() should just return zero on success e.g. ++ * not the command length. ++ */ ++ if (rc > 0) { ++ dev_warn(&chip->dev, ++ "%s: send(): invalid value %d\n", __func__, rc); ++ rc = 0; ++ } ++ + if (chip->flags & TPM_CHIP_FLAG_IRQ) + goto out_recv; + +--- a/drivers/char/tpm/tpm_atmel.c ++++ b/drivers/char/tpm/tpm_atmel.c +@@ -105,7 +105,7 @@ static int tpm_atml_send(struct tpm_chip + iowrite8(buf[i], priv->iobase); + } + +- return count; ++ return 0; + } + + static void tpm_atml_cancel(struct tpm_chip *chip) +--- a/drivers/char/tpm/tpm_i2c_atmel.c ++++ b/drivers/char/tpm/tpm_i2c_atmel.c +@@ -65,7 +65,11 @@ static int i2c_atmel_send(struct tpm_chi + dev_dbg(&chip->dev, + "%s(buf=%*ph len=%0zx) -> sts=%d\n", __func__, + (int)min_t(size_t, 64, len), buf, len, status); +- return status; ++ ++ if (status < 0) ++ return status; ++ ++ return 0; + } + + static int i2c_atmel_recv(struct tpm_chip *chip, u8 *buf, size_t count) +--- a/drivers/char/tpm/tpm_i2c_infineon.c ++++ b/drivers/char/tpm/tpm_i2c_infineon.c +@@ -587,7 +587,7 @@ static int tpm_tis_i2c_send(struct tpm_c + /* go and do it */ + iic_tpm_write(TPM_STS(tpm_dev.locality), &sts, 1); + +- return len; ++ return 0; + out_err: + tpm_tis_i2c_ready(chip); + /* The TPM needs some time to clean up here, +--- a/drivers/char/tpm/tpm_i2c_nuvoton.c ++++ b/drivers/char/tpm/tpm_i2c_nuvoton.c +@@ -469,7 +469,7 @@ static int i2c_nuvoton_send(struct tpm_c + } + + dev_dbg(dev, "%s() -> %zd\n", __func__, len); +- return len; ++ return 0; + } + + static bool i2c_nuvoton_req_canceled(struct tpm_chip *chip, u8 status) +--- a/drivers/char/tpm/tpm_ibmvtpm.c ++++ b/drivers/char/tpm/tpm_ibmvtpm.c +@@ -141,14 +141,14 @@ static int tpm_ibmvtpm_recv(struct tpm_c + } + + /** +- * tpm_ibmvtpm_send - Send tpm request +- * ++ * tpm_ibmvtpm_send() - Send a TPM command + * @chip: tpm chip struct + * @buf: buffer contains data to send + * @count: size of buffer + * + * Return: +- * Number of bytes sent or < 0 on error. ++ * 0 on success, ++ * -errno on error + */ + static int tpm_ibmvtpm_send(struct tpm_chip *chip, u8 *buf, size_t count) + { +@@ -194,7 +194,7 @@ static int tpm_ibmvtpm_send(struct tpm_c + rc = 0; + ibmvtpm->tpm_processing_cmd = false; + } else +- rc = count; ++ rc = 0; + + spin_unlock(&ibmvtpm->rtce_lock); + return rc; +--- a/drivers/char/tpm/tpm_infineon.c ++++ b/drivers/char/tpm/tpm_infineon.c +@@ -354,7 +354,7 @@ static int tpm_inf_send(struct tpm_chip + for (i = 0; i < count; i++) { + wait_and_send(chip, buf[i]); + } +- return count; ++ return 0; + } + + static void tpm_inf_cancel(struct tpm_chip *chip) +--- a/drivers/char/tpm/tpm_nsc.c ++++ b/drivers/char/tpm/tpm_nsc.c +@@ -226,7 +226,7 @@ static int tpm_nsc_send(struct tpm_chip + } + outb(NSC_COMMAND_EOC, priv->base + NSC_COMMAND); + +- return count; ++ return 0; + } + + static void tpm_nsc_cancel(struct tpm_chip *chip) +--- a/drivers/char/tpm/tpm_tis_core.c ++++ b/drivers/char/tpm/tpm_tis_core.c +@@ -379,7 +379,7 @@ static int tpm_tis_send_main(struct tpm_ + goto out_err; + } + } +- return len; ++ return 0; + out_err: + tpm_tis_ready(chip); + return rc; +--- a/drivers/char/tpm/tpm_vtpm_proxy.c ++++ b/drivers/char/tpm/tpm_vtpm_proxy.c +@@ -335,7 +335,6 @@ static int vtpm_proxy_is_driver_command( + static int vtpm_proxy_tpm_op_send(struct tpm_chip *chip, u8 *buf, size_t count) + { + struct proxy_dev *proxy_dev = dev_get_drvdata(&chip->dev); +- int rc = 0; + + if (count > sizeof(proxy_dev->buffer)) { + dev_err(&chip->dev, +@@ -366,7 +365,7 @@ static int vtpm_proxy_tpm_op_send(struct + + wake_up_interruptible(&proxy_dev->wq); + +- return rc; ++ return 0; + } + + static void vtpm_proxy_tpm_op_cancel(struct tpm_chip *chip) +--- a/drivers/char/tpm/xen-tpmfront.c ++++ b/drivers/char/tpm/xen-tpmfront.c +@@ -112,7 +112,7 @@ static int vtpm_send(struct tpm_chip *ch + return -ETIME; + } + +- return count; ++ return 0; + } + + static int vtpm_recv(struct tpm_chip *chip, u8 *buf, size_t count) diff --git a/queue-4.14/x86-unwind-orc-fix-orc-unwind-table-alignment.patch b/queue-4.14/x86-unwind-orc-fix-orc-unwind-table-alignment.patch new file mode 100644 index 00000000000..a620f2d7dc5 --- /dev/null +++ b/queue-4.14/x86-unwind-orc-fix-orc-unwind-table-alignment.patch @@ -0,0 +1,47 @@ +From f76a16adc485699f95bb71fce114f97c832fe664 Mon Sep 17 00:00:00 2001 +From: Josh Poimboeuf +Date: Wed, 6 Mar 2019 11:07:24 -0600 +Subject: x86/unwind/orc: Fix ORC unwind table alignment + +From: Josh Poimboeuf + +commit f76a16adc485699f95bb71fce114f97c832fe664 upstream. + +The .orc_unwind section is a packed array of 6-byte structs. It's +currently aligned to 6 bytes, which is causing warnings in the LLD +linker. + +Six isn't a power of two, so it's not a valid alignment value. The +actual alignment doesn't matter much because it's an array of packed +structs. An alignment of two is sufficient. In reality it always gets +aligned to four bytes because it comes immediately after the +4-byte-aligned .orc_unwind_ip section. + +Fixes: ee9f8fce9964 ("x86/unwind: Add the ORC unwinder") +Reported-by: Nick Desaulniers +Reported-by: Dmitry Golovin +Reported-by: Sedat Dilek +Signed-off-by: Josh Poimboeuf +Signed-off-by: Thomas Gleixner +Tested-by: Sedat Dilek +Cc: Peter Zijlstra +Cc: stable@vger.kernel.org +Link: https://github.com/ClangBuiltLinux/linux/issues/218 +Link: https://lkml.kernel.org/r/d55027ee95fe73e952dcd8be90aebd31b0095c45.1551892041.git.jpoimboe@redhat.com +Signed-off-by: Greg Kroah-Hartman + +--- + include/asm-generic/vmlinux.lds.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/include/asm-generic/vmlinux.lds.h ++++ b/include/asm-generic/vmlinux.lds.h +@@ -696,7 +696,7 @@ + KEEP(*(.orc_unwind_ip)) \ + VMLINUX_SYMBOL(__stop_orc_unwind_ip) = .; \ + } \ +- . = ALIGN(6); \ ++ . = ALIGN(2); \ + .orc_unwind : AT(ADDR(.orc_unwind) - LOAD_OFFSET) { \ + VMLINUX_SYMBOL(__start_orc_unwind) = .; \ + KEEP(*(.orc_unwind)) \