All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] poweroff: fix bug in orderly_poweroff
@ 2012-09-19  3:27 hongfeng
  2012-09-19  3:42 ` Kees Cook
  2012-09-19  4:46 ` Eric W. Biederman
  0 siblings, 2 replies; 6+ messages in thread
From: hongfeng @ 2012-09-19  3:27 UTC (permalink / raw)
  To: akpm, gorcunov, keescook, serge.hallyn, ebiederm; +Cc: linux-kernel, hongfeng

orderly_poweroff is trying to poweroff platform by two steps:
step 1: Call userspace application to poweroff
step 2: If userspace poweroff fail, then do a force power off if force param is set.

The bug here is, step 1 is always successful with param UMH_NO_WAIT,
should change to UMH_WAIT_PROC which will monitor the return value ofuserspace application.

Change-Id: I2f9ebbb90c0c2443780080ec9507c8d004e5da74
Signed-off-by: Feng Hong <hongfeng@marvell.com>
---
 kernel/sys.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/sys.c b/kernel/sys.c
index 241507f..1b30b30 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -2204,7 +2204,7 @@ static int __orderly_poweroff(void)
 		return -ENOMEM;
 	}
 
-	ret = call_usermodehelper_fns(argv[0], argv, envp, UMH_NO_WAIT,
+	ret = call_usermodehelper_fns(argv[0], argv, envp, UMH_WAIT_PROC,
 				      NULL, argv_cleanup, NULL);
 	if (ret == -ENOMEM)
 		argv_free(argv);
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-09-19  6:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-19  3:27 [PATCH] poweroff: fix bug in orderly_poweroff hongfeng
2012-09-19  3:42 ` Kees Cook
2012-09-19  4:46 ` Eric W. Biederman
2012-09-19  5:07   ` Feng Hong
2012-09-19  5:58     ` Eric W. Biederman
2012-09-19  6:26       ` Feng Hong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.