lkml.org 
[lkml]   [2018]   [Aug]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2] usb: iowarrior: replace kmalloc with kmalloc_array
From
Date
On Do, 2018-08-23 at 12:44 -0500,  Gustavo A. R. Silva  wrote:
> A common flaw in the kernel is integer overflow during memory allocation
> size calculations. In an effort to reduce the frequency of these bugs,
> kmalloc_array was implemented, which allocates memory for an array,
> while at the same time detects integer overflow.
>
> This patch replaces cases of:
>
> kmalloc(a * b, gfp)
>
> with:
> kmalloc_array(a * b, gfp)

I am afraid there is a problem here. The driver currently is a gross
violation of the DMA rules. Unfortunately your patch does not fix that.

That is on anyrhing other than x86 you cannot take the size of a
report,
but you must use the size of a cache line.

Regards
Oliver

\
 
 \ /
  Last update: 2018-08-27 11:22    [W:0.033 / U:35.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site