]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 16 Jul 2023 18:54:44 +0000 (20:54 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 16 Jul 2023 18:54:44 +0000 (20:54 +0200)
added patches:
sh-pgtable-3level-fix-cast-to-pointer-from-integer-of-different-size.patch

queue-5.10/series
queue-5.10/sh-pgtable-3level-fix-cast-to-pointer-from-integer-of-different-size.patch [new file with mode: 0644]

index 6e2f36d521d58c1947c1a2db7cac24ab9ac37e94..1ab45bd7e2b4360c56055c211c2cd8842f7d5f17 100644 (file)
@@ -314,3 +314,4 @@ selftests-bpf-add-verifier-test-for-ptr_to_mem-spill.patch
 block-add-overflow-checks-for-amiga-partition-support.patch
 mips-dts-ci20-raise-vddcore-voltage-to-1.125-volts.patch
 io_uring-use-io_schedule-in-cqring-wait.patch
+sh-pgtable-3level-fix-cast-to-pointer-from-integer-of-different-size.patch
diff --git a/queue-5.10/sh-pgtable-3level-fix-cast-to-pointer-from-integer-of-different-size.patch b/queue-5.10/sh-pgtable-3level-fix-cast-to-pointer-from-integer-of-different-size.patch
new file mode 100644 (file)
index 0000000..37ad158
--- /dev/null
@@ -0,0 +1,49 @@
+From 8518e694203d0bfd202ea4a80356785b6992322e Mon Sep 17 00:00:00 2001
+From: Geert Uytterhoeven <geert+renesas@glider.be>
+Date: Wed, 15 Sep 2021 15:50:04 +0200
+Subject: sh: pgtable-3level: Fix cast to pointer from integer of different size
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Geert Uytterhoeven <geert+renesas@glider.be>
+
+commit 8518e694203d0bfd202ea4a80356785b6992322e upstream.
+
+If X2TLB=y (CPU_SHX2=y or CPU_SHX3=y, e.g. migor_defconfig), pgd_t.pgd
+is "unsigned long long", causing:
+
+    In file included from arch/sh/include/asm/pgtable.h:13,
+                    from include/linux/pgtable.h:6,
+                    from include/linux/mm.h:33,
+                    from arch/sh/kernel/asm-offsets.c:14:
+    arch/sh/include/asm/pgtable-3level.h: In function ‘pud_pgtable’:
+    arch/sh/include/asm/pgtable-3level.h:37:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
+       37 |  return (pmd_t *)pud_val(pud);
+         |         ^
+
+Fix this by adding an intermediate cast to "unsigned long", which is
+basically what the old code did before.
+
+Fixes: 9cf6fa2458443118 ("mm: rename pud_page_vaddr to pud_pgtable and make it return pmd_t *")
+Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
+Tested-by: Daniel Palmer <daniel@thingy.jp>
+Acked-by: Rob Landley <rob@landley.net>
+Tested-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
+Signed-off-by: Rich Felker <dalias@libc.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ arch/sh/include/asm/pgtable-3level.h |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/sh/include/asm/pgtable-3level.h
++++ b/arch/sh/include/asm/pgtable-3level.h
+@@ -34,7 +34,7 @@ typedef struct { unsigned long long pmd;
+ static inline pmd_t *pud_pgtable(pud_t pud)
+ {
+-      return (pmd_t *)pud_val(pud);
++      return (pmd_t *)(unsigned long)pud_val(pud);
+ }
+ /* only used by the stubbed out hugetlb gup code, should never be called */