RE: [RFC] raw_copy_from_user() semantics

2020-07-23 Thread David Laight
From: Catalin Marinas > Sent: 23 July 2020 11:19 > On Thu, Jul 23, 2020 at 08:37:27AM +, David Laight wrote: > > From: Catalin Marinas > > > Sent: 22 July 2020 17:54 > > > On Wed, Jul 22, 2020 at 01:14:21PM +, David Laight wrote: > > > > From: Catalin Marinas > > > > > Sent: 22 July 2020

Re: [RFC] raw_copy_from_user() semantics

2020-07-23 Thread Catalin Marinas
On Thu, Jul 23, 2020 at 08:37:27AM +, David Laight wrote: > From: Catalin Marinas > > Sent: 22 July 2020 17:54 > > On Wed, Jul 22, 2020 at 01:14:21PM +, David Laight wrote: > > > From: Catalin Marinas > > > > Sent: 22 July 2020 12:37 > > > > On Sun, Jul 19, 2020 at 12:34:11PM -0700, Linus

RE: [RFC] raw_copy_from_user() semantics

2020-07-23 Thread David Laight
From: Catalin Marinas > Sent: 22 July 2020 17:54 > > On Wed, Jul 22, 2020 at 01:14:21PM +, David Laight wrote: > > From: Catalin Marinas > > > Sent: 22 July 2020 12:37 > > > On Sun, Jul 19, 2020 at 12:34:11PM -0700, Linus Torvalds wrote: > > > > On Sun, Jul 19, 2020 at 12:28 PM Linus Torvalds

Re: [RFC] raw_copy_from_user() semantics

2020-07-22 Thread Catalin Marinas
On Wed, Jul 22, 2020 at 01:14:21PM +, David Laight wrote: > From: Catalin Marinas > > Sent: 22 July 2020 12:37 > > On Sun, Jul 19, 2020 at 12:34:11PM -0700, Linus Torvalds wrote: > > > On Sun, Jul 19, 2020 at 12:28 PM Linus Torvalds > > > wrote: > > > > I think we should try to get rid of the

RE: [RFC] raw_copy_from_user() semantics

2020-07-22 Thread David Laight
From: Catalin Marinas > Sent: 22 July 2020 12:37 > > On Sun, Jul 19, 2020 at 12:34:11PM -0700, Linus Torvalds wrote: > > On Sun, Jul 19, 2020 at 12:28 PM Linus Torvalds > > wrote: > > > I think we should try to get rid of the exact semantics. > > > > Side note: I think one of the historical

Re: [RFC] raw_copy_from_user() semantics

2020-07-22 Thread Catalin Marinas
On Sun, Jul 19, 2020 at 12:34:11PM -0700, Linus Torvalds wrote: > On Sun, Jul 19, 2020 at 12:28 PM Linus Torvalds > wrote: > > I think we should try to get rid of the exact semantics. > > Side note: I think one of the historical reasons for the exact > semantics was that we used to do things

Re: [RFC] raw_copy_from_user() semantics

2020-07-19 Thread Linus Torvalds
On Sun, Jul 19, 2020 at 12:28 PM Linus Torvalds wrote: > > I think we should try to get rid of the exact semantics. Side note: I think one of the historical reasons for the exact semantics was that we used to do things like the mount option copying with a "copy_from_user()" iirc. And that could

Re: [RFC] raw_copy_from_user() semantics

2020-07-19 Thread Linus Torvalds
On Sat, Jul 18, 2020 at 8:17 PM Al Viro wrote: > > So any byte-squeezing loop of that sort would break on a bunch > of architectures. I think we should try to get rid of the exact semantics. If "copy_from/to_user()" takes a fault because it does a larger-than-byte access (and with

[RFC] raw_copy_from_user() semantics

2020-07-18 Thread Al Viro
Back in 2017 I'd made a bogus promise regarding raw_copy_from_user(). Namely, that in case of short copy it will copy at least something unless nothing could've been read at all. Such property could've been used by code that would want to squeeze every byte, by doing