Messages in this thread | | | Date | Sat, 16 Nov 2013 22:51:41 -0800 | From | "H. Peter Anvin" <> | Subject | Re: [tip:x86/asm] x86-64, copy_user: Remove zero byte check before copy user buffer. |
| |
On 11/16/2013 10:44 PM, Linus Torvalds wrote: > So this doesn't do the 32-bit truncation in the error path of the generic > string copy. Oversight? > > Linus
Indeed... although in the kernel it seems to be taken as an invariant that copy lengths over 4G is simply prohibited. There are places all over the kernel which will fail in a massive way if we ever ended up with a copy over 4G in size.
As such, I would argue the code with the patch is actually no more broken than with the truncation in place; if anything it is *more* correct than the modified one, since for a (very small) subset of >=4G copies it will actually do the right thing, albeit slowly.
The truncations do make me twitch a little inside, I have to admit.
-hpa
| |