Re: execve errno setting on MIPS

From: Halesh S
Date: Thu Sep 18 2008 - 01:40:38 EST



I will change the Subject line "execve exit status on MIPS" first.


David Newall <davidn <at> davidnewall.com> writes:
>
> Halesh S wrote:
> > char e2BIG[ARG_MAX+1][10];
> > ...
> > for(ind = 0; ind < ARG_MAX+1; ind++)
> > strcpy(e2BIG[ind], "helloworld");
> >
>
> Did you intend to overflow e2BIG? You're copying 11 bytes (including
> terminating NUL) into a 10 byte array.
>

My intenstion is not to overflow in string...
We can change
> > strcpy(e2BIG[ind], "helloworld");
to
strcpy(e2BIG[ind], "helloworl");

But intenstion is to generate E2BIG in
if ((ret = execve(EXE_NAME,e2BIG,envList)) == -1) {

where e2BIG array has more number arguments than ARG_MAX.

Which was possible on ARM,PPC and i386....

For the same code...I got 14 EFAULT....


Thanks,
Halesh








--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/