Thread (14 messages) read the whole thread 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: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2020-01-23 18:02:55
Also in: dri-devel, linux-fsdevel, linux-mm, lkml

On Thu, Jan 23, 2020 at 4:59 AM Christophe Leroy
[off-list ref] wrote:
On 32 bits powerPC (book3s/32), only write accesses to user are
protected and there is no point spending time on unlocking for reads.
Honestly, I'm starting to think that 32-bit ppc just needs to look
more like everybody else, than make these changes.

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.

But if we really do want to do this, then:
Add an argument to user_access_begin() to tell when it's for write and
return an opaque key that will be used by user_access_end() to know
what was done by user_access_begin().
You should make it more opaque than "unsigned long".

Also, it shouldn't be a "is this a write". What if it's a read _and_ a
write? Only a write? Only a read?

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