From 2d327101d18359f2c9b0e01a5c8aa62e0c8b44a5 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Fri, 16 Sep 2016 16:39:12 +0100 Subject: [PATCH] [arm64] mm: Limit TASK_SIZE_64 for compatibility --- debian/changelog | 1 + ...limit-task_size_64-for-compatibility.patch | 27 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 29 insertions(+) create mode 100644 debian/patches/bugfix/arm64/arm64-mm-limit-task_size_64-for-compatibility.patch diff --git a/debian/changelog b/debian/changelog index 8aca946c9..af97475cf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,6 +9,7 @@ linux (4.8~rc5-1~exp2) UNRELEASED; urgency=medium - Set -fdebug-prefix-map=... in compiler options for kernel and userland - linux-headers: Stop including unused arch/*/kernel/asm-offsets.s files * linux-doc: Exclude Sphinx support code and Makefiles + * [arm64] mm: Limit TASK_SIZE_64 for compatibility -- Ben Hutchings Fri, 16 Sep 2016 16:39:53 +0100 diff --git a/debian/patches/bugfix/arm64/arm64-mm-limit-task_size_64-for-compatibility.patch b/debian/patches/bugfix/arm64/arm64-mm-limit-task_size_64-for-compatibility.patch new file mode 100644 index 000000000..bc8423bec --- /dev/null +++ b/debian/patches/bugfix/arm64/arm64-mm-limit-task_size_64-for-compatibility.patch @@ -0,0 +1,27 @@ +From: Ben Hutchings +Date: Fri, 16 Sep 2016 16:32:23 +0100 +Subject: arm64/mm: Limit TASK_SIZE_64 for compatibility + +Some programs assume they can use 17 tag bits in a 64-bit pointer, +which works on most other 64-bit architectures but not on arm64 with +CONFIG_ARM64_VA_BITS_48. To maintain compatibility with these +programs, limit TASK_SIZE_64 to a maximum of 1 << 47. + +Signed-off-by: Ben Hutchings +--- + +--- a/arch/arm64/include/asm/memory.h ++++ b/arch/arm64/include/asm/memory.h +@@ -74,7 +74,12 @@ + #define PCI_IO_END (VMEMMAP_START - SZ_2M) + #define PCI_IO_START (PCI_IO_END - PCI_IO_SIZE) + #define FIXADDR_TOP (PCI_IO_START - SZ_2M) ++#if VA_BITS <= 47 + #define TASK_SIZE_64 (UL(1) << VA_BITS) ++#else ++/* User-space might use up to 17 tag bits in 64-bit pointers */ ++#define TASK_SIZE_64 (UL(1) << 47) ++#endif + + #ifdef CONFIG_COMPAT + #define TASK_SIZE_32 UL(0x100000000) diff --git a/debian/patches/series b/debian/patches/series index 51137e05f..e79729629 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -45,6 +45,7 @@ bugfix/x86/viafb-autoload-on-olpc-xo1.5-only.patch debian/fanotify-taint-on-use-of-fanotify_access_permissions.patch # Arch bug fixes +bugfix/arm64/arm64-mm-limit-task_size_64-for-compatibility.patch # Arch features features/mips/MIPS-increase-MAX-PHYSMEM-BITS-on-Loongson-3-only.patch