This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/13068] Use O_CLOEXEC for /etc/ld.so.cache and .so libraries


http://sourceware.org/bugzilla/show_bug.cgi?id=13068

--- Comment #1 from Ross Lagerwall <rosslagerwall at gmail dot com> 2011-09-05 14:29:53 UTC ---
Created attachment 5919
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5919
test program

Here is a test program which on my system (timing dependent) reproduces the
bug.

gcc -Wall -O2 -o test3 test3.c -lpthread

It will print out "close(3) = 0" if an open file descriptor leaked through to a
child process. Otherwise it will print "close(3) = -1".

The problem comes about because gethostbyname() dynamically loads libraries
without opening them O_CLOEXEC.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]