lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 10 Mar 2010 19:44:39 +0100
From:	Oleg Nesterov <oleg@...hat.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Neil Horman <nhorman@...driver.com>, linux-kernel@...r.kernel.org
Subject: [PATCH -mm] call_usermodehelper: call info->init() after
	set_user_nice()

Mostly cosmetic, but imho it makes sense to call sub_info->init() right
before kernel_execve(). This looks more natural and allows ->init() hook
to change the priority if needed.

Signed-off-by: Oleg Nesterov <oleg@...hat.com>
---

 kernel/kmod.c |   12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

--- mm/kernel/kmod.c~5_MOVE_INIT_DOWN	2010-03-10 17:36:37.000000000 +0100
+++ mm/kernel/kmod.c	2010-03-10 19:40:24.000000000 +0100
@@ -159,6 +159,11 @@ static int ____call_usermodehelper(void 
 
 	/* We can run anywhere, unlike our parent keventd(). */
 	set_cpus_allowed_ptr(current, cpu_all_mask);
+	/*
+	 * Our parent is keventd, which runs with elevated scheduling priority.
+	 * Avoid propagating that into the userspace child.
+	 */
+	set_user_nice(current, 0);
 
 	if (sub_info->init) {
 		retval = sub_info->init(sub_info);
@@ -166,14 +171,7 @@ static int ____call_usermodehelper(void 
 			goto fail;
 	}
 
-	/*
-	 * Our parent is keventd, which runs with elevated scheduling priority.
-	 * Avoid propagating that into the userspace child.
-	 */
-	set_user_nice(current, 0);
-
 	retval = kernel_execve(sub_info->path, sub_info->argv, sub_info->envp);
-
 	/* Exec failed? */
 fail:
 	sub_info->retval = retval;

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ