public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Wim de With <nauxuron@wimdewith.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: gregkh@linuxfoundation.org, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: gdm72xx: add userspace data struct
Date: Thu, 10 Dec 2015 10:42:14 +0100	[thread overview]
Message-ID: <566948F6.80904@wimdewith.com> (raw)
In-Reply-To: <20151210093720.GD5284@mwanda>

On 10-12-2015 10:37, Dan Carpenter wrote:
> On Thu, Dec 10, 2015 at 10:11:12AM +0100, Wim de With wrote:
>> @@ -482,8 +483,16 @@ static int gdm_wimax_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
>>  				/* NOTE: gdm_update_fsm should be called
>>  				 * before gdm_wimax_ioctl_set_data is called.
>>  				 */
>> -				gdm_update_fsm(dev,
>> -					       req->data.buf);
>> +				fsm_buf = kmalloc(sizeof(fsm_s), GFP_KERNEL);
>> +				if (!fsm_buf)
>> +					return -ENOMEM;
>> +				if (copy_from_user(fsm_buf, req->data.buf,
>> +						   sizeof(fsm_s))) {
>> +					kfree(fsm_buf);
>> +					return -EFAULT;
>> +				}
>> +				gdm_update_fsm(dev, fsm_buf);
>> +				kfree(fsm_buf);
> 
> 
> No.  This change is a bug.
> 
> regards,
> dan carpenter
> 

But what if I just keep it as:

	gdm_update_fsm(dev, req->data.buf)

Then it would just trust a __user pointer right?

Wim

  reply	other threads:[~2015-12-10  9:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-10  9:11 [PATCH] staging: gdm72xx: add userspace data struct Wim de With
2015-12-10  9:37 ` Dan Carpenter
2015-12-10  9:42   ` Wim de With [this message]
2015-12-10 11:34     ` Dan Carpenter
2015-12-10 11:40       ` [PATCH v2] " Wim de With
2015-12-10 14:44         ` One Thousand Gnomes
2015-12-10 23:47           ` Wim de With
2015-12-11  0:17             ` One Thousand Gnomes
2015-12-11  9:25               ` [PATCH v3] " Wim de With

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=566948F6.80904@wimdewith.com \
    --to=nauxuron@wimdewith.com \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@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