[PATCH] Fix the last fork() call for nommu systems

Matt Johnston matt at ucc.asn.au
Sun Apr 8 12:39:46 WST 2012


Hi,

I'm not sure that this will work correctly, have you been
using it on a MMU-less system? After the vfork() it doesn't
execve(), so it will be sharing a lot of memory state with
parent process (which also needs to keep running). For
uclinux systems I think people have usually been using inetd
mode, which doesn't use that code path.

Cheers,
Matt


On Thu, Apr 05, 2012 at 10:50:45AM -0300, Gustavo Zacarias wrote:
> 
> Fix the last lingering fork() call for uClinux (nommu) systems.

> Get rid of the last lingering fork() for nommu systems.
> 
> Signed-off-by: Gustavo Zacarias <gustavo at zacarias.com.ar>
> 
> diff -Nura dropbear-2012.55/svr-main.c dropbear-2012.55-nommu/svr-main.c
> --- dropbear-2012.55/svr-main.c	2012-02-23 10:47:06.000000000 -0300
> +++ dropbear-2012.55-nommu/svr-main.c	2012-04-05 10:46:19.639718670 -0300
> @@ -262,7 +262,11 @@
>  #ifdef DEBUG_NOFORK
>  			fork_ret = 0;
>  #else
> +# ifdef __uClinux__
> +			fork_ret = vfork();
> +# else
>  			fork_ret = fork();
> +# endif
>  #endif
>  			if (fork_ret < 0) {
>  				dropbear_log(LOG_WARNING, "Error forking: %s", strerror(errno));



More information about the Dropbear mailing list