devfs - Fix use-after-free case when making pty's invisible
authorMatthew Dillon <dillon@apollo.backplane.com>
Mon, 13 Sep 2010 15:20:16 +0000 (08:20 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Mon, 13 Sep 2010 15:20:16 +0000 (08:20 -0700)
commit92fb0c6a27383d51b2bf2ee766f3fe9443f8d786
tree93a9a508be5fdc1f86f6878cfc6ec112238a65de
parent149a3d9e0bf4fc626a558cb119efd3960dd19ed1
devfs - Fix use-after-free case when making pty's invisible

* Fix a use-after-free case when making a pty devfs node invisible.
  The dev_dclose().  Move the test/flag to before the dev_dclose() call.

* Document that the pty code may destroy the device in the dev_dclose()
  call, causing the node to become stale.

Reported-by: Francois Tigeot <ftigeot@wolfpond.org>
Reminded-by: sjg
sys/vfs/devfs/devfs_vnops.c