From: Rob Landley Date: Tue, 10 May 2016 08:26:02 +0000 (-0500) Subject: Use CFG_TOYBOX_NORECURSE to avoid X-Git-Tag: android-x86-6.0-r1~1^2^2 X-Git-Url: http://git.sourceforge.jp/view?p=android-x86%2Fexternal-toybox.git;a=commitdiff_plain;h=4e756d7f9fd1b32b545ce8c43120dc733653b52f Use CFG_TOYBOX_NORECURSE to avoid all that tedious mucking about with hyperspace stack measuring in ways that confuse security stuff. --- diff --git a/main.c b/main.c index 14c4ff71..eeae2f39 100644 --- a/main.c +++ b/main.c @@ -140,7 +140,8 @@ void toy_exec(char *argv[]) // Compiler writers have decided subtracting char * is undefined behavior, // so convert to integers. (LP64 says sizeof(long)==sizeof(pointer).) - if (toys.stacktop && labs((long)toys.stacktop-(long)&which)>6000) return; + if (!CFG_TOYBOX_NORECURSE) + if (toys.stacktop && labs((long)toys.stacktop-(long)&which)>6000) return; // Return if we need to re-exec to acquire root via suid bit. if (toys.which && (which->flags&TOYFLAG_ROOTONLY) && toys.wasroot) return;