diff options
author | Christian Lamparter <chunkeey@googlemail.com> | 2010-01-17 18:07:38 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-01-18 15:07:02 -0500 |
commit | f5300e04df78feae8107c1846dd3a9e27c071b2f (patch) | |
tree | 82cb7d53d5c91b120c76daa82b334ee090ce4c36 /drivers/net/wireless/p54/p54pci.c | |
parent | e850f68b8f27a76c4377c34f2e216b8e7e10db3d (diff) |
p54pci: rx frame length check
A long time ago, a user reported several crashes due to
data corruptions which are likely the result of a
not-100%-supported, or faulty? PCI bridge.
( http://patchwork.kernel.org/patch/53004/ )
This patch fixes entry #1.
"1. p54p_check_rx_ring - skb_over_panic: Under a ping flood
or just left running for a bit would panic with a skb_over_panic."
As described in the mail: The invalid frame length causes
skb_put to bailout and trigger a crash.
Note:
Simply dropping the frame is problematic, because if its content
contains a tx feedback we would lose some portion of the device
memory space.... And the driver/mac80211 should handle all other
invalid data.
Reported-by: Quintin Pitts <geek4linux@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/p54/p54pci.c')
-rw-r--r-- | drivers/net/wireless/p54/p54pci.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/wireless/p54/p54pci.c b/drivers/net/wireless/p54/p54pci.c index a15962a19b2a..a72f7c2577de 100644 --- a/drivers/net/wireless/p54/p54pci.c +++ b/drivers/net/wireless/p54/p54pci.c | |||
@@ -197,6 +197,14 @@ static void p54p_check_rx_ring(struct ieee80211_hw *dev, u32 *index, | |||
197 | i %= ring_limit; | 197 | i %= ring_limit; |
198 | continue; | 198 | continue; |
199 | } | 199 | } |
200 | |||
201 | if (unlikely(len > priv->common.rx_mtu)) { | ||
202 | if (net_ratelimit()) | ||
203 | dev_err(&priv->pdev->dev, "rx'd frame size " | ||
204 | "exceeds length threshold.\n"); | ||
205 | |||
206 | len = priv->common.rx_mtu; | ||
207 | } | ||
200 | skb_put(skb, len); | 208 | skb_put(skb, len); |
201 | 209 | ||
202 | if (p54_rx(dev, skb)) { | 210 | if (p54_rx(dev, skb)) { |