]> www.infradead.org Git - users/hch/misc.git/commit
arm64: access_ok() optimization arm64-uaccess
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 9 Jun 2024 17:14:24 +0000 (10:14 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 19 Jun 2024 19:33:38 +0000 (12:33 -0700)
commitd31e86ef6377cbd7e4bbf1e8ff472ff48e04c5d8
tree34924cf3fe4054596e236ef053ead3106ac6b18e
parent7fd298d4b39d8d5fe99d56811a7ed78c7a5377d5
arm64: access_ok() optimization

The TBI setup on arm64 is very strange: HW is set up to always do TBI,
but the kernel enforcement for system calls is purely a software
contract, and user space is supposed to mask off the top bits before the
system call.

Except all the actual brk/mmap/etc() system calls then mask it in kernel
space anyway, and accept any TBI address.

This basically unifies things and makes access_ok() also ignore it.

This is an ABI change, but the current situation is very odd, and this
change avoids the current mess and makes the kernel more permissive, and
as such is unlikely to break anything.

The way forward - for some possible future situation when people want to
use more bits - is probably to introduce a new "I actually want the full
64-bit address space" prctl.  But we should make sure that the software
and hardware rules actually match at that point.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/arm64/include/asm/uaccess.h