[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20151210093720.GD5284@mwanda>
Date: Thu, 10 Dec 2015 12:37:20 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Wim de With <nauxuron@...dewith.com>
Cc: gregkh@...uxfoundation.org, devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: gdm72xx: add userspace data struct
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists