freebsd-dev/sys
Neel Natu 1a688aa53e Fix handling of BUS_PROBE_NOWILDCARD in 'device_probe_child()'.
Device probe value of BUS_PROBE_NOWILDCARD should be treated specially only
if the device has a fixed devclass. Otherwise it should be interpreted just
as if the driver doesn't want to claim the device.

Prior to this change a device that was not claimed explicitly by its driver
would remain "attached" to the driver that returned BUS_PROBE_NOWILDCARD.
This would bump up the reference on 'driver->refs' and its 'dev->ops' would
point to the 'driver->ops'. When the driver is subsequently unloaded the
'dev->ops->cls' is left pointing to freed memory.

This fixes an easily reproducible #GP fault caused by loading and unloading
vmm.ko multiple times.

Differential Revision:	https://reviews.freebsd.org/D2294
Reviewed by:	imp, jhb
Discussed with:	rstone
Reported by:	Leon Dang (ldang@nahannisys.com)
MFC after:	2 weeks
2015-04-15 16:22:05 +00:00
..
amd64 Use explicitly sized types in EFI module metadata 2015-04-10 19:26:45 +00:00
arm Update the arm devmap code to also work with arm64. 2015-04-13 13:21:27 +00:00
arm64 Enter a critical section when storing the vfp registers, we don't want to 2015-04-15 14:30:07 +00:00
boot * Remove the wfi when the efi loader returns, it's unneeded and is not 2015-04-14 14:15:14 +00:00
bsm
cam Initialize async_arg_ptr in xpt_async when called with async_code 2015-04-14 16:33:33 +00:00
cddl libdtrace: add support for lazyload mode. 2015-04-08 02:36:37 +00:00
compat Rewrite linprocfs_domtab() as a wrapper around kern_getfsstat(). This 2015-04-15 09:13:11 +00:00
conf Add psci for arm64. This is currently used when rebooting and powering off 2015-04-13 16:41:33 +00:00
contrib Sync with OpenBSD: Use volatile instead of __volatile__. 2015-04-13 20:23:46 +00:00
crypto
ddb
dev snd_hda: add support for the Lenovo X1 20BS model. 2015-04-15 05:24:39 +00:00
fs tmpfs_getattr(): Return more correct allocated byte counts. 2015-04-10 19:04:39 +00:00
gdb
geom Remove sleeps from geom_up thread on device destruction. 2015-04-09 13:09:05 +00:00
gnu The GNU Amlogic DTS files have some errors (e.g. bad register 2015-04-11 08:17:39 +00:00
i386 Add config option PAE_TABLES for the i386 kernel. It switches pmap to 2015-04-13 15:22:45 +00:00
isa
kern Fix handling of BUS_PROBE_NOWILDCARD in 'device_probe_child()'. 2015-04-15 16:22:05 +00:00
kgssapi
libkern
mips Start enabling the available GPIO pins on the Carambola 2. 2015-04-12 00:02:32 +00:00
modules Fix build race on armv6* and powerpc*. 2015-04-04 20:30:20 +00:00
net Minor change to the macros to make sure that if an AF is passed that is neither AF_INET6 nor AF_INET that we don't touch random bits of memory. 2015-04-15 14:46:45 +00:00
net80211 iwn, wlan: fix typos 2015-04-10 20:55:17 +00:00
netgraph Initial Bluetooth LE support. 2015-04-07 10:22:56 +00:00
netinet Fix RSS build - netisr input / NETISR_IP_DIRECT is used here. 2015-04-15 00:57:21 +00:00
netinet6 Fix a possible refcount leak in regen_tmpaddr(). 2015-04-13 01:55:42 +00:00
netipsec o Use new function ip_fillid() in all places throughout the kernel, 2015-04-01 22:26:39 +00:00
netnatm
netpfil pf: Fix forwarding detection 2015-04-14 19:07:37 +00:00
netsmb
nfs
nfsclient
nfsserver
nlm
ofed fd: remove filedesc argument from fdclose 2015-04-11 15:40:28 +00:00
opencrypto add the define to properly guard this header.. 2015-04-07 09:00:03 +00:00
pc98
powerpc Move the 32-bit compatible procfs types from freebsd32.h to <sys/procfs.h> 2015-04-08 16:30:45 +00:00
rpc Remove hard limits on number of accepting NFS connections. 2015-04-07 10:25:27 +00:00
security
sparc64 Add support for the uart classes to set their default register shift value. 2015-04-11 17:16:23 +00:00
sys Point to the right location where __FreeBSD_version numbers are documented. 2015-04-15 09:39:52 +00:00
teken
tools
ufs Fix build (with gcc). 2015-03-27 15:49:21 +00:00
vm Rework r281162. Indeed, the flexible array member is preferable here. 2015-04-12 06:21:58 +00:00
x86 Add config option PAE_TABLES for the i386 kernel. It switches pmap to 2015-04-13 15:22:45 +00:00
xdr
xen
Makefile