linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mac80211: reject zero MAC address in add station
@ 2019-07-24  9:16 Karthikeyan Periyasamy
  2019-07-26 11:06 ` Johannes Berg
  0 siblings, 1 reply; 5+ messages in thread
From: Karthikeyan Periyasamy @ 2019-07-24  9:16 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Karthikeyan Periyasamy

Don't allow using a zero MAC address as the station
MAC address. so validated the MAC address using
is_valid_ether_addr.

Signed-off-by: Karthikeyan Periyasamy <periyasa@codeaurora.org>
---
 net/mac80211/cfg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 4f12d04..cf97b07 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1539,7 +1539,7 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev,
 	if (ether_addr_equal(mac, sdata->vif.addr))
 		return -EINVAL;
 
-	if (is_multicast_ether_addr(mac))
+	if (!is_valid_ether_addr(mac))
 		return -EINVAL;
 
 	sta = sta_info_alloc(sdata, mac, GFP_KERNEL);
-- 
1.9.1


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

* Re: [PATCH] mac80211: reject zero MAC address in add station
  2019-07-24  9:16 [PATCH] mac80211: reject zero MAC address in add station Karthikeyan Periyasamy
@ 2019-07-26 11:06 ` Johannes Berg
  2019-07-26 14:06   ` Karthikeyan Periyasamy
  0 siblings, 1 reply; 5+ messages in thread
From: Johannes Berg @ 2019-07-26 11:06 UTC (permalink / raw)
  To: Karthikeyan Periyasamy; +Cc: linux-wireless

On Wed, 2019-07-24 at 14:46 +0530, Karthikeyan Periyasamy wrote:
> Don't allow using a zero MAC address as the station
> MAC address. so validated the MAC address using
> is_valid_ether_addr.

Theoretically, all zeroes might have been a valid address at some point.
I see no reason not to reject it, but I'd like to know why you ended up
with this now??

johannes


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

* Re: [PATCH] mac80211: reject zero MAC address in add station
  2019-07-26 11:06 ` Johannes Berg
@ 2019-07-26 14:06   ` Karthikeyan Periyasamy
  2019-07-26 14:07     ` Johannes Berg
  0 siblings, 1 reply; 5+ messages in thread
From: Karthikeyan Periyasamy @ 2019-07-26 14:06 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

>> Don't allow using a zero MAC address as the station
>> MAC address. so validated the MAC address using
>> is_valid_ether_addr.
> 
> Theoretically, all zeroes might have been a valid address at some 
> point.
> I see no reason not to reject it, but I'd like to know why you ended up
> with this now??
> 

Its a Wireless fuzz testing tool (codenomicon) which sends out different 
types of frames to the AP. It actually tampers legitimate wireless 
frames (Probe, Auth, Assoc, Data etc..) and will send to the AP. I 
thought allowing a zero MAC address station is not a valid. so validated 
the given MAC address. Just for curious, which case all zero address is 
a valid MAC.

Thanks,
Karthikeyan

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

* Re: [PATCH] mac80211: reject zero MAC address in add station
  2019-07-26 14:06   ` Karthikeyan Periyasamy
@ 2019-07-26 14:07     ` Johannes Berg
  2019-07-26 14:23       ` Toke Høiland-Jørgensen
  0 siblings, 1 reply; 5+ messages in thread
From: Johannes Berg @ 2019-07-26 14:07 UTC (permalink / raw)
  To: Karthikeyan Periyasamy; +Cc: linux-wireless

On Fri, 2019-07-26 at 19:36 +0530, Karthikeyan Periyasamy wrote:
> > > Don't allow using a zero MAC address as the station
> > > MAC address. so validated the MAC address using
> > > is_valid_ether_addr.
> > 
> > Theoretically, all zeroes might have been a valid address at some 
> > point.
> > I see no reason not to reject it, but I'd like to know why you ended up
> > with this now??
> > 
> 
> Its a Wireless fuzz testing tool (codenomicon) which sends out different 
> types of frames to the AP. It actually tampers legitimate wireless 
> frames (Probe, Auth, Assoc, Data etc..) and will send to the AP. I 
> thought allowing a zero MAC address station is not a valid. so validated 
> the given MAC address. Just for curious, which case all zero address is 
> a valid MAC.

Well, it isn't really, but the OUI 00:00:00 *is* in fact assigned (or
was), and theoretically the vendor could assign it to a device.

We do assume basically everywhere that it's invalid though.

Was just wondering how you came across this really, I guess I'll add a
bit of text to the commit log and merge it.

johannes


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

* Re: [PATCH] mac80211: reject zero MAC address in add station
  2019-07-26 14:07     ` Johannes Berg
@ 2019-07-26 14:23       ` Toke Høiland-Jørgensen
  0 siblings, 0 replies; 5+ messages in thread
From: Toke Høiland-Jørgensen @ 2019-07-26 14:23 UTC (permalink / raw)
  To: Johannes Berg, Karthikeyan Periyasamy; +Cc: linux-wireless

Johannes Berg <johannes@sipsolutions.net> writes:

> On Fri, 2019-07-26 at 19:36 +0530, Karthikeyan Periyasamy wrote:
>> > > Don't allow using a zero MAC address as the station
>> > > MAC address. so validated the MAC address using
>> > > is_valid_ether_addr.
>> > 
>> > Theoretically, all zeroes might have been a valid address at some 
>> > point.
>> > I see no reason not to reject it, but I'd like to know why you ended up
>> > with this now??
>> > 
>> 
>> Its a Wireless fuzz testing tool (codenomicon) which sends out different 
>> types of frames to the AP. It actually tampers legitimate wireless 
>> frames (Probe, Auth, Assoc, Data etc..) and will send to the AP. I 
>> thought allowing a zero MAC address station is not a valid. so validated 
>> the given MAC address. Just for curious, which case all zero address is 
>> a valid MAC.
>
> Well, it isn't really, but the OUI 00:00:00 *is* in fact assigned (or
> was), and theoretically the vendor could assign it to a device.

Heh, now that we allow routing the 0.0.0.0/8 subnet, this means that the
following could be a perfectly sensible thing to do:

'ip neigh add 0.0.0.1/8 lladdr 00:00:00:00:00:01 dev wlan0'

One bit per address per network layer ought to be enough for everyone,
right? ;)

-Toke

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

end of thread, other threads:[~2019-07-26 14:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-24  9:16 [PATCH] mac80211: reject zero MAC address in add station Karthikeyan Periyasamy
2019-07-26 11:06 ` Johannes Berg
2019-07-26 14:06   ` Karthikeyan Periyasamy
2019-07-26 14:07     ` Johannes Berg
2019-07-26 14:23       ` Toke Høiland-Jørgensen

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).