mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [resend][PATCH] exec: don't turn PF_KTHREAD off when a target command was not found
@ 2010-10-19  5:30 KOSAKI Motohiro
  0 siblings, 0 replies; only message in thread
From: KOSAKI Motohiro @ 2010-10-19  5:30 UTC (permalink / raw)
  To: LKML, Andrew Morton; +Cc: kosaki.motohiro, Roland McGrath, Oleg Nesterov

Now, do_execve() turn PF_KTHREAD off before search_binary_handler().
It has theorical risk of PF_KTHREAD lost. We don't have to turn 
PF_KTHREAD off when ENOEXEC case.

This patch move this flag modification after founding execution file.

this is only theorical issue because now any kthread don't
call do_execve() directly. but anyway fixing would be better.

Acked-by: Roland McGrath <roland@redhat.com>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
---
 fs/exec.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/fs/exec.c b/fs/exec.c
index fcbd39e..6469c26 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1009,7 +1009,7 @@ int flush_old_exec(struct linux_binprm * bprm)
 
 	bprm->mm = NULL;		/* We're using it now */
 
-	current->flags &= ~PF_RANDOMIZE;
+	current->flags &= ~(PF_RANDOMIZE | PF_KTHREAD);
 	flush_thread();
 	current->personality &= ~bprm->per_clear;
 
@@ -1412,7 +1412,6 @@ int do_execve(const char * filename,
 	if (retval < 0)
 		goto out;
 
-	current->flags &= ~PF_KTHREAD;
 	retval = search_binary_handler(bprm,regs);
 	if (retval < 0)
 		goto out;
-- 
1.6.5.2




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-10-19  5:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-19  5:30 [resend][PATCH] exec: don't turn PF_KTHREAD off when a target command was not found KOSAKI Motohiro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®