Topel, Bjorn
> >
> > Subject: Re: [PATCH 04/20] dlb2: add device ioctl layer and first 4 ioctls
> >
> > On Tue, Aug 04, 2020 at 10:20:47PM +, Eads, Gage wrote:
> > > > > +/* [7:0]: device revision, [15:8]: device version */
> > > > > +#d
> -Original Message-
> From: gregkh
> Sent: Wednesday, August 5, 2020 10:18 AM
> To: Eads, Gage
> Cc: Arnd Bergmann ; linux-kernel@vger.kernel.org;
> Karlsson, Magnus ; Topel, Bjorn
>
> Subject: Re: [PATCH 04/20] dlb2: add device ioctl layer and first 4 io
> -Original Message-
> From: gregkh
> Sent: Wednesday, August 5, 2020 1:46 AM
> To: Eads, Gage
> Cc: Arnd Bergmann ; linux-kernel@vger.kernel.org;
> Karlsson, Magnus ; Topel, Bjorn
>
> Subject: Re: [PATCH 04/20] dlb2: add device ioctl layer and first 4 io
On Tue, Aug 04, 2020 at 10:20:47PM +, Eads, Gage wrote:
> > > +/* [7:0]: device revision, [15:8]: device version */
> > > +#define DLB2_SET_DEVICE_VERSION(ver, rev) (((ver) << 8) | (rev))
> > > +
> > > +static int dlb2_ioctl_get_device_version(struct dlb2_dev *dev,
> > > +
> > +/* [7:0]: device revision, [15:8]: device version */
> > +#define DLB2_SET_DEVICE_VERSION(ver, rev) (((ver) << 8) | (rev))
> > +
> > +static int dlb2_ioctl_get_device_version(struct dlb2_dev *dev,
> > +unsigned long user_arg,
> > +
pel, Bjorn
> >
> > Subject: Re: [PATCH 04/20] dlb2: add device ioctl layer and first 4 ioctls
> >
> > On Fri, Jul 17, 2020 at 8:19 PM Eads, Gage wrote:
> >
> > > > A plain copy_from_user() in place of this function should be fine.
> > >
> &g
> -Original Message-
> From: Arnd Bergmann
> Sent: Friday, July 17, 2020 1:57 PM
> To: Eads, Gage
> Cc: linux-kernel@vger.kernel.org; gregkh ;
> Karlsson, Magnus ; Topel, Bjorn
>
> Subject: Re: [PATCH 04/20] dlb2: add device ioctl layer and first 4 ioctls
>
On Fri, Jul 17, 2020 at 8:19 PM Eads, Gage wrote:
> > A plain copy_from_user() in place of this function should be fine.
>
> This function also validates the user size arg to prevent buffer overflow;
> centralizing it here avoids the case where a programmer accidentally forgets
> the check in a
> -Original Message-
> From: Randy Dunlap
> Sent: Sunday, July 12, 2020 9:42 AM
> To: Eads, Gage ; linux-kernel@vger.kernel.org;
> a...@arndb.de; gre...@linuxfoundation.org
> Cc: Karlsson, Magnus ; Topel, Bjorn
>
> Subject: Re: [PATCH 04/20] dlb2: add device
> -Original Message-
> From: Randy Dunlap
> Sent: Sunday, July 12, 2020 9:54 AM
> To: Eads, Gage ; linux-kernel@vger.kernel.org;
> a...@arndb.de; gre...@linuxfoundation.org
> Cc: Karlsson, Magnus ; Topel, Bjorn
>
> Subject: Re: [PATCH 04/20] dlb2: add device
> > +/* Verify the ioctl argument size and copy the argument into kernel
> > +memory */ static int dlb2_copy_from_user(struct dlb2_dev *dev,
> > + unsigned long user_arg,
> > + u16 user_size,
> > + void *arg,
>
On Sun, Jul 12, 2020 at 3:46 PM Gage Eads wrote:
>
> This commit introduces the dlb2 device ioctl layer, and the first four
> ioctls: query device version, driver version, and available resources; and
> create a scheduling domain. This commit also introduces the user-space
> interface file dlb2_us
On 7/12/20 6:43 AM, Gage Eads wrote:
> +int dlb2_ioctl_dispatcher(struct dlb2_dev *dev,
> + unsigned int cmd,
> + unsigned long arg)
> +{
> + u16 sz = _IOC_SIZE(cmd);
> +
> + if (_IOC_NR(cmd) >= NUM_DLB2_CMD) {
Does this bounds check need to use
On 7/12/20 6:43 AM, Gage Eads wrote:
> +//
> +/* dlb2 ioctl codes */
> +//
> +
> +#define DLB2_IOC_MAGIC 'h'
Hi,
This magic value should be documented in
Documentation/userspace-api/ioctl/ioctl-number.rst.
thanks.
--
~Randy
This commit introduces the dlb2 device ioctl layer, and the first four
ioctls: query device version, driver version, and available resources; and
create a scheduling domain. This commit also introduces the user-space
interface file dlb2_user.h.
The PF hardware operation for scheduling domain creat
15 matches
Mail list logo