2020-05-05 20:14:31

by Souptick Joarder

[permalink] [raw]
Subject: [PATCH] VMCI: Avoid extra check for access_ok()

get_user_pages_fast() is already having a check for the same. This
double check can be removed.

Signed-off-by: Souptick Joarder <[email protected]>
---
drivers/misc/vmw_vmci/vmci_host.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/drivers/misc/vmw_vmci/vmci_host.c b/drivers/misc/vmw_vmci/vmci_host.c
index ce16d6b..2d8328d9 100644
--- a/drivers/misc/vmw_vmci/vmci_host.c
+++ b/drivers/misc/vmw_vmci/vmci_host.c
@@ -233,8 +233,6 @@ static int vmci_host_setup_notify(struct vmci_ctx *context,
* about the size.
*/
BUILD_BUG_ON(sizeof(bool) != sizeof(u8));
- if (!access_ok((void __user *)uva, sizeof(u8)))
- return VMCI_ERROR_GENERIC;

/*
* Lock physical page backing a given user VA.
--
1.9.1


2020-06-24 01:46:18

by Souptick Joarder

[permalink] [raw]
Subject: Re: [PATCH] VMCI: Avoid extra check for access_ok()

Hi Greg,

On Wed, May 6, 2020 at 1:40 AM Souptick Joarder <[email protected]> wrote:
>
> get_user_pages_fast() is already having a check for the same. This
> double check can be removed.
>
> Signed-off-by: Souptick Joarder <[email protected]>

Does this need to be marked as stable ?

> ---
> drivers/misc/vmw_vmci/vmci_host.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/misc/vmw_vmci/vmci_host.c b/drivers/misc/vmw_vmci/vmci_host.c
> index ce16d6b..2d8328d9 100644
> --- a/drivers/misc/vmw_vmci/vmci_host.c
> +++ b/drivers/misc/vmw_vmci/vmci_host.c
> @@ -233,8 +233,6 @@ static int vmci_host_setup_notify(struct vmci_ctx *context,
> * about the size.
> */
> BUILD_BUG_ON(sizeof(bool) != sizeof(u8));
> - if (!access_ok((void __user *)uva, sizeof(u8)))
> - return VMCI_ERROR_GENERIC;
>
> /*
> * Lock physical page backing a given user VA.
> --
> 1.9.1
>

2020-06-24 09:11:29

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH] VMCI: Avoid extra check for access_ok()

On Wed, Jun 24, 2020 at 07:11:54AM +0530, Souptick Joarder wrote:
> Hi Greg,
>
> On Wed, May 6, 2020 at 1:40 AM Souptick Joarder <[email protected]> wrote:
> >
> > get_user_pages_fast() is already having a check for the same. This
> > double check can be removed.
> >
> > Signed-off-by: Souptick Joarder <[email protected]>
>
> Does this need to be marked as stable ?

You tell me, why would it? Does it meet the requirements for stable
kernels? If so, which one?

thanks,
greg k-h