]> git.baikalelectronics.ru Git - kernel.git/commit
x86-64: make csum_partial_copy_from_user() error handling consistent
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 16 Nov 2014 19:00:42 +0000 (11:00 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 16 Nov 2014 19:00:42 +0000 (11:00 -0800)
commitff93d9f1642aa541b77c9991622f2ff6bc841418
treef17f7e5e63bc4b7afa9cc1f78b0816303eeb3584
parentd44c11aa17c75f4b601e5eb0b17301b3908d5aaf
x86-64: make csum_partial_copy_from_user() error handling consistent

Al Viro pointed out that the x86-64 csum_partial_copy_from_user() is
somewhat confused about what it should do on errors, notably it mostly
clears the uncopied end result buffer, but misses that for the initial
alignment case.

All users should check for errors, so it's dubious whether the clearing
is even necessary, and Al also points out that we should probably clean
up the calling conventions, but regardless of any future changes to this
function, the fact that it is inconsistent is just annoying.

So make the __get_user() failure path use the same error exit as all the
other errors do.

Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: David Miller <davem@davemloft.net>
Cc: Andi Kleen <andi@firstfloor.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/x86/lib/csum-wrappers_64.c