freebsd-nq/sys
Mikolaj Golub 47813f5d94 Kernel and modules have "set_vnet" linker set, where virtualized
global variables are placed. When a module is loaded by link_elf
linker its variables from "set_vnet" linker set are copied to the
kernel "set_vnet" ("modspace") and all references to these variables
inside the module are relocated accordingly.

The issue is when a module is loaded that has references to global
variables from another, previously loaded module: these references are
not relocated so an invalid address is used when the module tries to
access the variable. The example is V_layer3_chain, defined in ipfw
module and accessed from ipfw_nat.

The same issue is with DPCPU variables, which use "set_pcpu" linker
set.

Fix this making the link_elf linker on a module load recognize
"external" DPCPU/VNET variables defined in the previously loaded
modules and relocate them accordingly. For this set_pcpu_list and
set_vnet_list are used, where the addresses of modules' "set_pcpu" and
"set_vnet" linker sets are stored.

Note, archs that use link_elf_obj (amd64) were not affected by this
issue.

Reviewed by:	jhb, julian, zec (initial version)
MFC after:	1 month
2012-09-27 14:55:15 +00:00
..
amd64 After r205013, amd64 and i386 CPU family and model IDs were printed out 2012-09-21 10:31:19 +00:00
arm Implementing pmap_kextract(va) as pmap_extract(kernel_pmap, va) is 2012-09-27 05:39:42 +00:00
boot MFi386: revision 240637 2012-09-23 08:50:54 +00:00
bsm
cam Remove useless NULL checks after M_WAITOK allocations. 2012-09-27 10:51:38 +00:00
cddl Merge recent vendor changes in ZFS. 2012-09-26 09:37:58 +00:00
compat Remove redundant check 2012-09-12 10:12:03 +00:00
conf Improve the check for p4 opened files. 2012-09-22 07:44:36 +00:00
contrib Fix panic introduced by me in r240835, when zero weight 2012-09-25 12:45:41 +00:00
crypto
ddb
dev Fix zillions of style(9) and spacing bugs introduced by r240981. 2012-09-27 10:46:22 +00:00
fs Modify the NFSv4 client so that it can handle owner 2012-09-20 02:49:25 +00:00
gdb
geom Use the topology lock to protect list of providers while withering them. 2012-09-22 12:41:49 +00:00
gnu/fs Add VFCF_READONLY flag that indicates ntfs and xfs file systems are 2012-09-12 03:42:52 +00:00
i386 After r205013, amd64 and i386 CPU family and model IDs were printed out 2012-09-21 10:31:19 +00:00
ia64 userret() already checks for td_locks when INVARIANTS is enabled, so 2012-09-08 18:27:11 +00:00
isa
kern Kernel and modules have "set_vnet" linker set, where virtualized 2012-09-27 14:55:15 +00:00
kgssapi
libkern s/ is is / is /g 2012-09-14 22:00:03 +00:00
mips Prefer __containerof() above member2struct(). 2012-09-15 19:28:54 +00:00
modules Add TRIM support. 2012-09-23 19:40:58 +00:00
net - In the bridge_enqueue() do success/error accounting for 2012-09-26 20:09:48 +00:00
net80211 Fix a crash bug introduced in the iterate node work recently done. 2012-09-16 22:45:00 +00:00
netatalk
netgraph o Create directory sys/netpfil, where all packet filters should 2012-09-14 11:51:49 +00:00
netinet Fix bug in TCP_KEEPCNT setting, which slipped in in the last round 2012-09-27 07:13:21 +00:00
netinet6 Merge the projects/pf/head branch, that was worked on for last six months, 2012-09-08 06:41:54 +00:00
netipsec Add missing break 2012-09-18 08:00:43 +00:00
netipx
netnatm
netncp
netpfil EBUSY is a better reply for refusing to unload pf(4) or pfsync(4). 2012-09-22 19:03:11 +00:00
netsmb
nfs
nfsclient
nfsserver
nlm
ofed Align the PCI Express #defines with the style used for the PCI-X 2012-09-18 22:04:59 +00:00
opencrypto
pc98 MFi386: revision 237445 2012-09-23 09:13:57 +00:00
pci
powerpc Move the prototype for savectx from cpu.h to pcb.h, as it is on other 2012-09-23 17:33:16 +00:00
rpc Partial revert of r239963: 2012-09-24 03:14:17 +00:00
security
sparc64 Correct double "the the" 2012-09-14 21:28:56 +00:00
sys Add rounddown2() macro similar to the roundup2() macro. 2012-09-22 17:49:25 +00:00
teken
tools
ufs
vm Address a race condition that was introduced in r238212. Unless the page 2012-09-23 17:42:39 +00:00
x86
xdr
xen
Makefile