linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] arm64: compat: Reduce address limit
@ 2019-03-19 15:15 Vincenzo Frascino
  2019-03-19 15:15 ` [PATCH 1/5] arm64: compat: Alloc separate pages for vectors and sigpage Vincenzo Frascino
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Vincenzo Frascino @ 2019-03-19 15:15 UTC (permalink / raw)
  To: linux-arch, linux-arm-kernel
  Cc: Mark Rutland, Catalin Marinas, Will Deacon, Jann Horn

This patchset reduces the size of the user-accessible address space
for compat tasks by a page.

Currently, compat tasks running on arm64 can allocate memory up to
TASK_SIZE_32 (UL(0x100000000)).

This means that mmap() allocations, if we treat them as returning an
array, are not compliant with the sections 6.5.8 of the C standard
(C99) which states that: "If the expression P points to an element of
an array object and the expression Q points to the last element of the
same array object, the pointer expression Q+1 compares greater than P".

A solution to this problem is to reduce TASK_SIZE_32 of a page.

But, in the current implementation, compat installs a special page
called "[vectors]" that contains sigreturn trampolines and kuser
helpers, and this is done at fixed address specified by the kuser
helpers ABI (0xffff0000) which overlaps with the last page when 64K
pages are enabled.

This patchset address the issue creating separate pages for vectors
and sigpage in a similar way to what happens today on arm and
disabling kuser helpers when 64K pages are enabled.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Jann Horn <jannh@google.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>

Vincenzo Frascino (5):
  arm64: compat: Alloc separate pages for vectors and sigpage
  arm64: compat: Split kuser32
  arm64: compat: Refactor aarch32_alloc_vdso_pages()
  arm64: compat: Add KUSER_HELPERS config option
  arm64: compat: Reduce address limit

 arch/arm64/Kconfig                 |  31 ++++++
 arch/arm64/include/asm/elf.h       |   6 +-
 arch/arm64/include/asm/processor.h |   6 +-
 arch/arm64/include/asm/signal32.h  |   2 -
 arch/arm64/kernel/Makefile         |   5 +-
 arch/arm64/kernel/kuser32.S        |  65 +------------
 arch/arm64/kernel/signal32.c       |   5 +-
 arch/arm64/kernel/sigreturn32.S    |  46 +++++++++
 arch/arm64/kernel/vdso.c           | 150 +++++++++++++++++++++++------
 9 files changed, 213 insertions(+), 103 deletions(-)
 create mode 100644 arch/arm64/kernel/sigreturn32.S

-- 
2.21.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-04-01  9:13 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-19 15:15 [PATCH 0/5] arm64: compat: Reduce address limit Vincenzo Frascino
2019-03-19 15:15 ` [PATCH 1/5] arm64: compat: Alloc separate pages for vectors and sigpage Vincenzo Frascino
2019-03-29 12:12   ` Catalin Marinas
2019-04-01  9:00     ` Vincenzo Frascino
2019-03-19 15:15 ` [PATCH 2/5] arm64: compat: Split kuser32 Vincenzo Frascino
2019-03-19 15:15 ` [PATCH 3/5] arm64: compat: Refactor aarch32_alloc_vdso_pages() Vincenzo Frascino
2019-03-19 15:15 ` [PATCH 4/5] arm64: compat: Add KUSER_HELPERS config option Vincenzo Frascino
2019-03-29 12:22   ` Catalin Marinas
2019-03-19 15:15 ` [PATCH 5/5] arm64: compat: Reduce address limit Vincenzo Frascino
2019-03-29 15:59   ` Catalin Marinas
2019-04-01  9:13     ` Vincenzo Frascino

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).