From nobody@FreeBSD.org  Tue Jul 30 13:46:07 2002
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 6E7E737B400
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 30 Jul 2002 13:46:07 -0700 (PDT)
Received: from www.freebsd.org (www.FreeBSD.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 3176B43E42
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 30 Jul 2002 13:46:07 -0700 (PDT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.4/8.12.4) with ESMTP id g6UKk7OT052562
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 30 Jul 2002 13:46:07 -0700 (PDT)
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.4/8.12.4/Submit) id g6UKk7QA052561;
	Tue, 30 Jul 2002 13:46:07 -0700 (PDT)
Message-Id: <200207302046.g6UKk7QA052561@www.freebsd.org>
Date: Tue, 30 Jul 2002 13:46:07 -0700 (PDT)
From: Lee Brotherston <lee@nerds.org.uk>
To: freebsd-gnats-submit@FreeBSD.org
Subject: ldconfig man page amendment
X-Send-Pr-Version: www-1.0

>Number:         41180
>Category:       misc
>Synopsis:       ldconfig man page amendment
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    jdp
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jul 30 13:50:01 PDT 2002
>Closed-Date:    Sun Aug 18 11:13:27 PDT 2002
>Last-Modified:  Sun Aug 18 11:13:27 PDT 2002
>Originator:     Lee Brotherston
>Release:        FreeBSD 4.6-RC #3
>Organization:
>Environment:
FreeBSD cybergimp.nerds.org.uk 4.6-RC FreeBSD 4.6-RC #3: Sat Jun 15 21:56:30 BST 2002 lee@cybergimp.nerds.org.uk:/usr/src/sys/compile/NEWGIMPYKERN  i386

>Description:
The man page for ldconfig(8) says:

"Security

Special care must be taken when loading shared libraries into the address space of set-user-Id programs.  Whenever such a program is run, the dynamic linker will only load shared libraries from the hints file.  In particular, the LD_LIBRARY_PATH is not used to search for libraries."

This is true for most users, but not for root.  I know setuid programs are generally setuid root, and root can do pretty much what it likes, but the man page is not 100% correct.  Just wanted to suggest and "unless you are root" type addition to the page ;)
>How-To-Repeat:
$ su
Password:
# export LD_LIBRARY_PATH="/var/tmp"
# cp /usr/lib/libcrypt.so.2 /var/tmp/
# ldd /usr/bin/passwd
/usr/bin/passwd:
        libcrypt.so.2 => /var/tmp/libcrypt.so.2 (0x2806c000)
        librpcsvc.so.2 => /usr/lib/librpcsvc.so.2 (0x28085000)
        libutil.so.3 => /usr/lib/libutil.so.3 (0x2808d000)
        libc.so.4 => /usr/lib/libc.so.4 (0x28096000)

>Fix:
Presumably an ammendment to the man page ;)  Although I have just raised another problem report (misc/41179: LD_LIBRARY_PATH security checks) as to wether this behaviour is correct or not.
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->jdp 
Responsible-Changed-By: schweikh 
Responsible-Changed-When: Sun Aug 18 10:50:16 PDT 2002 
Responsible-Changed-Why:  
John, since you have done most commits to ldconfig(8) and 
ldconfig.c, can you please handle this request? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=41180 
State-Changed-From-To: open->closed 
State-Changed-By: jdp 
State-Changed-When: Sun Aug 18 11:13:09 PDT 2002 
State-Changed-Why:  
Fixed in -current and -stable. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=41180 
>Unformatted:
