Re: [PATCH] x86/uaccess: small optimization in unsafe_copy_to_user()

From: Linus Torvalds
Date: Sat Apr 17 2021 - 15:51:49 EST


On Sat, Apr 17, 2021 at 12:44 PM Eric Dumazet <edumazet@xxxxxxxxxx> wrote:
>
> I thought put_cmsg() callers were from the kernel, with no possibility
> for user to abuse this interface trying to push GB of data.

My point is that "I thought" is not good enough for the unsafe interfaces.

It needs to be "I can see that the arguments are properly verified".

That is literally why they are called "unsafe". You need to make the
uses obviously safe. Because the functions themselves don't do that.

Linus