Re: [PATCH] sched: core: remove access_ok() before copy_to_user()

From: Peter Zijlstra
Date: Tue Aug 16 2022 - 06:03:31 EST


On Mon, Aug 15, 2022 at 10:21:37PM +0800, Tuo Cao wrote:
> If usize > ksize, usize may be not valid and if(!access_ok()) will return
> -EFAULT. But ksize may be valid, copy_to_user() should be executed.And
> also, copy_to_user() will calls access_ok() to test whether a block of
> memory is a valid user space address.

I don't follow, why do you want this to continue if the user provided
garbage input?