[PATCH 4/9] user-cr: ppc32 eclone wrapper

Nathan Lynch ntl at pobox.com
Thu Nov 19 08:18:45 PST 2009


On Tue, 2009-11-17 at 18:55 -0600, Nathan Lynch wrote:

> +int eclone(int (*fn)(void *), void *fn_arg, int clone_flags_low,
> +	   struct clone_args *clone_args, pid_t *pids)
> +{
> +	struct clone_args my_args;
> +	unsigned long child_sp;
> +	int newpid;
> +
> +	if (clone_args->child_stack)
> +		child_sp = clone_args->child_stack +
> +			clone_args->child_stack_size - 1;

Should be
		child_sp = (clone_args->child_stack +
			clone_args->child_stack_size - 1) & ~0xf;

Otherwise the child starts with an unaligned sp, causing accesses
outside of the stack region.




More information about the Containers mailing list