diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2026-10-19 19:23:20 -1000 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2026-10-19 19:23:20 -1000 |
| commit | edc483b611264ec6fd3b522a477d5fb1250299da (patch) | |
| tree | 0abf464a0d96998bec27fc89616fa9203d3785f9 /scripts/Makefile.thinlto | |
| parent | ae78eff333746326e630e505d7fac0d237e644ef (diff) | |
| download | linux-edc483b611264ec6fd3b522a477d5fb1250299da.tar.gz linux-edc483b611264ec6fd3b522a477d5fb1250299da.zip | |
ptrace: use plain get_user()/put_user() for the regset iovec
PTRACE_GETREGSET and PTRACE_SETREGSET do an access_ok() on the user
iovec, read its two fields with __get_user(), and once the regset has
been transferred write the length back with __put_user(). Each of those
accesses enables and disables user access on its own, so the up-front
check saves nothing. On x86, __get_user() is even more expensive than
get_user(): it does an lfence, where get_user() checks the address with
a couple of plain instructions.
Just use get_user() and put_user(), and drop the access_ok(). Both
fields are read before anything else is done, so a bad pointer still
fails with -EFAULT up front.
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
