HardenedBSD/sys
Andrey V. Elsukov a716ad4a35 Fix possible panic during ifnet detach in rtsock.
The panic can happen, when some application does dump of routing table
using sysctl interface. To prevent this, set IFF_DYING flag in
if_detach_internal() function, when ifnet under lock is removed from
the chain. In sysctl_rtsock() take IFNET_RLOCK_NOSLEEP() to prevent
ifnet detach during routes enumeration. In case, if some interface was
detached in the time before we take the lock, add the check, that ifnet
is not DYING. This prevents access to memory that could be freed after
ifnet is unlinked.

PR:		227720, 230498, 233306
Reviewed by:	bz, eugen
MFC after:	1 week
Sponsored by:	Yandex LLC
Differential Revision:	https://reviews.freebsd.org/D18338
2018-11-27 09:04:06 +00:00
..
amd64 Remove superfluous bzero in getcontext/swapcontext/sendsig 2018-11-26 20:56:05 +00:00
arm Prevent kernel stack disclosure in signal delivery 2018-11-26 20:52:53 +00:00
arm64 Prevent kernel stack disclosure in signal delivery 2018-11-26 20:52:53 +00:00
bsm
cam NVME trim clocking 2018-11-27 00:36:35 +00:00
cddl
compat
conf Add dependency to allow if_muge device to be only ethernet device in stripped-down RPI3 kernel. 2018-11-26 22:45:58 +00:00
contrib
crypto
ddb
dev Check for an allocation failure before dereferencing the pointer. 2018-11-26 22:42:52 +00:00
dts
fs
gdb
geom
gnu
i386 Remove superfluous bzero in getcontext/swapcontext/sendsig 2018-11-26 20:56:05 +00:00
isa
kern Remove superfluous bzero in getcontext/swapcontext/sendsig 2018-11-26 20:56:05 +00:00
kgssapi
libkern
mips Prevent kernel stack disclosure in getcontext/swapcontext 2018-11-26 20:50:55 +00:00
modules
net Fix possible panic during ifnet detach in rtsock. 2018-11-27 09:04:06 +00:00
net80211
netgraph ng_source(4): correction after the change r340617 2018-11-27 04:05:38 +00:00
netinet
netinet6
netipsec
netpfil
netsmb
nfs
nfsclient
nfsserver
nlm
ofed
opencrypto
powerpc Prevent kernel stack disclosure in getcontext/swapcontext 2018-11-26 20:50:55 +00:00
riscv Prevent kernel stack disclosure in signal delivery 2018-11-26 20:52:53 +00:00
rpc
security
sparc64
sys
teken
tests
tools
ufs
vm
x86
xdr
xen
Makefile