Re: [PATCH][next] nouveau/svm: Use kvcalloc() instead of kvzalloc()

From: Gustavo A. R. Silva
Date: Thu Oct 28 2021 - 13:33:21 EST


On Thu, Oct 21, 2021 at 10:03:19AM -0700, Kees Cook wrote:
> On Wed, Sep 29, 2021 at 05:28:47AM +0200, Karol Herbst wrote:
> > Lack of documentation inside Linux here is a bit annoying, but do I
> > understand it correctly, that the main (and probably only) difference
> > is that kvcalloc checks whether the multiplication overflows and
> > returns NULL in this case?
>
> That's correct. :)
>
> > On Wed, Sep 29, 2021 at 12:21 AM Gustavo A. R. Silva
> > <gustavoars@xxxxxxxxxx> wrote:
> > >
> > > Use 2-factor argument form kvcalloc() instead of kvzalloc().
> > >
> > > Link: https://github.com/KSPP/linux/issues/162
> > > Signed-off-by: Gustavo A. R. Silva <gustavoars@xxxxxxxxxx>
>
> Reviewed-by: Kees Cook <keescook@xxxxxxxxxxxx>

I'll take this in my -next tree.

Thanks
--
Gustavo