Re: [PATCH v2] cxgb4: do not dma memory off of the stack

From: Jason Gunthorpe
Date: Fri Oct 04 2019 - 14:16:52 EST


On Tue, Oct 01, 2019 at 06:56:11PM +0200, Greg KH wrote:
> Nicolas pointed out that the cxgb4 driver is doing dma off of the stack,
> which is generally considered a very bad thing. On some architectures
> it could be a security problem, but odds are none of them actually run
> this driver, so it's just a "normal" bug.
>
> Resolve this by allocating the memory for a message off of the heap
> instead of the stack. kmalloc() always will give us a proper memory
> location that DMA will work correctly from.
>
> Reported-by: Nicolas Waisman <nico@xxxxxxxxxx>
> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

Applied to for-rc, thanks

Jason