lkml.org 
[lkml]   [2015]   [Jun]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] x86: fix incomplete clear by clear_user()

* Alexey Dobriyan <adobriyan@gmail.com> wrote:

> clear_user() used MOVQ+MOVB and if MOVQ faults, code simply exits and
> honestly returns remaining length. In case of unaligned area, unaligned
> remainder would count towards return value (correctly) but not cleared
> (lazy code at least):
>
> clear_user(p + 4096 - 4, 8) = 8
>
> No one would have noticed but REP MOVSB addition to clear_user()
> repertoire creates a problem: REP MOVSB does everything correctly,
> clears and counts to the last possible byte, but REP STOSQ and MOVQ
> variants DO NOT:
>
> MOVQ clear_user(p + 4096 - 4, 8) = 8
> REP STOSQ clear_user(p + 4096 - 4, 8) = 8
> REP STOSB clear_user(p + 4096 - 4, 8) = 4
>
> Patch fixes incomplete clear on 32-bit and 64-bit REP STOSQ, MOVQ.

So please flip the order of the changes around so that we never have this
inconsistency observable: i.e. first update the existing clearing method, then
move it and introduce the new variants without having to patch them.

Thanks,

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2015-06-21 09:21    [W:0.056 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site