[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4A05BD77.9020003@lwfinger.net>
Date: Sat, 09 May 2009 12:29:27 -0500
From: Larry Finger <Larry.Finger@...inger.net>
To: Greg KH <greg@...ah.com>
CC: Eric Valette <eric.valette@...e.fr>,
FUJITA Tomonori <fujita.tomonori@....ntt.co.jp>,
"John W. Linville" <linville@...driver.com>,
linux-wireless@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-usb@...r.kernel.org, Hin-Tak Leung <hintak.leung@...il.com>
Subject: Re: DMA debug trace pointing to rtl8187
Greg KH wrote:
>
> The problem is in the rtl8187 driver.
>
> They are calling usb_control_msg and passing a pointer to a buffer on
> the stack. See drivers/net/wireless/rtl818x/rtl8187.h for where the
> problem happens in numerous places.
>
> Also it looks like rtl8225_write_8051() is incorrect. You are passing a
> pointer to a variable that was passed as an argument. I don't know
> where that is supposed to be on, somewhere on the stack I guess.
>
> Larry, care to fix this up?
Yes, I'll try to fix it. I'm currently traveling and have intermittent Internet
access.
I think there is a second problem that John's fix does not treat. Although the
buffer is removed from the stack, there is no assurance that the buffer obtained
with kmalloc() is reachable by DMA. This case will be triggered if the USB
adapter does 32-bit DMA and the system has more than 4 GB RAM.
Please let me know if my analysis is wrong. If so, then John's patch will be
fine, although the error handling should be improved. The severity should be
that of a warning rather than a bug. If I'm correct, my fix would be to allocate
a DMA-reachable buffer in the initialization and keep a pointer to it in the
private area.
I just saw John's version 2 that looks more like what I was thinking about. I
will be testing soon.
Thanks,
Larry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists