]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Rev. 1.274 put the ttyrel() call before the destroy_dev() in the
authorkib <kib@FreeBSD.org>
Fri, 23 May 2008 16:47:55 +0000 (16:47 +0000)
committerkib <kib@FreeBSD.org>
Fri, 23 May 2008 16:47:55 +0000 (16:47 +0000)
commit797c3188c07ea75e3dec375470a12724a500a856
tree0e4cb5c91c1a42033c1b2fa3ee7b7d3b5bfaf5fb
parent90775e30dbdf185e0d078b6b11fbf16866097173
Rev. 1.274 put the ttyrel() call before the destroy_dev() in the
ttyfree(), freeing the tty. Since destroy_dev() may call d_purge()
cdevsw method, that is the ttypurge() for the tty, the code ends up
accessing freed tty structure.

Put the ttyrel() after destroy_dev() in the ttyfree. To prevent the
panic the rev. 1.274 provided fix for, check the TS_GONE in sysctl
handler and refuse to provide information on such tty.

Reported, debugging help and tested by: pho
DIscussed with and reviewed by: jhb
MFC after: 1 week
sys/kern/tty.c