Re: [PATCH] lib/usercopy: fix sparse errors

From: Al Viro
Date: Sun Dec 17 2017 - 12:31:31 EST


> The change is good.
> The commit message would better simply describe the problem instead
> of describing the symptom. For example, something like:
> The function _copy_to_user() is used to copy to address space.
> As such, the destination pointer should be annotated with
> '__user'.
> However, the function has the annotation wrongly, on the
> source instead of the destination (copy & paste error?).
> Fix this by moving the __user annotation to the correct
> argument.

FWIW, I've committed it with

Fix misannotated out-of-line _copy_to_user()

Destination is a kernel pointer and source - a userland one
is _copy_from_user(); _copy_to_user() is the other way round.