Search Linux Wireless

Re: [PATCH] cfg80211: fix NULL dereference in IBSS SIOCGIWAP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2009-07-09 at 16:59 +0800, Zhu Yi wrote:
> This patch avoids memcpy from wdev->wext.ibss.bssid if it is NULL.
> This could happen if we SIOCGIWAP before SIOCSIWAP.

Indeed, thanks.

> Signed-off-by: Zhu Yi <yi.zhu@xxxxxxxxx>

Reviewed-by: Johannes Berg <johannes@xxxxxxxxxxxxxxxx>

> ---
>  net/wireless/ibss.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/net/wireless/ibss.c b/net/wireless/ibss.c
> index 99ef936..cf3a7dc 100644
> --- a/net/wireless/ibss.c
> +++ b/net/wireless/ibss.c
> @@ -434,8 +434,11 @@ int cfg80211_ibss_wext_giwap(struct net_device *dev,
>  	wdev_lock(wdev);
>  	if (wdev->current_bss)
>  		memcpy(ap_addr->sa_data, wdev->current_bss->pub.bssid, ETH_ALEN);
> -	else
> +	else if (wdev->wext.ibss.bssid)
>  		memcpy(ap_addr->sa_data, wdev->wext.ibss.bssid, ETH_ALEN);
> +	else
> +		memset(ap_addr->sa_data, 0, ETH_ALEN);
> +
>  	wdev_unlock(wdev);
>  
>  	return 0;

Attachment: signature.asc
Description: This is a digitally signed message part


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux