Re: [PATCHSET 0/6 version 2] kmod: Optional timeout on the wait in call_usermodehelper_exec

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Boaz Harrosh wrote:
> [PATCH 2/6] kmod: kmod: Convert two call sites to call_usermodehelper_fns()
> 
> 	Fix mem leak in the case of -ENOMEM. Tetsuo what was the optimization you
> 	had for this one?

I meant below cleanup.
----------
[PATCH] keys: Remove constant argument from call_usermodehelper_keys()

call_usermodehelper_keys() has only one caller. It passes UMH_WAIT_PROC.

Signed-off-by: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx>
--
diff --git a/security/keys/request_key.c b/security/keys/request_key.c
index cc37903..fd9a93d 100644
--- a/security/keys/request_key.c
+++ b/security/keys/request_key.c
@@ -91,18 +91,17 @@ static void umh_keys_cleanup(struct subprocess_info *info)
  * Call a usermode helper with a specific session keyring.
  */
 static int call_usermodehelper_keys(char *path, char **argv, char **envp,
-					struct key *session_keyring, int wait)
+				    struct key *session_keyring)
 {
-	gfp_t gfp_mask = (wait == UMH_NO_WAIT) ? GFP_ATOMIC : GFP_KERNEL;
 	struct subprocess_info *info =
-		call_usermodehelper_setup(path, argv, envp, gfp_mask);
+		call_usermodehelper_setup(path, argv, envp, GFP_KERNEL);
 
 	if (!info)
 		return -ENOMEM;
 
 	call_usermodehelper_setfns(info, umh_keys_init, umh_keys_cleanup,
 					key_get(session_keyring));
-	return call_usermodehelper_exec(info, wait);
+	return call_usermodehelper_exec(info, UMH_WAIT_PROC);
 }
 
 /*
@@ -189,8 +188,7 @@ static int call_sbin_request_key(struct key_construction *cons,
 	argv[i] = NULL;
 
 	/* do it */
-	ret = call_usermodehelper_keys(argv[0], argv, envp, keyring,
-				       UMH_WAIT_PROC);
+	ret = call_usermodehelper_keys(argv[0], argv, envp, keyring);
 	kdebug("usermode -> 0x%x", ret);
 	if (ret >= 0) {
 		/* ret is the exit/wait code */
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]

  Powered by Linux