Re: statically compiled files left over after a 'make world'

From: Matthew Seaman (m.seaman_at_infracaninophile.co.uk)
Date: 08/06/03

  • Next message: freebsd_at_critesclan.com: "RE: statically compiled files left over after a 'make world'"
    Date: Wed, 6 Aug 2003 19:22:49 +0100
    To: bks10@cornell.edu
    
    
    

    On Wed, Aug 06, 2003 at 01:02:43PM -0400, bks10@cornell.edu wrote:
    > If you track 4-STABLE you have nothing to worry about anyway. The bug did
    > not affect 4-STABLE, only 4.8, 4.7, etc...

    Incorrect. It says very plainly in the advisory:

                    FreeBSD 4-STABLE prior to May 22 17:11:44 2003 UTC

    and it also affected all releases made prior to that date. That is,
    all releases except 5.1-RELEASE which came out after the correction
    was made to the sources.
     
    > Peace.
    >
    > On Wed, 6 Aug 2003, Brian Kraemer wrote:
    >
    > > Hello,
    > >
    > > I recently did a 'make world' to update my base system due to the realpath
    > > bug. After that finished, I noticed that I still had the following
    > > statically compiled binaries laying around that did not get updated during
    > > a 'make world'. I track 4-STABLE.
    > >
    > > /usr/bin/miniperl
    > > /sbin/mount_kernfs
    > > /sbin/mount_devfs
    > > /sbin/modunload
    > > /sbin/modload
    > > /sbin/ft

    miniperl is (clearly) part of perl 5.005.03 -- as far as I can
    remember, it's only needed during the compilation of perl in order to
    bootstrap the compilation of the various loadable modules.

    mount_kernfs and mount_devfs have been removed from stable --
    mount_kernfs went fairly recently as I remember.

    Similarly modunload, modload and ft are no longer present on a recent
    4-STABLE system.

    So, yes, all of those can be removed safely.

    > > /stand/boot_crunch
    > > /stand/find
    > > /stand/sed
    > > /stand/test
    > > /stand/pwd
    > > /stand/ppp
    > > /stand/newfs
    > > /stand/minigzip
    > > /stand/cpio
    > > /stand/bad144
    > > /stand/fsck
    > > /stand/ifconfig
    > > /stand/route
    > > /stand/slattach
    > > /stand/mount_nfs
    > > /stand/dhclient
    > > /stand/arp
    > > /stand/gzip
    > > /stand/gunzip
    > > /stand/zcat
    > > /stand/-sh
    > > /stand/[
    > > /stand/sh

    As other posters have said, you need to update /stand separately from
    the rest of the system. Note that all of those files should be hard
    linked together -- if you run

        ls -lai /stand

    you should see that they all share the same inode number. You may
    need to fix up that linkage manually after rebuilding
    /stand/sysinstall

    > > Since they were not updated during a 'make world', does that mean that
    > > they are deprecated and can be safely removed?

    > > If not, why weren't they updated during a 'make world'? Is it a security
    > > risk having them stick around since they haven't been re-linked against the
    > > new libc?

    In general, the most effective way finding files that have become
    surplus to requirements over time is, as you have noted, to do a fresh
    'make installworld' and hunt for files with timestamps older than the
    rest. Even so, you need to apply a little discretion rather than
    automatically deleting any older files. Or make sure you have good
    backups readily available...

    One important point: before starting on such an exercise, you need to
    make sure that you haven't set:

        INSTALL=install -C

    in /etc/make.conf -- that would cause install(1) to avoid overwriting
    any files which was identical to what would be installed. In that
    case, any statically linked binary that used the realpath(3) function
    would necessarily be different to a version compiled before the fix,
    and so certainly would have been replaced. Conversely, a dynamically
    linked binary might not have been updated, even if it did use
    realpath(3), as the applicable realpath(3) code would only affect the
    shared library.

    As to the files being a security risk -- potentially yes, but this bug
    does take some effort to exploit: not all programs that use
    realpath(3) may be exploitable, and in general, unless the programs
    are SUID or SGID or accessible remotely (ie. by users without a login
    on the system) the impact of exploiting the buffer overrun is not
    going to allow the attacker to achieve significant privilege
    escalation. In this case, subverting one of the programs under /stand
    would gain the attacker nothing more than he could gain by simply
    running /stand/sh directly.

            Cheers,

            Matthew

    -- 
    Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                          Savill Way
    PGP: http://www.infracaninophile.co.uk/pgpkey         Marlow
    Tel: +44 1628 476614                                  Bucks., SL7 1TH UK
    
    


    • application/pgp-signature attachment: stored

  • Next message: freebsd_at_critesclan.com: "RE: statically compiled files left over after a 'make world'"

    Relevant Pages

    • Re: VS2005 major development bug
      ... Crashing during compilation would mean then compiler to throw an ICE, but that's surely not the case. ... But I don't want to be pedantic and this has nothing to do with the problem / bug we are discussing in this thread about. ... Managed C++ was to make the pimpl class a nested class of the ref class and pass a pointer of the ref class to the pimpl class. ... A nested class seems not to be allowed anymore to access private members of a managed class. ...
      (microsoft.public.dotnet.languages.vc)
    • Re: Signed zeros: is this a bug?
      ... Looks to me like you've found a bug with the parser/compiler: ... appear within the same "unit of compilation" (expression, function, ... errant "peephole optimizer" pass which tries to roll multiple ...
      (comp.lang.python)
    • Re: Warning on migrating to ATMega8515 - eeprom problem
      ... >> Yes, probably a bug, but it is questionable if it is serious. ... >> It is generally a good practice to avoid relying on reset values. ... Conditional compilation is one way. ... You can thus run the compiled result of the same source code on both CPUs ...
      (comp.arch.embedded)
    • IBM/Absoft bug on Mac OS-X
      ... I have run across a bug using the IBM and Absoft compilers (the latest ... 1501-510 Compilation successful for file test_mod.f. ...
      (comp.lang.fortran)
    • Re: [Full-disclosure] Apple Safari ... DoS Vulnerability
      ... In my book, maybe only in mine, a software bug is security relevant ... or indirect control of a another entity (i.e attacker). ... simply because computers have limited resources. ...
      (Full-Disclosure)