Improve on POLA by populating DEVFS before doing devfs(8) rule ioctls.

PR:	60687
Spotted by:	Colin Percival <cperciva@daemonology.net>
This commit is contained in:
Poul-Henning Kamp 2004-01-02 19:02:28 +00:00
parent 75d80d9541
commit 49e9fc0a0d

View File

@ -279,7 +279,12 @@ devfs_ioctl(ap)
} */ *ap;
{
int error;
struct devfs_mount *dmp;
dmp = VFSTODEVFS(ap->a_vp->v_mount);
lockmgr(&dmp->dm_lock, LK_SHARED, 0, curthread);
devfs_populate(dmp);
lockmgr(&dmp->dm_lock, LK_RELEASE, 0, curthread);
error = devfs_rules_ioctl(ap->a_vp->v_mount, ap->a_command, ap->a_data,
ap->a_td);
return (error);