Prebinding for DragonFly/FreeBSD-4

Matthew Dillon dillon at apollo.backplane.com
Mon Sep 15 14:25:04 PDT 2003


:Simon 'corecode' Schubert wrote:
:> 
:> [1]: http://chlamydia.fs.ei.tum.de/~corecode/prebind.diff
:
:Looking at the hash code... does this not goto into the middle
:of a for() block?  I don't remember my C too well... but that
:looks nasty...
:
:--Toby.

    There are a lot of goto's in there.  I'm only worried about the goto
    that appears to be hidden inside the PREBIND_CKLEN macro, though.
    Also, the macro uses variables that it assumes exist in the calling
    context, which is another extremely dangerous 'hiding' mechanism.
    That should be cleaned up.  Anyone remember the nsfm_*() NFS macros?
    They did the same thing and the result was a huge mess.  It took me
    a week just to understand what those macros did, let alone do any work
    on them.

    I recommend changing PREBIND_CKLEN() into an inline function and adding
    as arguments the variables that were being assumed.  It will
    be just as fast and a lot more human-readable.

    The other goto's are necessary evils, including the ones in the for()
    loop.  That is, the code could be rewritten to remove many of them,
    but that would impose an inappropriately large burden on the author
    and there are a ton of other procedures in the kernel source that do the
    same thing.  I can read the code just fine, PREBIND_CKLEN() is the
    only piece I have a problem with.

    --

    Is SUID and SGID security being dealt with properly in regards to the
    new environment variables?  We probably want to completely disable any
    prebinding action on SUID and SGID programs.

					-Matt
					Matthew Dillon 
					<dillon at xxxxxxxxxxxxx>





More information about the Kernel mailing list