freebsd kernel with SKQ
Go to file
Konstantin Belousov b8fc1b23be If dlopen() is called for the dso that has been already loaded as a
dependency, then the dso never has its DAG initialized. Empty DAG
makes ref_dag() call in dlopen() a nop, and the dso refcount is off
by one.

Initialize the DAG on the first dlopen() call, using a boolean flag
to prevent double initialization.

From the PR (edited):
Assume we have a library liba.so, containing a function a(), and a
library libb.so, containing function b(). liba.so needs functionality
from libb.so, so liba.so links in libb.so.

An application doesn't know about the relation between these libraries,
but needs to call a() and b(). It dlopen()s liba.so and obtains a
pointer to a(), then it dlopen()s libb.so and obtains a pointer to b().

As soon as the application doesn't need a() anymore, it dlclose()s liba.so.

Expected result: the pointer to b() is still valid and can be called
Actual result: the pointer to b() has become invalid, even though the
application did not dlclose() the handle to libb.so. On calling b(), the
application crashes with a segmentation fault.

PR:	misc/151861
Based on patch by:	jh
Reviewed by:	kan
Tested by:	Arjan van Leeuwen <freebsd-maintainer opera com>
MFC after:	1 week
2010-11-03 09:23:08 +00:00
bin sh: Fix some issues with aliases and case, by importing dash checkkwd code. 2010-11-02 23:44:29 +00:00
cddl Fix ztest when it is executed by just 'ztest' and not by full path 2010-11-01 10:42:14 +00:00
contrib MFV of tzdata2010o, r214716 2010-11-03 01:30:56 +00:00
crypto Remove copyright strings printed at login time via login(1) or sshd(8). 2010-09-28 20:57:14 +00:00
etc Add a jails directory in the examples section 2010-10-24 23:19:11 +00:00
games mdoc: drop redundant .Pp and .LP calls 2010-10-08 12:40:16 +00:00
gnu Add FreeBSD 8.2. 2010-10-14 14:48:11 +00:00
include Add a new libc function: cfmakesane(3). 2010-11-02 17:00:56 +00:00
kerberos5 Fix a typo. 2010-01-09 18:53:03 +00:00
lib Add a new libc function: cfmakesane(3). 2010-11-02 17:00:56 +00:00
libexec If dlopen() is called for the dso that has been already loaded as a 2010-11-03 09:23:08 +00:00
release Add a short note about kernel modules in FIXIT mode. 2010-10-27 17:13:38 +00:00
rescue MFtbemd: 2010-08-23 22:24:11 +00:00
sbin Send packets to remote node only via the send thread to avoid possible 2010-11-02 22:13:08 +00:00
secure Revert changes of 'assure' to 'ensure' made in r211936. 2010-09-11 10:49:56 +00:00
share Fix a few typos and style nits in the example code. 2010-11-02 12:40:13 +00:00
sys Clean up leftover USB device ID after r213856. This fixes: 2010-11-03 07:51:33 +00:00
tools sh: Fix some issues with aliases and case, by importing dash checkkwd code. 2010-11-02 23:44:29 +00:00
usr.bin Correct the abbreviations for general I/O and signal traces. 2010-11-01 15:18:57 +00:00
usr.sbin Give the user a hint as to what config(8) is unhappy with. 2010-11-02 05:27:05 +00:00
COPYRIGHT Happy New Year 2010! :-) 2009-12-31 10:00:37 +00:00
LOCKS Update LOCKS syntax. 2008-06-05 19:47:58 +00:00
MAINTAINERS Add a comment to MAINTAINERS indicating that sbin/routed is in fact 2010-04-10 12:29:09 +00:00
Makefile Connect FDT infrastructure to the build system. 2010-06-13 13:02:43 +00:00
Makefile.inc1 Check TARGET_ARCH as well as TARGET to determine if we are doing a cross 2010-09-08 19:53:16 +00:00
Makefile.mips Guard against TARGET_ABI being undefined (TARGET_ABI will go away soon) 2010-08-26 14:54:12 +00:00
ObsoleteFiles.inc catch up manual pages with rename of vm_page_sleep_busy to vm_page_sleep_if_busy 2010-10-20 06:29:11 +00:00
README
UPDATING add dates along with revision numbers in UPDATING entry for 20100915 2010-10-25 07:39:05 +00:00

This is the top level of the FreeBSD source directory.  This file
was last revised on:
$FreeBSD$

For copyright information, please see the file COPYRIGHT in this
directory (additional copyright information also exists for some
sources in this tree - please see the specific source directories for
more information).

The Makefile in this directory supports a number of targets for
building components (or all) of the FreeBSD source tree, the most
commonly used one being ``world'', which rebuilds and installs
everything in the FreeBSD system from the source tree except the
kernel, the kernel-modules and the contents of /etc.  The ``world''
target should only be used in cases where the source tree has not
changed from the currently running version.  See:
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html
for more information, including setting make(1) variables.

The ``buildkernel'' and ``installkernel'' targets build and install
the kernel and the modules (see below).  Please see the top of
the Makefile in this directory for more information on the
standard build targets and compile-time flags.

Building a kernel is a somewhat more involved process, documentation
for which can be found at:
   http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html
And in the config(8) man page.
Note: If you want to build and install the kernel with the
``buildkernel'' and ``installkernel'' targets, you might need to build
world before.  More information is available in the handbook.

The sample kernel configuration files reside in the sys/<arch>/conf
sub-directory (assuming that you've installed the kernel sources), the
file named GENERIC being the one used to build your initial installation
kernel.  The file NOTES contains entries and documentation for all possible
devices, not just those commonly used.  It is the successor of the ancient
LINT file, but in contrast to LINT, it is not buildable as a kernel but a
pure reference and documentation file.


Source Roadmap:
---------------
bin		System/user commands.

contrib		Packages contributed by 3rd parties.

crypto		Cryptography stuff (see crypto/README).

etc		Template files for /etc.

games		Amusements.

gnu		Various commands and libraries under the GNU Public License.
		Please see gnu/COPYING* for more information.

include		System include files.

kerberos5	Kerberos5 (Heimdal) package.

lib		System libraries.

libexec		System daemons.

release		Release building Makefile & associated tools.

rescue		Build system for statically linked /rescue utilities.

sbin		System commands.

secure		Cryptographic libraries and commands.

share		Shared resources.

sys		Kernel sources.

tools		Utilities for regression testing and miscellaneous tasks.

usr.bin		User commands.

usr.sbin	System administration commands.


For information on synchronizing your source tree with one or more of
the FreeBSD Project's development branches, please see:

  http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/synching.html