*BSD News Article 91520


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!news.cs.su.oz.au!metro!metro!munnari.OZ.AU!news.ecn.uoknor.edu!feed1.news.erols.com!news-xfer.netaxs.com!cpk-news-hub1.bbnplanet.com!cam-news-hub1.bbnplanet.com!news.bbnplanet.com!howland.erols.net!newsxfer.itd.umich.edu!uunet!in2.uu.net!199.170.214.67!trebuchet.va.pubnix.com!not-for-mail
From: lidl@va.pubnix.com (Kurt J. Lidl)
Newsgroups: comp.unix.bsd.bsdi.misc
Subject: Re: BSDI 3.0 Impressive
Date: 18 Mar 1997 17:09:16 -0500
Organization: UUNET Technologies -- Fairfax, Virginia, USA
Lines: 54
Message-ID: <5gn3qc$2ga@arrow.va.pubnix.com>
References: <332849E6.71CA@cet.co.jp> <5gibgj$bu7@arrow.va.pubnix.com> <5gkf8g$sa8@picasso.op.net> <5gme49$6qu@innocence.interface-business.de>
NNTP-Posting-Host: arrow.va.pubnix.com
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.bsdi.misc:6395

J Wunsch <joerg_wunsch@interface-business.de> wrote:
>root@candle.pha.pa.us (Bruce Momjian) wrote:
>
>> Considering the system overhead of dynamic linked libraries compared to
>> BSD/OS shared libraries, what is the advantage of dynamic linked
>> libraries?
>
>Mainly two reasons:
>
>. consistency
>
>Given that the other BSDs did already have a working SunOS-style
>shared library system by the time BSDi developed its own one, i still
>wonder whether this was just NYI, or really had other reasons.  Right
>now, they are incompatible with NetBSD and FreeBSD, sigh.

Sure, the support for SCO binaries dictated that they have support
for this style of shared libraries.  That would qualify as
"had other reasons".  It's also a *lot* faster than exec'ing ld.so
for each program that needs to be started up.  I'm pretty sure,
but not positive, that the BSD/OS implementation of shared libraries
is somewhat kinder to the MMU PTE cache as well, but I'm not sure.

In my opinion, the biggest pain about the current shared library
scheme is the difficulty in installing a fixed version of the
library -- under SunOS, you could have libc.so.4.0 and install
a libc.so.4.1 and everything would start using it.  Under BSD/OS,
this will not happen.  You *must* replace the existing libc.so.X.Y
module.  If you mess it up, your system is toast.

There are many, many documented security problems that Sun has had
with their shared library implementation, LD_LIBRARY_PATH, setuid
and setgid programs and so forth since SunOS 4.0 was released.  Most
of them have been fixed, but its taken the better part of a decade
for this to happen.  Due to the simplicity (and inflexibility) of
the BSDi scheme, most of these potential security problems are
avoided...  (This reminds me of the recent FreeBSD security alert
about the ld.so honoring the locale() setting and the security
hole that resulting from *that*!  So, the technology to do dynamic
binding is really tricky to get just right and a small enhancement
can open up a security hole big enough to drive a truck through.)

On the other hand, its a royal pain in the rear to install your
own (custom for an application) shared libraries under BSDi.
Outside of the Xi server, have you seen anybody else write an
application that attempts to install a shared library under BSD/OS?
There are dozens of programs under SunOS that have their own custom
shared libraries.

-Kurt
-- 
/* Kurt J. Lidl (lidl@va.pubnix.com) UUCP: <Earth>!uunet!lidl */
/*   Don't confuse my opinions with my employer's opinions!   */
/*  We may just have to destroy USENET, in order to save it.  */