Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH] cfg80211: don't dereference NULL chan
@ 2013-01-25 19:47 Thomas Pedersen
  2013-01-25 19:57 ` Johannes Berg
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Pedersen @ 2013-01-25 19:47 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, simon.wunderlich, Thomas Pedersen

The patch "cfg80211: check radar interface combinations"
would dereference chan even though this may be NULL. Fix a
page fault when adding a new interface by adding a
short-circuit check for NULL.

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
---

No action required for this to make it into 3.8, right?

 net/wireless/util.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/wireless/util.c b/net/wireless/util.c
index 1c2795d..d1decbc 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -1212,7 +1212,8 @@ int cfg80211_can_use_iftype_chan(struct cfg80211_registered_device *rdev,
 	case NL80211_IFTYPE_MESH_POINT:
 	case NL80211_IFTYPE_P2P_GO:
 	case NL80211_IFTYPE_WDS:
-		radar_required = !!(chan->flags & IEEE80211_CHAN_RADAR);
+		radar_required = !!(chan &&
+				    chan->flags & IEEE80211_CHAN_RADAR);
 		break;
 	case NL80211_IFTYPE_P2P_CLIENT:
 	case NL80211_IFTYPE_STATION:
-- 
1.7.10.4


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

* Re: [PATCH] cfg80211: don't dereference NULL chan
  2013-01-25 19:47 [PATCH] cfg80211: don't dereference NULL chan Thomas Pedersen
@ 2013-01-25 19:57 ` Johannes Berg
  2013-01-25 20:33   ` Thomas Pedersen
  0 siblings, 1 reply; 3+ messages in thread
From: Johannes Berg @ 2013-01-25 19:57 UTC (permalink / raw)
  To: Thomas Pedersen; +Cc: linville, linux-wireless, simon.wunderlich

On Fri, 2013-01-25 at 11:47 -0800, Thomas Pedersen wrote:
> The patch "cfg80211: check radar interface combinations"
> would dereference chan even though this may be NULL. Fix a
> page fault when adding a new interface by adding a
> short-circuit check for NULL.
> 
> Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
> ---
> 
> No action required for this to make it into 3.8, right?

It doesn't have to go to 3.8 since the original patch isn't going there,
and I already have the same fix:
683d41ae6755e6ae297ec09603c229795ab9566e

johannes


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

* Re: [PATCH] cfg80211: don't dereference NULL chan
  2013-01-25 19:57 ` Johannes Berg
@ 2013-01-25 20:33   ` Thomas Pedersen
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Pedersen @ 2013-01-25 20:33 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linville, linux-wireless, simon.wunderlich

On Fri, Jan 25, 2013 at 11:57 AM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Fri, 2013-01-25 at 11:47 -0800, Thomas Pedersen wrote:
>> The patch "cfg80211: check radar interface combinations"
>> would dereference chan even though this may be NULL. Fix a
>> page fault when adding a new interface by adding a
>> short-circuit check for NULL.
>>
>> Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
>> ---
>>
>> No action required for this to make it into 3.8, right?
>
> It doesn't have to go to 3.8 since the original patch isn't going there,

Oh then -next would be 3.9, duh.

> and I already have the same fix:
> 683d41ae6755e6ae297ec09603c229795ab9566e

Thanks!

-- 
Thomas

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

end of thread, other threads:[~2013-01-25 20:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-25 19:47 [PATCH] cfg80211: don't dereference NULL chan Thomas Pedersen
2013-01-25 19:57 ` Johannes Berg
2013-01-25 20:33   ` Thomas Pedersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox