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:
parent
75d80d9541
commit
49e9fc0a0d
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user