[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-ti33x-psp-3.2 / 3.2.2 / 0048-mac80211-fix-rx-key-NULL-pointer-dereference-in-prom.patch
1 From 12b3ec5c806e2daef619f068f80115f4dc0aa6bb Mon Sep 17 00:00:00 2001
2 From: Stanislaw Gruszka <sgruszka@redhat.com>
3 Date: Wed, 11 Jan 2012 09:26:54 +0100
4 Subject: [PATCH 048/129] mac80211: fix rx->key NULL pointer dereference in
5 promiscuous mode
7 commit 1140afa862842ac3e56678693050760edc4ecde9 upstream.
9 Since:
11 commit 816c04fe7ef01dd9649f5ccfe796474db8708be5
12 Author: Christian Lamparter <chunkeey@googlemail.com>
13 Date: Sat Apr 30 15:24:30 2011 +0200
15 mac80211: consolidate MIC failure report handling
17 is possible to that we dereference rx->key == NULL when driver set
18 RX_FLAG_MMIC_STRIPPED and not RX_FLAG_IV_STRIPPED and we are in
19 promiscuous mode. This happen with rt73usb and rt61pci at least.
21 Before the commit we always check rx->key against NULL, so I assume
22 fix should be done in mac80211 (also mic_fail path has similar check).
24 References:
25 https://bugzilla.redhat.com/show_bug.cgi?id=769766
26 http://rt2x00.serialmonkey.com/pipermail/users_rt2x00.serialmonkey.com/2012-January/004395.html
28 Reported-by: Stuart D Gathman <stuart@gathman.org>
29 Reported-by: Kai Wohlfahrt <kai.scorpio@gmail.com>
30 Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
31 Signed-off-by: John W. Linville <linville@tuxdriver.com>
32 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
33 ---
34 net/mac80211/wpa.c | 2 +-
35 1 file changed, 1 insertion(+), 1 deletion(-)
37 diff --git a/net/mac80211/wpa.c b/net/mac80211/wpa.c
38 index f614ce7..28a39bb 100644
39 --- a/net/mac80211/wpa.c
40 +++ b/net/mac80211/wpa.c
41 @@ -106,7 +106,7 @@ ieee80211_rx_h_michael_mic_verify(struct ieee80211_rx_data *rx)
42 if (status->flag & RX_FLAG_MMIC_ERROR)
43 goto mic_fail;
45 - if (!(status->flag & RX_FLAG_IV_STRIPPED))
46 + if (!(status->flag & RX_FLAG_IV_STRIPPED) && rx->key)
47 goto update_iv;
49 return RX_CONTINUE;
50 --
51 1.7.9.5