Thread (14 messages) 14 messages, 6 authors, 2020-01-25

Re: [PATCH v3 2/7] uaccess: Tell user_access_begin() if it's for a write or not

From: Tony Luck <hidden>
Date: 2020-01-25 06:17:16
Also in: dri-devel, linux-fsdevel, linux-mm, lkml

On Thu, Jan 23, 2020 at 10:03 AM Linus Torvalds
[off-list ref] wrote:
We used to have a read/write argument to the old "verify_area()" and
"access_ok()" model, and it was a mistake. It was due to odd i386 user
access issues. We got rid of it. I'm not convinced this is any better
- it looks very similar and for odd ppc access issues.
If the mode (read or write) were made visible to the trap handler, I'd
find that useful for machine check recovery.  If I'm in the middle of a
copy_from_user() and I get a machine check reading poison from a
user address ... then I could try to recover in the same way as for the
user accessing the poison (offline the page, SIGBUS the task). But if
the poison is in kernel memory and we are doing a copy_to_user(), then
we are hosed (or would need some more complex recovery plan).

[Note that we only get recoverable machine checks on loads... writes
are posted, so if something goes wrong it isn't synchronous with the store
instruction that initiated it]

-Tony
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help