linux/arch/x86
Linus Torvalds 798dec3304 x86-64: mm: clarify the 'positive addresses' user address rules
Dave Hansen found the "(long) addr >= 0" code in the x86-64 access_ok
checks somewhat confusing, and suggested using a helper to clarify what
the code is doing.

So this does exactly that: clarifying what the sign bit check is all
about, by adding a helper macro that makes it clear what it is testing.

This also adds some explicit comments talking about how even with LAM
enabled, any addresses with the sign bit will still GP-fault in the
non-canonical region just above the sign bit.

This is all what allows us to do the user address checks with just the
sign bit, and furthermore be a bit cavalier about accesses that might be
done with an additional offset even past that point.

(And yes, this talks about 'positive' even though zero is also a valid
user address and so technically we should call them 'non-negative'.  But
I don't think using 'non-negative' ends up being more understandable).

Suggested-by: Dave Hansen <dave.hansen@intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2023-05-03 10:37:22 -07:00
..
boot * Do conditional __tdx_hypercall() 'output' processing via an 2023-04-28 09:36:09 -07:00
coco * Do conditional __tdx_hypercall() 'output' processing via an 2023-04-28 09:36:09 -07:00
configs
crypto modules-6.4-rc1 2023-04-27 16:36:55 -07:00
entry Objtool changes for v6.4: 2023-04-28 14:02:54 -07:00
events Perf changes for v6.4: 2023-04-28 14:41:53 -07:00
hyperv Objtool changes for v6.4: 2023-04-28 14:02:54 -07:00
ia32 x86/signal/32: Merge native and compat 32-bit signal code 2022-10-19 09:58:49 +02:00
include x86-64: mm: clarify the 'positive addresses' user address rules 2023-05-03 10:37:22 -07:00
kernel IOMMU Updates for Linux 6.4 2023-04-30 13:00:38 -07:00
kvm s390: 2023-05-01 12:06:20 -07:00
lib Objtool changes for v6.4: 2023-04-28 14:02:54 -07:00
math-emu
mm x86-64: mm: clarify the 'positive addresses' user address rules 2023-05-03 10:37:22 -07:00
net bpf, x86: Simplify the parsing logic of structure parameters 2023-01-10 15:53:22 -08:00
pci pci-v6.4-changes 2023-04-27 10:45:30 -07:00
platform Objtool changes for v6.4: 2023-04-28 14:02:54 -07:00
power x86/cpu: Mark {hlt,resume}_play_dead() __noreturn 2023-04-14 17:31:27 +02:00
purgatory purgatory: fix disabling debug info 2023-04-08 19:36:53 +09:00
ras
realmode x86/boot: Skip realmode init code when running as Xen PV guest 2022-11-25 12:05:22 +01:00
tools ELF: fix all "Elf" typos 2023-04-08 13:45:37 -07:00
um This pull request contains the following changes for UML: 2023-03-01 09:13:00 -08:00
video
virt/vmx/tdx
xen Objtool changes for v6.4: 2023-04-28 14:02:54 -07:00
.gitignore
Kbuild
Kconfig Add support for new Linear Address Masking CPU feature. This is similar 2023-04-28 09:43:49 -07:00
Kconfig.assembler crypto: x86/aria-avx - fix build failure with old binutils 2023-01-20 18:29:31 +08:00
Kconfig.cpu
Kconfig.debug docs: move x86 documentation into Documentation/arch/ 2023-03-30 12:58:51 -06:00
Makefile x86/build: Make 64-bit defconfig the default 2023-02-15 14:20:17 +01:00
Makefile_32.cpu
Makefile.um um: Only disable SSE on clang to work around old GCC bugs 2023-04-04 09:57:05 +02:00