On 8/4/2009 7:13 AM, Graham Murray wrote:
Remy Blank<remy.bl...@pobox.com>  writes:

The whole issue seems to be handled quite strangely IMO. You would think
breaking Python for all ~x86 is a major offense...

It did not break for all ~x86. I have 2 systems both running ~x86, both
have emerged (but not made active) python-3.1, /usr/bin/python is a bash
script on both yet emerge works with no problems. The only non-standard
things are that I have unmasked gcc-4.4.1 and am using git 2.6.31-rc
kernels.

Aha. I think I've discovered the "problem". There was a change in the kernel execl() call between 2.6.27 and 2.6.28:

--- linux-2.6.27-hardened-r3/fs/binfmt_script.c 2008-10-09 18:13:53.000000000 -0400 +++ linux-2.6.28-hardened/fs/binfmt_script.c 2008-12-24 18:26:37.000000000 -0500
@@ -22,14 +22,15 @@
        char interp[BINPRM_BUF_SIZE];
        int retval;

- if ((bprm->buf[0] != '#') || (bprm->buf[1] != '!') || (bprm->sh_bang))
+       if ((bprm->buf[0] != '#') || (bprm->buf[1] != '!') ||
+           (bprm->recursion_depth > BINPRM_MAX_RECURSION))
                return -ENOEXEC;
        /*
         * This section does the #! interpretation.
         * Sorta complicated, but hopefully it will work.  -TYT
         */

-       bprm->sh_bang = 1;
+       bprm->recursion_depth++;
        allow_write_access(bprm->file);
        fput(bprm->file);
        bprm->file = NULL;


The kernel >= 2.6.28 now supports nesting up to 4 levels of script in the #! lines, if I'm reading that right, whereas < 2.6.28 it only supported 1 level. I'll go update the b.g.o entry and try upgrading my kernel. Though I dunno what that means for Gentoo/FreeBSD.

--Mike

Reply via email to