From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753145Ab1HAUAF (ORCPT ); Mon, 1 Aug 2011 16:00:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42751 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752192Ab1HAT74 (ORCPT ); Mon, 1 Aug 2011 15:59:56 -0400 Date: Mon, 1 Aug 2011 15:59:50 -0400 From: Josh Boyer To: Oliver Neukum Cc: Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: cdc_ncm uses stack memory for DMA Message-ID: <20110801195949.GB2096@zod.bos.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, We've gotten a report that the cdc_ncm driver generates a stacktrace due to using stack variables that are passed to cdc_ncm_do_request. You can find the stack trace here: https://bugzilla.redhat.com/show_bug.cgi?id=720128 It's generated by lib/dma-debug.c and we have CONFIG_DMA_API_DEBUG set in our development kernels. Looking through the code, it seems that cdc_ncm_setup is still passing stack variables around lines 270, 276, 375, and 406. Which of those exactly is triggering the backtrace, I'm not sure but all of them seem incorrect from what I can tell. Do you have any thoughts on a solution for this? Off the top of my head, either the local variables being used could be added to the ctx structure or the variables can be changed to pointers and then be allocated via kmalloc and torn down shortly after. josh