Bug 11560

Summary: ld-linux.so segfaults when LD_LIBRARY_PATH is set on setgid executable
Product: [Retired] Red Hat Raw Hide Reporter: Jonathan Kamens <jik>
Component: glibcAssignee: Jakub Jelinek <jakub>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-06-02 21:48:36 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jonathan Kamens 2000-05-21 21:55:01 UTC
When an executable is setgid, it is run by a user other than its
owner, and LD_LIBRARY_PATH is set, it segfaults.  This doesn't happen
with LD_RUN_PATH.

> cat foo.c
main()
{
  printf("Hello, world.\n");
}
> gcc foo.c
> ./a.out
Hello, world.
> chmod g+s a.out
> ( setenv LD_LIBRARY_PATH /foo ; ./a.out)
Hello, world.
> su -c tcsh
Password:
# ./a.out
Hello, world.
# (setenv LD_LIBRARY_PATH /foo; ./a.out)
Segmentation fault
# ( setenv LD_RUN_PATH /foo ; ./a.out )
Hello, world.

Here's what I have installed:

gcc-2.95.3-0.20000517
glibc-2.1.90-11

Comment 1 SB 2000-06-02 21:48:36 UTC
Try running it through gdb with that setup and find out where it segfaults 
because I've tried several times unsuccessfuly to reproduce this using same 
package versions described above...

-Stan Bubrouski

Comment 2 Jakub Jelinek 2000-09-04 16:08:16 UTC
Fixed on 2000-05-22, just forgot to close bugzilla. Sorry.