[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1535361211.9321.6.camel@suse.com>
Date: Mon, 27 Aug 2018 11:13:31 +0200
From: Oliver Neukum <oneukum@...e.com>
To: "Gustavo A. R. Silva" <gustavo@...eddedor.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Kees Cook <keescook@...omium.org>, linux-kernel@...r.kernel.org,
linux-usb@...r.kernel.org
Subject: Re: [PATCH v2] usb: iowarrior: replace kmalloc with kmalloc_array
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
Powered by blists - more mailing lists