Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1583045

Re: [PATCH v5] drivers/misc: Add Aspeed LPC control driver

From Joel Stanley <joel@jms.id.au>
Newsgroups linux.kernel
Subject Re: [PATCH v5] drivers/misc: Add Aspeed LPC control driver
Date 2017-02-17 03:50 +0100
Message-ID <tbGMp-6C8-7@gated-at.bofh.it> (permalink)
References <taEWl-6yl-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Feb 14, 2017 at 5:00 PM, Cyril Bur <cyrilbur@gmail.com> wrote:
> diff --git a/drivers/misc/aspeed-lpc-ctrl.c b/drivers/misc/aspeed-lpc-ctrl.c
> new file mode 100644
> index 000000000000..9b51548e9d81
> --- /dev/null
> +++ b/drivers/misc/aspeed-lpc-ctrl.c

> +static long aspeed_lpc_ctrl_ioctl(struct file *file, unsigned int cmd,
> +               unsigned long param)
> +{
> +       struct aspeed_lpc_ctrl *lpc_ctrl = file_aspeed_lpc_ctrl(file);
> +       void __user *p = (void __user *)param;
> +       struct aspeed_lpc_ctrl_mapping map;
> +       u32 addr;
> +       u32 size;
> +       long rc;
> +
> +       if (copy_from_user(&map, p, sizeof(map)))
> +               return -EFAULT;

The structure you pass has a flags field that is currently unused. You
should check the value of map->flags here and reject non-zero values.

Once you fix that I think it's in good shape.

Cheers,

Joel

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v5] drivers/misc: Add Aspeed LPC control driver Cyril Bur <cyrilbur@gmail.com> - 2017-02-14 07:40 +0100
  Re: [PATCH v5] drivers/misc: Add Aspeed LPC control driver Joel Stanley <joel@jms.id.au> - 2017-02-17 03:50 +0100

csiph-web