diff mbox series

mac80211: Reject zero MAC address in sta_info_insert_check()

Message ID 20210626103856.19816-1-yuehaibing@huawei.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series mac80211: Reject zero MAC address in sta_info_insert_check() | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Guessed tree name to be net-next
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link

Commit Message

Yue Haibing June 26, 2021, 10:38 a.m. UTC
As commit 52dba8d7d5ab ("mac80211: reject zero MAC address in add station")
said, we don't consider all-zeroes to be a valid MAC address in most places,
so also reject it here.

Reported-by: syzbot+ef4ca92d9d6f5ba2f880@syzkaller.appspotmail.com
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 net/mac80211/sta_info.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Yue Haibing June 26, 2021, 10:48 a.m. UTC | #1
Pls drop this.

On 2021/6/26 18:38, YueHaibing wrote:
> As commit 52dba8d7d5ab ("mac80211: reject zero MAC address in add station")
> said, we don't consider all-zeroes to be a valid MAC address in most places,
> so also reject it here.
> 
> Reported-by: syzbot+ef4ca92d9d6f5ba2f880@syzkaller.appspotmail.com
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  net/mac80211/sta_info.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
> index f2fb69da9b6e..3a6887fc9160 100644
> --- a/net/mac80211/sta_info.c
> +++ b/net/mac80211/sta_info.c
> @@ -547,7 +547,7 @@ static int sta_info_insert_check(struct sta_info *sta)
>  		return -ENETDOWN;
>  
>  	if (WARN_ON(ether_addr_equal(sta->sta.addr, sdata->vif.addr) ||
> -		    is_multicast_ether_addr(sta->sta.addr)))
> +		    is_valid_ether_addr(sta->sta.addr)))
>  		return -EINVAL;
>  
>  	/* The RCU read lock is required by rhashtable due to
>
diff mbox series

Patch

diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index f2fb69da9b6e..3a6887fc9160 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -547,7 +547,7 @@  static int sta_info_insert_check(struct sta_info *sta)
 		return -ENETDOWN;
 
 	if (WARN_ON(ether_addr_equal(sta->sta.addr, sdata->vif.addr) ||
-		    is_multicast_ether_addr(sta->sta.addr)))
+		    is_valid_ether_addr(sta->sta.addr)))
 		return -EINVAL;
 
 	/* The RCU read lock is required by rhashtable due to