Re: [PATCH v3] drivers/vfio: Fix a redundant copy bug

2018-10-17 Thread Alex Williamson
On Wed, 17 Oct 2018 12:58:26 -0500 Wenwen Wang wrote: > On Wed, Oct 17, 2018 at 10:45 AM Alex Williamson > wrote: > > > > On Wed, 17 Oct 2018 09:32:04 -0500 > > Wenwen Wang wrote: > > > > > In vfio_spapr_iommu_eeh_ioctl(), if the ioctl command is VFIO_EEH_PE_OP, > > > the user-space buffer 'a

Re: [PATCH v3] drivers/vfio: Fix a redundant copy bug

2018-10-17 Thread Wenwen Wang
On Wed, Oct 17, 2018 at 2:05 PM Alex Williamson wrote: > > On Wed, 17 Oct 2018 12:58:26 -0500 > Wenwen Wang wrote: > > > On Wed, Oct 17, 2018 at 10:45 AM Alex Williamson > > wrote: > > > > > > On Wed, 17 Oct 2018 09:32:04 -0500 > > > Wenwen Wang wrote: > > > > > > > In vfio_spapr_iommu_eeh_ioct

Re: [PATCH v3] drivers/vfio: Fix a redundant copy bug

2018-10-17 Thread Wenwen Wang
On Wed, Oct 17, 2018 at 10:45 AM Alex Williamson wrote: > > On Wed, 17 Oct 2018 09:32:04 -0500 > Wenwen Wang wrote: > > > In vfio_spapr_iommu_eeh_ioctl(), if the ioctl command is VFIO_EEH_PE_OP, > > the user-space buffer 'arg' is copied to the kernel object 'op' and the > > 'argsz' and 'flags' fi

Re: [PATCH v3] drivers/vfio: Fix a redundant copy bug

2018-10-17 Thread Alex Williamson
On Wed, 17 Oct 2018 09:32:04 -0500 Wenwen Wang wrote: > In vfio_spapr_iommu_eeh_ioctl(), if the ioctl command is VFIO_EEH_PE_OP, > the user-space buffer 'arg' is copied to the kernel object 'op' and the > 'argsz' and 'flags' fields of 'op' are checked. If the check fails, an > error code EINVAL i

[PATCH v3] drivers/vfio: Fix a redundant copy bug

2018-10-17 Thread Wenwen Wang
In vfio_spapr_iommu_eeh_ioctl(), if the ioctl command is VFIO_EEH_PE_OP, the user-space buffer 'arg' is copied to the kernel object 'op' and the 'argsz' and 'flags' fields of 'op' are checked. If the check fails, an error code EINVAL is returned. Otherwise, 'op.op' is further checked through a swit