Skip to contentSkip to conversation

VMCI: Avoid extra check for access_ok()

PATCH In review Souptick Joarder 2 participants 3 messages May 5, 2020 – Jun 24, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/misc/vmw_vmci/vmci_host.c | 2 --
 1 file changed, 2 deletions(-)
drivers/misc/vmw_vmci/vmci_host.c +0 -2
index ce16d6b..2d8328d9 100644
@@ -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.
Signature · 1 line
1.9.1
#1 lore raw

Hi Greg,

Quoted 5 lines · Souptick Joarder

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

Does this need to be marked as stable ?

Quoted 20 lines
---
 drivers/misc/vmw_vmci/vmci_host.c | 2 --
 1 file changed, 2 deletions(-)
drivers/misc/vmw_vmci/vmci_host.c +0 -3
index ce16d6b..2d8328d9 100644
@@ -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

maintainer
#2 lore raw
Quoted 10 lines · Souptick Joarder

Hi Greg,

Quoted 5 lines · Souptick Joarder

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

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