All of lore.kernel.org
 help / color / mirror / Atom feed
From: "John W. Linville" <linville@tuxdriver.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Jouni Malinen <j@w1.fi>,
	linux-wireless@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] Hostap: copying wrong data prism2_ioctl_giwaplist()
Date: Fri, 09 Aug 2013 15:34:59 +0000	[thread overview]
Message-ID: <20130809153459.GH30925@tuxdriver.com> (raw)
In-Reply-To: <20130809095231.GD29282@elgon.mountain>

Here I must insert the obligatory question:

	Does anyone actually still use the hostap driver??

John

On Fri, Aug 09, 2013 at 12:52:31PM +0300, Dan Carpenter wrote:
> We want the data stored in "addr" and "qual", but the extra ampersands
> mean we are copying stack data instead.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> Static checker stuff.  Untested.  Should probably be applied to -stable
> as well.
> 
> diff --git a/drivers/net/wireless/hostap/hostap_ioctl.c b/drivers/net/wireless/hostap/hostap_ioctl.c
> index ac07473..e509030 100644
> --- a/drivers/net/wireless/hostap/hostap_ioctl.c
> +++ b/drivers/net/wireless/hostap/hostap_ioctl.c
> @@ -523,9 +523,9 @@ static int prism2_ioctl_giwaplist(struct net_device *dev,
>  
>  	data->length = prism2_ap_get_sta_qual(local, addr, qual, IW_MAX_AP, 1);
>  
> -	memcpy(extra, &addr, sizeof(struct sockaddr) * data->length);
> +	memcpy(extra, addr, sizeof(struct sockaddr) * data->length);
>  	data->flags = 1; /* has quality information */
> -	memcpy(extra + sizeof(struct sockaddr) * data->length, &qual,
> +	memcpy(extra + sizeof(struct sockaddr) * data->length, qual,
>  	       sizeof(struct iw_quality) * data->length);
>  
>  	kfree(addr);
> 

-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

WARNING: multiple messages have this Message-ID (diff)
From: "John W. Linville" <linville@tuxdriver.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Jouni Malinen <j@w1.fi>,
	linux-wireless@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] Hostap: copying wrong data prism2_ioctl_giwaplist()
Date: Fri, 9 Aug 2013 11:34:59 -0400	[thread overview]
Message-ID: <20130809153459.GH30925@tuxdriver.com> (raw)
In-Reply-To: <20130809095231.GD29282@elgon.mountain>

Here I must insert the obligatory question:

	Does anyone actually still use the hostap driver??

John

On Fri, Aug 09, 2013 at 12:52:31PM +0300, Dan Carpenter wrote:
> We want the data stored in "addr" and "qual", but the extra ampersands
> mean we are copying stack data instead.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> Static checker stuff.  Untested.  Should probably be applied to -stable
> as well.
> 
> diff --git a/drivers/net/wireless/hostap/hostap_ioctl.c b/drivers/net/wireless/hostap/hostap_ioctl.c
> index ac07473..e509030 100644
> --- a/drivers/net/wireless/hostap/hostap_ioctl.c
> +++ b/drivers/net/wireless/hostap/hostap_ioctl.c
> @@ -523,9 +523,9 @@ static int prism2_ioctl_giwaplist(struct net_device *dev,
>  
>  	data->length = prism2_ap_get_sta_qual(local, addr, qual, IW_MAX_AP, 1);
>  
> -	memcpy(extra, &addr, sizeof(struct sockaddr) * data->length);
> +	memcpy(extra, addr, sizeof(struct sockaddr) * data->length);
>  	data->flags = 1; /* has quality information */
> -	memcpy(extra + sizeof(struct sockaddr) * data->length, &qual,
> +	memcpy(extra + sizeof(struct sockaddr) * data->length, qual,
>  	       sizeof(struct iw_quality) * data->length);
>  
>  	kfree(addr);
> 

-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

  reply	other threads:[~2013-08-09 15:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-09  9:52 [patch] Hostap: copying wrong data prism2_ioctl_giwaplist() Dan Carpenter
2013-08-09  9:52 ` Dan Carpenter
2013-08-09 15:34 ` John W. Linville [this message]
2013-08-09 15:34   ` John W. Linville

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130809153459.GH30925@tuxdriver.com \
    --to=linville@tuxdriver.com \
    --cc=dan.carpenter@oracle.com \
    --cc=j@w1.fi \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.