From patchwork Mon Oct 15 14:14:32 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanislav Yakovlev X-Patchwork-Id: 1592921 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id AE1D5DFB34 for ; Mon, 15 Oct 2012 09:09:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751752Ab2JOJJ1 (ORCPT ); Mon, 15 Oct 2012 05:09:27 -0400 Received: from mail-lb0-f174.google.com ([209.85.217.174]:44210 "EHLO mail-lb0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751639Ab2JOJJ1 (ORCPT ); Mon, 15 Oct 2012 05:09:27 -0400 Received: by mail-lb0-f174.google.com with SMTP id n3so3290437lbo.19 for ; Mon, 15 Oct 2012 02:09:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=VdUn+80B38ZFvapdbIhLnzTBHs/37BqlogQY85AfqbU=; b=GeTw6sSxbEzPUsYRGhhfjDS2Edl6DsNAFNyW99psVcuzdsFdEx0GPmU7gd0hKCG3WF Jx7zgkR6lk/FsAPp0+SBk1t1muHCrcBMlkia7SvhkIEipTNGUAcEqVl8yc0hFpn2KiE2 lZQFbfaQsraOvETA5mQwVvxXpZWSr/xX+chdPXNa4sZ6pWzB/3flFlLsuStqXot6yXbZ tD2Mjo2JmFnFz0uIL7FRlXfzyHoq0Q5J9QAra2GdZDFjmnmRwy7/Xf+asS7rGpWh2Hhp CCzIO0ssks0YVsdWGWJgEZW0MQHzTxSNlPZyuICkAJua77VCCaJZ4duoR7u/hcblxADp OlCg== Received: by 10.112.26.135 with SMTP id l7mr4091727lbg.84.1350292165437; Mon, 15 Oct 2012 02:09:25 -0700 (PDT) Received: from localhost.localdomain ([89.23.194.117]) by mx.google.com with ESMTPS id mq9sm4300003lab.0.2012.10.15.02.09.23 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 15 Oct 2012 02:09:24 -0700 (PDT) From: Stanislav Yakovlev To: linville@tuxdriver.com Cc: linux-wireless@vger.kernel.org, stable@kernel.org, linuxkbugs@vittgam.net, Stanislav Yakovlev Subject: [PATCH] net/wireless: ipw2200: Fix panic occurring in ipw_handle_promiscuous_tx() Date: Mon, 15 Oct 2012 14:14:32 +0000 Message-Id: <1350310472-602-1-git-send-email-stas.yakovlev@gmail.com> X-Mailer: git-send-email 1.7.11.7 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The driver does not count space of radiotap fields when allocating skb for radiotap packet. This leads to kernel panic with the following call trace: ... [67607.676067] [] error_code+0x67/0x6c [67607.676067] [] ? skb_put+0x91/0xa0 [67607.676067] [] ? ipw_handle_promiscuous_tx+0x16b/0x2d0 [ipw2200] [67607.676067] [] ipw_handle_promiscuous_tx+0x16b/0x2d0 [ipw2200] [67607.676067] [] ipw_net_hard_start_xmit+0x8b/0x90 [ipw2200] [67607.676067] [] libipw_xmit+0x55a/0x980 [libipw] [67607.676067] [] dev_hard_start_xmit+0x218/0x4d0 ... This bug was found by VittGam. https://bugzilla.kernel.org/show_bug.cgi?id=43255 Cc: stable@kernel.org Signed-off-by: Stanislav Yakovlev --- drivers/net/wireless/ipw2x00/ipw2200.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c index 935120f..768bf61 100644 --- a/drivers/net/wireless/ipw2x00/ipw2200.c +++ b/drivers/net/wireless/ipw2x00/ipw2200.c @@ -10472,7 +10472,7 @@ static void ipw_handle_promiscuous_tx(struct ipw_priv *priv, } else len = src->len; - dst = alloc_skb(len + sizeof(*rt_hdr), GFP_ATOMIC); + dst = alloc_skb(len + sizeof(*rt_hdr) + sizeof(u16)*2, GFP_ATOMIC); if (!dst) continue;