From patchwork Fri Aug 24 16:23:52 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 1372091 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id D4DB53FC81 for ; Fri, 24 Aug 2012 16:24:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759726Ab2HXQYB (ORCPT ); Fri, 24 Aug 2012 12:24:01 -0400 Received: from mail-bk0-f46.google.com ([209.85.214.46]:37271 "EHLO mail-bk0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752060Ab2HXQX6 (ORCPT ); Fri, 24 Aug 2012 12:23:58 -0400 Received: by bkwj10 with SMTP id j10so659337bkw.19 for ; Fri, 24 Aug 2012 09:23:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; bh=UxQUsPvtYc2yl83Dz449Uqhc6Lg80Cdj3wlgxaBQGGg=; b=bb6wux/D5ef+BNy3sxBscD4e422UGt2uvZzgOl1q2CPo4K1rNMY4iPCrLSz1GD0cPD aUj41+iymsa6s14/8efSTyjB8UjcknTQ4oBbL9hOQO5btO6Gb4vPUVii378GBQ2F7ne3 txYEMnCYjBtbP4sNezjtDzCKHrGCDDfvbMTGgNMGog0FGuoh+FfzU6CelLSIKmFsctYk V/XW7SYBHO/mQySi+8yGTb+uKI0tvonvX7PW0AFFhek7ymeXfR+qmMrAZjKMkpK3bA94 n/TBrRFzkT89JjXmMTQRJX1nV9WAfsEi/eSgLtehZxnGz7WFchttOdJjKMoeXA3uEdY9 Vb7A== Received: by 10.204.154.151 with SMTP id o23mr2252030bkw.77.1345825437133; Fri, 24 Aug 2012 09:23:57 -0700 (PDT) Received: from [172.28.90.118] ([74.125.122.49]) by mx.google.com with ESMTPS id y20sm6671639bkv.11.2012.08.24.09.23.53 (version=SSLv3 cipher=OTHER); Fri, 24 Aug 2012 09:23:53 -0700 (PDT) Subject: Re: Regression associated with commit c8628155ece3 - "tcp: reduce out_of_order memory use" From: Eric Dumazet To: Larry Finger Cc: David Miller , ncardwell@google.com, linville@tuxdriver.com, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <1345825095.19483.19.camel@edumazet-glaptop> References: <50369925.3050705@lwfinger.net> <1345757200.5904.1890.camel@edumazet-glaptop> <50378B35.80307@lwfinger.net> <20120824.111948.680531915905273128.davem@davemloft.net> <5037A4B0.3080208@lwfinger.net> <1345825095.19483.19.camel@edumazet-glaptop> Date: Fri, 24 Aug 2012 18:23:52 +0200 Message-ID: <1345825432.19483.20.camel@edumazet-glaptop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Fri, 2012-08-24 at 18:18 +0200, Eric Dumazet wrote: > On Fri, 2012-08-24 at 10:58 -0500, Larry Finger wrote: > > On 08/24/2012 10:19 AM, David Miller wrote: > > > > > > This looks like full-on data corruption to me. > > > > I agree. The question is why does it happen with r8712u, and only after the > > commit in the subject. Drivers for other devices that I have are OK. Thus far, I > > have tested b43, rtl8187, ath9k_htc, and rtl8192cu. To my knowledge, there are > > no reports posted for this bug with any other device. > > bugs can sit unnoticed, and one change somewhere can uncover them. > > Really this driver must have a bug, if not half a dozen of bugs. > > For example this sequence of code is a clear bug : > > sub_skb = dev_alloc_skb(nSubframe_Length + 12); > skb_reserve(sub_skb, 12); > > > Also the free_recv_skb_queue looks really suspect to me > > What the hell is doing recv_tasklet() I really wonder. > > This code, combined with the skb_clone() in recvbuf2recvframe() > can clearly reuse an skb passed to upper stacks. > > > queueing one skb in free_recv_skb_queue should be done > only if no clone of this skb exist somewhere. > > Please someone fix this buggy driver. > Try the following patch for a start --- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/staging/rtl8712/rtl8712_recv.c b/drivers/staging/rtl8712/rtl8712_recv.c index 8e82ce2..88e3ca6 100644 --- a/drivers/staging/rtl8712/rtl8712_recv.c +++ b/drivers/staging/rtl8712/rtl8712_recv.c @@ -1127,6 +1127,9 @@ static void recv_tasklet(void *priv) recvbuf2recvframe(padapter, pskb); skb_reset_tail_pointer(pskb); pskb->len = 0; - skb_queue_tail(&precvpriv->free_recv_skb_queue, pskb); + if (!skb_cloned(pskb)) + skb_queue_tail(&precvpriv->free_recv_skb_queue, pskb); + else + consume_skb(pskb); } }