DragonFly BSD
DragonFly kernel List (threaded) for 2003-09
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: Prebinding for DragonFly/FreeBSD-4

From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Mon, 15 Sep 2003 14:23:50 -0700 (PDT)

: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...

    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.

					Matthew Dillon 

[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]