From patchwork Sun Jan 17 23:07:38 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 73561 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o0HN7n2m001838 for ; Sun, 17 Jan 2010 23:07:49 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754235Ab0AQXHs (ORCPT ); Sun, 17 Jan 2010 18:07:48 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754217Ab0AQXHr (ORCPT ); Sun, 17 Jan 2010 18:07:47 -0500 Received: from fg-out-1718.google.com ([72.14.220.155]:38334 "EHLO fg-out-1718.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754139Ab0AQXHq (ORCPT ); Sun, 17 Jan 2010 18:07:46 -0500 Received: by fg-out-1718.google.com with SMTP id 22so385765fge.1 for ; Sun, 17 Jan 2010 15:07:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:received:received:received :from:to:subject:date:user-agent:cc:mime-version:content-type :content-transfer-encoding:message-id; bh=uGsyajKAaqXubPyX3O6eGHSDJTOWUx8XrWVkOAIPpLs=; b=Xdguz9x663r7DbRPL5qjsy4rB9bDff5mCKo1KBLGisctUxeFURDvcF/J8PczT8GElN wKi0HVtWFDzAXUmTlzSytxrGFRQQEeQjFve/p5CeV+9WxIEpf2F1J+OGL5AK7N1xgIVz LM9pW+SiJvdNKBGthVQQ4yPiZn+tlyesYevx4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=from:to:subject:date:user-agent:cc:mime-version:content-type :content-transfer-encoding:message-id; b=bdRssWvKDfDGoRRgvGKoOJr0LnftHJWBLxZ99tm41hTRXB4023Nu/OZVyLBtjnhptH 7zBfl8JH9JKMzCZoOZLA6nZb1Qdt7hIzXUpL5l538CgFY9c86aIpail7V8GemlsEdwkv I0EUm7K6DTwVpB/oSptYBWpQLPwVxNcWhqWqE= Received: by 10.87.62.20 with SMTP id p20mr6647873fgk.7.1263769665437; Sun, 17 Jan 2010 15:07:45 -0800 (PST) Received: from blech.mobile (nat-wh.rz.uni-karlsruhe.de [129.13.72.197]) by mx.google.com with ESMTPS id e20sm9861539fga.22.2010.01.17.15.07.44 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 17 Jan 2010 15:07:44 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by blech.mobile (Postfix) with ESMTP id 050CA341E23; Mon, 18 Jan 2010 00:07:44 +0100 (CET) Received: from blech.mobile ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WoMzpZxJDDDO; Mon, 18 Jan 2010 00:07:40 +0100 (CET) Received: from blech.mobile (localhost [127.0.0.1]) by blech.mobile (Postfix) with ESMTP id CF980341D76; Mon, 18 Jan 2010 00:07:39 +0100 (CET) From: Christian Lamparter To: linux-wireless@vger.kernel.org Subject: [PATCH] p54pci: rx frame length check Date: Mon, 18 Jan 2010 00:07:38 +0100 User-Agent: KMail/1.12.4 (Linux/2.6.33-rc3-x-wl; KDE/4.3.4; x86_64; ; ) Cc: John W Linville MIME-Version: 1.0 Message-Id: <201001180007.38948.chunkeey@googlemail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org diff --git a/drivers/net/wireless/p54/p54pci.c b/drivers/net/wireless/p54/p54pci.c index a227c3d..48cae48 100644 --- a/drivers/net/wireless/p54/p54pci.c +++ b/drivers/net/wireless/p54/p54pci.c @@ -205,6 +205,14 @@ static void p54p_check_rx_ring(struct ieee80211_hw *dev, u32 *index, i %= ring_limit; continue; } + + if (unlikely(len > priv->common.rx_mtu)) { + if (net_ratelimit()) + dev_err(&priv->pdev->dev, "rx'd frame size " + "exceeds length threshold.\n"); + + len = priv->common.rx_mtu; + } skb_put(skb, len); if (p54_rx(dev, skb)) {