public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Ali Bahar <ali@internetdog.org>
To: kernel-janitors@vger.kernel.org
Subject: Re: [patch] rtl8712: don't just return -EFAULT in
Date: Tue, 16 Aug 2011 01:42:27 +0000	[thread overview]
Message-ID: <20110816014227.GA28730@internetdog.org> (raw)

On Sat, Aug 06, 2011 at 07:27:48AM -0700, Dan Carpenter wrote:
> There were some curly braces missing so the original code in
> wpa_supplicant_ioctl() pretty much always returned -EFAULT without
> doing anything.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> 
> diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
> index 40e6b5c..c380a30 100644
> --- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
> +++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
> @@ -2072,9 +2072,10 @@ static int wpa_supplicant_ioctl(struct net_device *dev, struct iw_point *p)
>  	param = (struct ieee_param *)_malloc(p->length);
>  	if (param = NULL)
>  		return -ENOMEM;
> -	if (copy_from_user(param, p->pointer, p->length))
> +	if (copy_from_user(param, p->pointer, p->length)) {
>  		kfree((u8 *)param);
>  		return -EFAULT;
> +	}

Ouch! (Now emacs would've caught this! ;-))
My reading of the code suggests that (not surprisingly) this path does
not get executed. The frequent case is to go thru wext-core's
"standard" handler, instead of the above. If so, then that'd explain
why I've not noticed this bug during testing.

Good catch.

thanks,
ali


>  	switch (param->cmd) {
>  	case IEEE_CMD_SET_WPA_PARAM:
>  		ret = wpa_set_param(dev, param->u.wpa_param.name,

                 reply	other threads:[~2011-08-16  1:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20110816014227.GA28730@internetdog.org \
    --to=ali@internetdog.org \
    --cc=kernel-janitors@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox