diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2026-10-19 19:23:28 -1000 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2026-10-19 19:23:28 -1000 |
| commit | 9ef61ff7ca4cad2194eb3fd3de99a200f4038833 (patch) | |
| tree | 91e8018c13c2fc668cce8e5e19d240401a4bb21b /scripts/Makefile.thinlto | |
| parent | 678a0299d81c2ce8ef12f55ef7a722026b38a6e0 (diff) | |
| download | linux-9ef61ff7ca4cad2194eb3fd3de99a200f4038833.tar.gz linux-9ef61ff7ca4cad2194eb3fd3de99a200f4038833.zip | |
syscall_user_dispatch: Use get_user() for the selector
syscall_user_dispatch() reads the selector byte with __get_user(),
relying on an access_ok() done once at prctl time when the selector
address was set. So the pointer being dereferenced was validated in a
different system call, and the separation saves nothing anyway:
__get_user() still enables and disables user access, and on x86 it does
an lfence that get_user() avoids.
Use get_user(), and drop the comment explaining why the unchecked access
was safe.
The selector may be a tagged address. The prctl-time check is done on
untagged_addr(selector), but it is the tagged pointer that gets stored,
and __get_user() never checked it. get_user() does, and on x86 with LAM
a tagged pointer fails its range check. So untag it at the point of use
as well. The prctl-time check stays, so a bad address is still reported
when it is set.
This is part of getting rid of __get_user() and __put_user() entirely.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
