Patchwork [Oneiric,1/8] usermodehelper: use UMH_WAIT_PROC consistently

login
register
mail settings
Submitter Tim Gardner
Date March 26, 2012, 1:28 a.m.
Message ID <1332725337-58475-1-git-send-email-tim.gardner@canonical.com>
Download mbox | patch
Permalink /patch/148618/
State New
Headers show

Comments

Tim Gardner - March 26, 2012, 1:28 a.m.
From: Oleg Nesterov <oleg@redhat.com>

BugLink: http://bugs.launchpad.net/bugs/963685

A few call_usermodehelper() callers use the hardcoded constant instead of
the proper UMH_WAIT_PROC, fix them.

Reported-by: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Cc: Lars Ellenberg <drbd-dev@lists.linbit.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Michal Januszewski <spock@gentoo.org>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: Kentaro Takeda <takedakn@nttdata.co.jp>
Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: James Morris <jmorris@namei.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(back ported from commit 70834d3070c3f3015ab5c05176d54bd4a0100546)

Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
---
 drivers/block/drbd/drbd_nl.c           |    2 +-
 drivers/staging/rtl8187se/r8180_core.c |    2 +-
 drivers/video/uvesafb.c                |    2 +-
 security/tomoyo/load_policy.c          |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
Stefan Bader - March 26, 2012, 12:28 p.m.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

On 26.03.2012 03:28, Tim Gardner wrote:
> From: Oleg Nesterov <oleg@redhat.com>
> 
> BugLink: http://bugs.launchpad.net/bugs/963685
> 
> A few call_usermodehelper() callers use the hardcoded constant instead of 
> the proper UMH_WAIT_PROC, fix them.
> 
> Reported-by: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp> 
> Signed-off-by: Oleg Nesterov <oleg@redhat.com> Cc: Lars Ellenberg
> <drbd-dev@lists.linbit.com> Cc: Greg Kroah-Hartman
> <gregkh@linuxfoundation.org> Cc: Michal Januszewski <spock@gentoo.org> Cc:
> Florian Tobias Schandinat <FlorianSchandinat@gmx.de> Cc: Kentaro Takeda
> <takedakn@nttdata.co.jp> Cc: Tetsuo Handa
> <penguin-kernel@I-love.SAKURA.ne.jp> Cc: James Morris <jmorris@namei.org> 
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
> Linus Torvalds <torvalds@linux-foundation.org> (back ported from commit
> 70834d3070c3f3015ab5c05176d54bd4a0100546)
> 
> Signed-off-by: Tim Gardner <tim.gardner@canonical.com> --- 
> drivers/block/drbd/drbd_nl.c           |    2 +- 
> drivers/staging/rtl8187se/r8180_core.c |    2 +- drivers/video/uvesafb.c
> |    2 +- security/tomoyo/load_policy.c          |    2 +- 4 files changed,
> 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c 
> index 515bcd9..3875647 100644 --- a/drivers/block/drbd/drbd_nl.c +++
> b/drivers/block/drbd/drbd_nl.c @@ -179,7 +179,7 @@ int drbd_khelper(struct
> drbd_conf *mdev, char *cmd) dev_info(DEV, "helper command: %s %s %s\n",
> usermode_helper, cmd, mb);
> 
> drbd_bcast_ev_helper(mdev, cmd); -	ret =
> call_usermodehelper(usermode_helper, argv, envp, 1); +	ret =
> call_usermodehelper(usermode_helper, argv, envp, UMH_WAIT_PROC); if (ret) 
> dev_warn(DEV, "helper command: %s %s %s exit code %u (0x%x)\n", 
> usermode_helper, cmd, mb, diff --git
> a/drivers/staging/rtl8187se/r8180_core.c
> b/drivers/staging/rtl8187se/r8180_core.c index 2155a77..ae10f22 100644 ---
> a/drivers/staging/rtl8187se/r8180_core.c +++
> b/drivers/staging/rtl8187se/r8180_core.c @@ -4143,7 +4143,7 @@ void
> GPIOChangeRFWorkItemCallBack(struct work_struct *work) argv[0] =
> RadioPowerPath; argv[2] = NULL;
> 
> -		call_usermodehelper(RadioPowerPath, argv, envp, 1); +
> call_usermodehelper(RadioPowerPath, argv, envp, UMH_WAIT_PROC); } }
> 
> diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c index
> 7f8472c..28f4e04 100644 --- a/drivers/video/uvesafb.c +++
> b/drivers/video/uvesafb.c @@ -121,7 +121,7 @@ static int
> uvesafb_helper_start(void) NULL, };
> 
> -	return call_usermodehelper(v86d_path, argv, envp, 1); +	return
> call_usermodehelper(v86d_path, argv, envp, UMH_WAIT_PROC); }
> 
> /* diff --git a/security/tomoyo/load_policy.c
> b/security/tomoyo/load_policy.c index 3312e56..0432450 100644 ---
> a/security/tomoyo/load_policy.c +++ b/security/tomoyo/load_policy.c @@
> -76,6 +76,6 @@ void tomoyo_load_policy(const char *filename) envp[0] =
> "HOME=/"; envp[1] = "PATH=/sbin:/bin:/usr/sbin:/usr/bin"; envp[2] = NULL; -
> call_usermodehelper(argv[0], argv, envp, 1); +	call_usermodehelper(argv[0],
> argv, envp, UMH_WAIT_PROC); tomoyo_check_profile(); }

The sequence of changes looks sensible on a relaxed glance. I have not
explicitly checked for follow-up commits or other UMH_WAIT_PROC sites.

Acked-by: Stefan Bader <stefan.bader@canonical.com>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBCgAGBQJPcGECAAoJEOhnXe7L7s6jx8sP/3sPmbjWqEd5BlhFh1Cm/kW0
kTJGN5jiQFXUiNoynVQ5PqpEkjFoZQnCPSy/8W1yIPLBbr25mj7TvxRX9IrQvbc6
Huh4ZV+1MuEOhATZJYEkBElgOzl1PDxx3w15pUD+o67q2LOiGxfebImL+LtB98oD
46iKoZUFtcNrA5Yskp2Z5HPORoH4H3kCLQwBZJZJV3l/Tgd6cm4WC9PfeQaywe/y
P5a3s8kexaP1uSd36gJMAayKJZMxY0w0ZWXcsetg9xHjhxu8st1VQAICdujXUu/x
J6MzNkqUOXw1aSchqBtF3pwbzFzd5W8d/lEW1YZS8HHnw3n/ODo4uZbP0o3ozOCK
5Jahne5KfevnX2P7oaERN22Z9HThnvbGQeIFWLV2Y9sygw6zcRCibrvGnvKpdHsH
ogu8WMhG6nDQmjp3QeEww2WbPHT2wPGdCkT31rOm5SYo3zXSfDO88lFDzphVzrKe
zmZj3sNnH0/cUpSRWUheBa49ifiVHNWBikrE/Yp8Dp6T9Kuv+WoVx+boytI8N4KF
g9/Z6uQ7xhty0iL34vBuBHGH2phiHwnjphCU9tkVPspeA9sndD70OrPDU7UKuAbY
gxk3+TVPZmcoZhP630O6cuP048WdPbGZJHiV1R49k26lkKZ0BUSZxgK8MRb2cQGo
rR3ZKCfCAV39U3AQbTX1
=RPC2
-----END PGP SIGNATURE-----
Andy Whitcroft - March 27, 2012, 1:03 p.m.
This is a heafty pile of patches, but many are pretty small overall.
The upstream references look ok.  It should be easy to test, systems
should stop booting right if this is wrong.  As this is a user
triggerable DOS and assuming some testing:

Acked-by: Andy Whitcroft <apw@canonical.com>

Assuming the V2 8/8.

-apw
Tim Gardner - March 27, 2012, 1:30 p.m.

Patch

diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
index 515bcd9..3875647 100644
--- a/drivers/block/drbd/drbd_nl.c
+++ b/drivers/block/drbd/drbd_nl.c
@@ -179,7 +179,7 @@  int drbd_khelper(struct drbd_conf *mdev, char *cmd)
 	dev_info(DEV, "helper command: %s %s %s\n", usermode_helper, cmd, mb);
 
 	drbd_bcast_ev_helper(mdev, cmd);
-	ret = call_usermodehelper(usermode_helper, argv, envp, 1);
+	ret = call_usermodehelper(usermode_helper, argv, envp, UMH_WAIT_PROC);
 	if (ret)
 		dev_warn(DEV, "helper command: %s %s %s exit code %u (0x%x)\n",
 				usermode_helper, cmd, mb,
diff --git a/drivers/staging/rtl8187se/r8180_core.c b/drivers/staging/rtl8187se/r8180_core.c
index 2155a77..ae10f22 100644
--- a/drivers/staging/rtl8187se/r8180_core.c
+++ b/drivers/staging/rtl8187se/r8180_core.c
@@ -4143,7 +4143,7 @@  void GPIOChangeRFWorkItemCallBack(struct work_struct *work)
 		argv[0] = RadioPowerPath;
 		argv[2] = NULL;
 
-		call_usermodehelper(RadioPowerPath, argv, envp, 1);
+		call_usermodehelper(RadioPowerPath, argv, envp, UMH_WAIT_PROC);
 	}
 }
 
diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c
index 7f8472c..28f4e04 100644
--- a/drivers/video/uvesafb.c
+++ b/drivers/video/uvesafb.c
@@ -121,7 +121,7 @@  static int uvesafb_helper_start(void)
 		NULL,
 	};
 
-	return call_usermodehelper(v86d_path, argv, envp, 1);
+	return call_usermodehelper(v86d_path, argv, envp, UMH_WAIT_PROC);
 }
 
 /*
diff --git a/security/tomoyo/load_policy.c b/security/tomoyo/load_policy.c
index 3312e56..0432450 100644
--- a/security/tomoyo/load_policy.c
+++ b/security/tomoyo/load_policy.c
@@ -76,6 +76,6 @@  void tomoyo_load_policy(const char *filename)
 	envp[0] = "HOME=/";
 	envp[1] = "PATH=/sbin:/bin:/usr/sbin:/usr/bin";
 	envp[2] = NULL;
-	call_usermodehelper(argv[0], argv, envp, 1);
+	call_usermodehelper(argv[0], argv, envp, UMH_WAIT_PROC);
 	tomoyo_check_profile();
 }