linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cfg80211: Add a missing null pointer check
@ 2010-05-19 10:27 Jussi Haakana
  2010-05-19 15:56 ` Felix Fietkau
  0 siblings, 1 reply; 3+ messages in thread
From: Jussi Haakana @ 2010-05-19 10:27 UTC (permalink / raw)
  To: John Linville; +Cc: Johannes Berg, linux-wireless@vger.kernel.org

If a network interface is down while setting a channel,
missing null pointer check causes an oops in cfg80211_set_freq:

# iw phy phy0 interface add ath1 type monitor
# iw dev ath1 set channel 3
Unable to handle kernel paging request for data at address 0x00000004
Faulting instruction address: 0xca16d778
Oops: Kernel access of bad area, sig: 11 [#1]
...

Signed-off-by: Jussi Haakana <Jussi.Haakana@7signal.com>
---
 net/wireless/chan.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/wireless/chan.c b/net/wireless/chan.c
index d92d088..b01a6f6 100644
--- a/net/wireless/chan.c
+++ b/net/wireless/chan.c
@@ -50,7 +50,7 @@ int cfg80211_set_freq(struct cfg80211_registered_device *rdev,
        struct ieee80211_channel *chan;
        int result;

-       if (wdev->iftype == NL80211_IFTYPE_MONITOR)
+       if (wdev && wdev->iftype == NL80211_IFTYPE_MONITOR)
                wdev = NULL;

        if (wdev) {
--
1.5.5.6


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] cfg80211: Add a missing null pointer check
  2010-05-19 10:27 [PATCH] cfg80211: Add a missing null pointer check Jussi Haakana
@ 2010-05-19 15:56 ` Felix Fietkau
  2010-05-20  6:15   ` Jussi Haakana
  0 siblings, 1 reply; 3+ messages in thread
From: Felix Fietkau @ 2010-05-19 15:56 UTC (permalink / raw)
  To: Jussi Haakana
  Cc: John Linville, Johannes Berg, linux-wireless@vger.kernel.org

On 2010-05-19 12:27 PM, Jussi Haakana wrote:
> If a network interface is down while setting a channel,
> missing null pointer check causes an oops in cfg80211_set_freq:
> 
> # iw phy phy0 interface add ath1 type monitor
> # iw dev ath1 set channel 3
> Unable to handle kernel paging request for data at address 0x00000004
> Faulting instruction address: 0xca16d778
> Oops: Kernel access of bad area, sig: 11 [#1]
> ...
> 
> Signed-off-by: Jussi Haakana <Jussi.Haakana@7signal.com>
That's exactly what I sent 4 days ago ;)

- Felix

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] cfg80211: Add a missing null pointer check
  2010-05-19 15:56 ` Felix Fietkau
@ 2010-05-20  6:15   ` Jussi Haakana
  0 siblings, 0 replies; 3+ messages in thread
From: Jussi Haakana @ 2010-05-20  6:15 UTC (permalink / raw)
  To: Felix Fietkau
  Cc: John Linville, Johannes Berg, linux-wireless@vger.kernel.org

On 2010-05-19 18:57 PM, Felix Fietkau wrote:
> On 2010-05-19 12:27 PM, Jussi Haakana wrote:
> > If a network interface is down while setting a channel,
> > missing null pointer check causes an oops in cfg80211_set_freq:
> >
> > # iw phy phy0 interface add ath1 type monitor
> > # iw dev ath1 set channel 3
> > Unable to handle kernel paging request for data at address 0x00000004
> > Faulting instruction address: 0xca16d778
> > Oops: Kernel access of bad area, sig: 11 [#1]
> > ...
> >
> > Signed-off-by: Jussi Haakana <Jussi.Haakana@7signal.com>
> That's exactly what I sent 4 days ago ;)

Sorry, missed that one :)

- Jussi


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-05-20  6:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-19 10:27 [PATCH] cfg80211: Add a missing null pointer check Jussi Haakana
2010-05-19 15:56 ` Felix Fietkau
2010-05-20  6:15   ` Jussi Haakana

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).