]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.15-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Jul 2022 14:55:43 +0000 (16:55 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Jul 2022 14:55:43 +0000 (16:55 +0200)
added patches:
revert-selftest-vm-verify-mmap-addr-in-mremap_test.patch
revert-selftest-vm-verify-remap-destination-address-in-mremap_test.patch

queue-5.15/revert-selftest-vm-verify-mmap-addr-in-mremap_test.patch [new file with mode: 0644]
queue-5.15/revert-selftest-vm-verify-remap-destination-address-in-mremap_test.patch [new file with mode: 0644]
queue-5.15/series

diff --git a/queue-5.15/revert-selftest-vm-verify-mmap-addr-in-mremap_test.patch b/queue-5.15/revert-selftest-vm-verify-mmap-addr-in-mremap_test.patch
new file mode 100644 (file)
index 0000000..c5d2e24
--- /dev/null
@@ -0,0 +1,63 @@
+From foo@baz Sat Jul 23 04:53:32 PM CEST 2022
+From: Oleksandr Tymoshenko <ovt@google.com>
+Date: Fri, 15 Jul 2022 23:15:42 +0000
+Subject: Revert "selftest/vm: verify mmap addr in mremap_test"
+To: gregkh@linuxfoundation.org
+Cc: sidhartha.kumar@oracle.com, stable@vger.kernel.org, Oleksandr Tymoshenko <ovt@google.com>
+Message-ID: <20220715231542.2169650-3-ovt@google.com>
+
+From: Oleksandr Tymoshenko <ovt@google.com>
+
+This reverts commit e8b9989597daac896b3400b7005f24bf15233d9a.
+
+The upstream commit 9c85a9bae267 ("selftest/vm: verify mmap addr in
+mremap_test") was backported as commit a17404fcbfd0 ("selftest/vm:
+verify mmap addr in mremap_test"). Repeated backport introduced the
+duplicate of function get_mmap_min_addr to the file breakign the vm
+selftest build.
+
+Fixes: e8b9989597da ("selftest/vm: verify mmap addr in mremap_test")
+Signed-off-by: Oleksandr Tymoshenko <ovt@google.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ tools/testing/selftests/vm/mremap_test.c |   29 -----------------------------
+ 1 file changed, 29 deletions(-)
+
+--- a/tools/testing/selftests/vm/mremap_test.c
++++ b/tools/testing/selftests/vm/mremap_test.c
+@@ -66,35 +66,6 @@ enum {
+       .expect_failure = should_fail                           \
+ }
+-/* Returns mmap_min_addr sysctl tunable from procfs */
+-static unsigned long long get_mmap_min_addr(void)
+-{
+-      FILE *fp;
+-      int n_matched;
+-      static unsigned long long addr;
+-
+-      if (addr)
+-              return addr;
+-
+-      fp = fopen("/proc/sys/vm/mmap_min_addr", "r");
+-      if (fp == NULL) {
+-              ksft_print_msg("Failed to open /proc/sys/vm/mmap_min_addr: %s\n",
+-                      strerror(errno));
+-              exit(KSFT_SKIP);
+-      }
+-
+-      n_matched = fscanf(fp, "%llu", &addr);
+-      if (n_matched != 1) {
+-              ksft_print_msg("Failed to read /proc/sys/vm/mmap_min_addr: %s\n",
+-                      strerror(errno));
+-              fclose(fp);
+-              exit(KSFT_SKIP);
+-      }
+-
+-      fclose(fp);
+-      return addr;
+-}
+-
+ /*
+  * Returns false if the requested remap region overlaps with an
+  * existing mapping (e.g text, stack) else returns true.
diff --git a/queue-5.15/revert-selftest-vm-verify-remap-destination-address-in-mremap_test.patch b/queue-5.15/revert-selftest-vm-verify-remap-destination-address-in-mremap_test.patch
new file mode 100644 (file)
index 0000000..0ecdf59
--- /dev/null
@@ -0,0 +1,58 @@
+From foo@baz Sat Jul 23 04:53:32 PM CEST 2022
+From: Oleksandr Tymoshenko <ovt@google.com>
+Date: Fri, 15 Jul 2022 23:15:41 +0000
+Subject: Revert "selftest/vm: verify remap destination address in mremap_test"
+To: gregkh@linuxfoundation.org
+Cc: sidhartha.kumar@oracle.com, stable@vger.kernel.org, Oleksandr Tymoshenko <ovt@google.com>
+Message-ID: <20220715231542.2169650-2-ovt@google.com>
+
+From: Oleksandr Tymoshenko <ovt@google.com>
+
+This reverts commit 0b4e16093e081a3ab08b0d6cedf79b249f41b248.
+
+The upstream commit 18d609daa546 ("selftest/vm: verify remap destination
+address in mremap_test") was backported as commit 2688d967ec65
+("selftest/vm: verify remap destination address in mremap_test").
+Repeated backport introduced the duplicate of function
+is_remap_region_valid to the file breakign the vm selftest build.
+
+Fixes: 0b4e16093e08 ("selftest/vm: verify remap destination address in mremap_test")
+Signed-off-by: Oleksandr Tymoshenko <ovt@google.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ tools/testing/selftests/vm/mremap_test.c |   24 ------------------------
+ 1 file changed, 24 deletions(-)
+
+--- a/tools/testing/selftests/vm/mremap_test.c
++++ b/tools/testing/selftests/vm/mremap_test.c
+@@ -66,30 +66,6 @@ enum {
+       .expect_failure = should_fail                           \
+ }
+-/*
+- * Returns false if the requested remap region overlaps with an
+- * existing mapping (e.g text, stack) else returns true.
+- */
+-static bool is_remap_region_valid(void *addr, unsigned long long size)
+-{
+-      void *remap_addr = NULL;
+-      bool ret = true;
+-
+-      /* Use MAP_FIXED_NOREPLACE flag to ensure region is not mapped */
+-      remap_addr = mmap(addr, size, PROT_READ | PROT_WRITE,
+-                                       MAP_FIXED_NOREPLACE | MAP_ANONYMOUS | MAP_SHARED,
+-                                       -1, 0);
+-
+-      if (remap_addr == MAP_FAILED) {
+-              if (errno == EEXIST)
+-                      ret = false;
+-      } else {
+-              munmap(remap_addr, size);
+-      }
+-
+-      return ret;
+-}
+-
+ /* Returns mmap_min_addr sysctl tunable from procfs */
+ static unsigned long long get_mmap_min_addr(void)
+ {
index 4d27de59fa72a3fb4fddceb8820c93ef7c096f6c..071eb4c58169612600590590a0538c356af2bb91 100644 (file)
@@ -5,3 +5,5 @@ lockdown-fix-kexec-lockdown-bypass-with-ima-policy.patch
 drm-ttm-fix-locking-in-vmap-vunmap-ttm-gem-helpers.patch
 bus-mhi-host-pci_generic-add-telit-fn980-v1-hardware-revision.patch
 bus-mhi-host-pci_generic-add-telit-fn990.patch
+revert-selftest-vm-verify-remap-destination-address-in-mremap_test.patch
+revert-selftest-vm-verify-mmap-addr-in-mremap_test.patch