]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 Jul 2021 11:21:57 +0000 (13:21 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 Jul 2021 11:21:57 +0000 (13:21 +0200)
added patches:
crypto-ccp-annotate-sev-firmware-file-names.patch
fscrypt-don-t-ignore-minor_hash-when-hash-is-0.patch
perf-bench-fix-2-memory-sanitizer-warnings.patch

queue-5.4/crypto-ccp-annotate-sev-firmware-file-names.patch [new file with mode: 0644]
queue-5.4/fscrypt-don-t-ignore-minor_hash-when-hash-is-0.patch [new file with mode: 0644]
queue-5.4/perf-bench-fix-2-memory-sanitizer-warnings.patch [new file with mode: 0644]
queue-5.4/series

diff --git a/queue-5.4/crypto-ccp-annotate-sev-firmware-file-names.patch b/queue-5.4/crypto-ccp-annotate-sev-firmware-file-names.patch
new file mode 100644 (file)
index 0000000..625cb09
--- /dev/null
@@ -0,0 +1,40 @@
+From c8671c7dc7d51125ab9f651697866bf4a9132277 Mon Sep 17 00:00:00 2001
+From: Joerg Roedel <jroedel@suse.de>
+Date: Mon, 26 Apr 2021 10:17:48 +0200
+Subject: crypto: ccp - Annotate SEV Firmware file names
+
+From: Joerg Roedel <jroedel@suse.de>
+
+commit c8671c7dc7d51125ab9f651697866bf4a9132277 upstream.
+
+Annotate the firmware files CCP might need using MODULE_FIRMWARE().
+This will get them included into an initrd when CCP is also included
+there. Otherwise the CCP module will not find its firmware when loaded
+before the root-fs is mounted.
+This can cause problems when the pre-loaded SEV firmware is too old to
+support current SEV and SEV-ES virtualization features.
+
+Fixes: e93720606efd ("crypto: ccp - Allow SEV firmware to be chosen based on Family and Model")
+Cc: stable@vger.kernel.org # v4.20+
+Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
+Signed-off-by: Joerg Roedel <jroedel@suse.de>
+Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/crypto/ccp/psp-dev.c |    4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/drivers/crypto/ccp/psp-dev.c
++++ b/drivers/crypto/ccp/psp-dev.c
+@@ -40,6 +40,10 @@ static int psp_probe_timeout = 5;
+ module_param(psp_probe_timeout, int, 0644);
+ MODULE_PARM_DESC(psp_probe_timeout, " default timeout value, in seconds, during PSP device probe");
++MODULE_FIRMWARE("amd/amd_sev_fam17h_model0xh.sbin"); /* 1st gen EPYC */
++MODULE_FIRMWARE("amd/amd_sev_fam17h_model3xh.sbin"); /* 2nd gen EPYC */
++MODULE_FIRMWARE("amd/amd_sev_fam19h_model0xh.sbin"); /* 3rd gen EPYC */
++
+ static bool psp_dead;
+ static int psp_timeout;
diff --git a/queue-5.4/fscrypt-don-t-ignore-minor_hash-when-hash-is-0.patch b/queue-5.4/fscrypt-don-t-ignore-minor_hash-when-hash-is-0.patch
new file mode 100644 (file)
index 0000000..acd873b
--- /dev/null
@@ -0,0 +1,59 @@
+From 77f30bfcfcf484da7208affd6a9e63406420bf91 Mon Sep 17 00:00:00 2001
+From: Eric Biggers <ebiggers@google.com>
+Date: Thu, 27 May 2021 16:52:36 -0700
+Subject: fscrypt: don't ignore minor_hash when hash is 0
+
+From: Eric Biggers <ebiggers@google.com>
+
+commit 77f30bfcfcf484da7208affd6a9e63406420bf91 upstream.
+
+When initializing a no-key name, fscrypt_fname_disk_to_usr() sets the
+minor_hash to 0 if the (major) hash is 0.
+
+This doesn't make sense because 0 is a valid hash code, so we shouldn't
+ignore the filesystem-provided minor_hash in that case.  Fix this by
+removing the special case for 'hash == 0'.
+
+This is an old bug that appears to have originated when the encryption
+code in ext4 and f2fs was moved into fs/crypto/.  The original ext4 and
+f2fs code passed the hash by pointer instead of by value.  So
+'if (hash)' actually made sense then, as it was checking whether a
+pointer was NULL.  But now the hashes are passed by value, and
+filesystems just pass 0 for any hashes they don't have.  There is no
+need to handle this any differently from the hashes actually being 0.
+
+It is difficult to reproduce this bug, as it only made a difference in
+the case where a filename's 32-bit major hash happened to be 0.
+However, it probably had the largest chance of causing problems on
+ubifs, since ubifs uses minor_hash to do lookups of no-key names, in
+addition to using it as a readdir cookie.  ext4 only uses minor_hash as
+a readdir cookie, and f2fs doesn't use minor_hash at all.
+
+Fixes: 0b81d0779072 ("fs crypto: move per-file encryption from f2fs tree to fs/crypto")
+Cc: <stable@vger.kernel.org> # v4.6+
+Link: https://lore.kernel.org/r/20210527235236.2376556-1-ebiggers@kernel.org
+Signed-off-by: Eric Biggers <ebiggers@google.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/crypto/fname.c |    9 ++-------
+ 1 file changed, 2 insertions(+), 7 deletions(-)
+
+--- a/fs/crypto/fname.c
++++ b/fs/crypto/fname.c
+@@ -273,13 +273,8 @@ int fscrypt_fname_disk_to_usr(struct ino
+                                          oname->name);
+               return 0;
+       }
+-      if (hash) {
+-              digested_name.hash = hash;
+-              digested_name.minor_hash = minor_hash;
+-      } else {
+-              digested_name.hash = 0;
+-              digested_name.minor_hash = 0;
+-      }
++      digested_name.hash = hash;
++      digested_name.minor_hash = minor_hash;
+       memcpy(digested_name.digest,
+              FSCRYPT_FNAME_DIGEST(iname->name, iname->len),
+              FSCRYPT_FNAME_DIGEST_SIZE);
diff --git a/queue-5.4/perf-bench-fix-2-memory-sanitizer-warnings.patch b/queue-5.4/perf-bench-fix-2-memory-sanitizer-warnings.patch
new file mode 100644 (file)
index 0000000..727f512
--- /dev/null
@@ -0,0 +1,52 @@
+From d2c73501a767514b6c85c7feff9457a165d51057 Mon Sep 17 00:00:00 2001
+From: Ian Rogers <irogers@google.com>
+Date: Fri, 11 Sep 2020 22:37:25 -0700
+Subject: perf bench: Fix 2 memory sanitizer warnings
+
+From: Ian Rogers <irogers@google.com>
+
+commit d2c73501a767514b6c85c7feff9457a165d51057 upstream.
+
+Memory sanitizer warns if a write is performed where the memory being
+read for the write is uninitialized. Avoid this warning by initializing
+the memory.
+
+Signed-off-by: Ian Rogers <irogers@google.com>
+Acked-by: Jiri Olsa <jolsa@redhat.com>
+Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
+Cc: Mark Rutland <mark.rutland@arm.com>
+Cc: Namhyung Kim <namhyung@kernel.org>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Cc: Stephane Eranian <eranian@google.com>
+Link: http://lore.kernel.org/lkml/20200912053725.1405857-1-irogers@google.com
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+Cc: Anders Roxell <anders.roxell@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ tools/perf/bench/sched-messaging.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/tools/perf/bench/sched-messaging.c
++++ b/tools/perf/bench/sched-messaging.c
+@@ -66,11 +66,10 @@ static void fdpair(int fds[2])
+ /* Block until we're ready to go */
+ static void ready(int ready_out, int wakefd)
+ {
+-      char dummy;
+       struct pollfd pollfd = { .fd = wakefd, .events = POLLIN };
+       /* Tell them we're ready. */
+-      if (write(ready_out, &dummy, 1) != 1)
++      if (write(ready_out, "R", 1) != 1)
+               err(EXIT_FAILURE, "CLIENT: ready write");
+       /* Wait for "GO" signal */
+@@ -85,6 +84,7 @@ static void *sender(struct sender_contex
+       unsigned int i, j;
+       ready(ctx->ready_out, ctx->wakefd);
++      memset(data, 'S', sizeof(data));
+       /* Now pump to every receiver. */
+       for (i = 0; i < nr_loops; i++) {
index 38567e16a969eca96b6e30b29f41fbd2cebe048d..a5125ff00d7ddef33d6fa40ab150a0d080b4c5c7 100644 (file)
@@ -69,3 +69,6 @@ sctp-validate-from_addr_param-return.patch
 sctp-add-size-validation-when-walking-chunks.patch
 mips-loongsoon64-reserve-memory-below-starting-pfn-t.patch
 mips-set-mips32r5-for-virt-extensions.patch
+fscrypt-don-t-ignore-minor_hash-when-hash-is-0.patch
+crypto-ccp-annotate-sev-firmware-file-names.patch
+perf-bench-fix-2-memory-sanitizer-warnings.patch