Thread (61 messages) 61 messages, 12 authors, 2022-02-16

RE: [PATCH 04/14] x86: use more conventional access_ok() definition

From: David Laight <hidden>
Date: 2022-02-14 22:13:43
Also in: linux-alpha, linux-api, linux-arch, linux-m68k, linux-mm, linux-riscv, linux-s390, linux-sh, linux-um, linuxppc-dev, lkml, sparclinux

From: Linus Torvalds
Sent: 14 February 2022 20:24
quoted
x86-64 has always(*) used TASK_SIZE_MAX for access_ok(), and the
get_user() assembler implementation does the same.
Side note: we could just check the sign bit instead, and avoid big
constants that way.
The cheap test for most 64bit is (addr | size) >> 62 != 0.

I did some tests last week and the compilers correctly optimise
out constant size.

Doesn't sparc64 still need a wrap test?
Or is that assumed because there is always an unmapped page
and transfer are 'adequately' done on increasing addresses?

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help