mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Is it legal to return positive value when do_execve() succeeds?
@ 2010-09-30 13:07 Tetsuo Handa
  2010-10-01  2:29 ` Tetsuo Handa
  2010-10-01 12:44 ` Tetsuo Handa
  0 siblings, 2 replies; 13+ messages in thread
From: Tetsuo Handa @ 2010-09-30 13:07 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: linux-kernel

Hello.

I was browsing do_execve() and noticed that do_execve() will return positive
return value if "struct linux_binfmt"->load_binary() returned positive return
value. So far, all in-tree "struct linux_binfmt" users seem to return 0 on
success and negative return value on failure. But search_binary_handler()
itself is designed to allow positive return value on successful execve().

--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1413,6 +1413,9 @@ int do_execve(const char * filename,
 	free_bprm(bprm);
 	if (displaced)
 		put_files_struct(displaced);
+	/* Just for testing. */
+	if (!retval)
+		retval = 1;
 	return retval;
 
 out:

With a patch above (on x86 CentOS 5.5 with 2.6.36-rc6 kernel),
a few programs failed to work properly.

  udevd-event[$PID]: run_program: '$PROGRAM' abnormal exit

Is it legal to return positive value when do_execve() succeeds?

Regards.

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

end of thread, other threads:[~2010-10-05  6:48 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-30 13:07 Is it legal to return positive value when do_execve() succeeds? Tetsuo Handa
2010-10-01  2:29 ` Tetsuo Handa
2010-10-01  5:19   ` Tetsuo Handa
2010-10-04  4:59     ` KOSAKI Motohiro
2010-10-04 13:31       ` Tetsuo Handa
2010-10-05  1:28         ` KOSAKI Motohiro
2010-10-05  2:24           ` Tetsuo Handa
2010-10-05  5:21             ` KOSAKI Motohiro
2010-10-05  6:48               ` Tetsuo Handa
2010-10-05  2:37           ` KOSAKI Motohiro
2010-10-05  2:55             ` KOSAKI Motohiro
2010-10-05  4:40               ` Tetsuo Handa
2010-10-01 12:44 ` Tetsuo Handa

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

Powered by JetHome