*BSD News Article 92086


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!inferno.mpx.com.au!nsw1.news.telstra.net!news.telstra.net!news-out.internetmci.com!newsfeed.internetmci.com!tezcat!cam-news-hub1.bbnplanet.com!news.bbnplanet.com!news.maxwell.syr.edu!EU.net!Germany.EU.net!Dortmund.Germany.EU.net!interface-business.de!usenet
From: j@ida.interface-business.de (J Wunsch)
Newsgroups: comp.unix.bsd.bsdi.misc
Subject: Re: BSDI 3.0 Impressive
Date: 25 Mar 1997 18:10:46 GMT
Organization: interface business GmbH, Dresden
Lines: 58
Message-ID: <5h94f6$gua@innocence.interface-business.de>
References: <332849E6.71CA@cet.co.jp> <332824B1.6B5F@opengroup.org>
  <E6zpJB.Iv0@news.interactive.net> <5giab8$l8h@vanbc.wimsey.com>
  <5gibgj$bu7@arrow.va.pubnix.com> <5gkf8g$sa8@picasso.op.net>
  <5gme49$6qu@innocence.interface-business.de> <5gn3qc$2ga@arrow.va.pubnix.com>
Reply-To: joerg_wunsch@interface-business.de (Joerg Wunsch)
NNTP-Posting-Host: ida.interface-business.de
X-Newsreader: knews 0.9.6
X-Phone: +49-351-31809-14
X-Fax: +49-351-3361187
X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F  93 21 E0 7D F9 12 D6 4E
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.bsdi.misc:6474

lidl@va.pubnix.com (Kurt J. Lidl) wrote:

> Sure, the support for SCO binaries dictated that they have support
> for this style of shared libraries.  That would qualify as

SCO ELF?  Or what?

> "had other reasons".  It's also a *lot* faster than exec'ing ld.so
> for each program that needs to be started up.

BSD doesn't execute ld.so, it's simply mmap'ed.

 26090 ktrace   NAMI  "/usr/bin/id"
 26090 id       RET   execve 0
 26090 id       CALL  open(0x10a0,0,0)
 26090 id       NAMI  "/usr/libexec/ld.so"		<<<---
 26090 id       RET   open 3				<<<---
 26090 id       CALL  read(0x3,0xefbfd728,0x20)
 26090 id       GIO   fd 3 read 32 bytes
       "Ì\0\M^FÀ\0à\0\0\0 \0\0\0\0\0\0\0\0\0\0 \0\0\0\0\0\0\0\0\0\0\0"
 26090 id       RET   read 32/0x20
 26090 id       CALL  mmap(0,0xe000,0x5,0x2,0x3,0,0,0)	<<<---
 26090 id       RET   mmap 134230016/0x8003000
 26090 id       CALL  mmap(0x8011000,0x2000,0x3,0x12,0x3,0,0xe000,0) <<<---
 26090 id       RET   mmap 134287360/0x8011000

Too bad that there are no comparative figures, but i bet the speed
difference between both implementations isn't very big.  (Speed
differences < 10 % are usually only noticed by benchmark programs, but
not by users.)  Given the disadvantage of the complicated way to
create a BSD/OS shared lib (as you describe it), it reminds me the
Linux problem with their shared libs earlier.

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

The BSD reimplementation doesn't (any more) suffer from them.

>   (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*!

You should at least know the facts before posting. :-)  It was by no
means related to shared linking.  It were two things, an inherited
stack overflow problem from the locale implementation as of 4.4BSD,
coupled with a stupid hack that has later been abandoned (but
forgotten about in the FreeBSD 2.1.x line) where a localization
function could be called from crt0.o.  Not the shared loader, but
crt0.o.

The embarassing thing was only that this hack was stupid and totally
unnecessary.

-- 
J"org Wunsch					       Unix support engineer
joerg_wunsch@interface-business.de       http://www.interface-business.de/~j