Make it atomic for the devfs_populate_loop() to see the setting of
SI_ALIAS flag and initialization of the si_parent when alias is created. Assert that supplied parent device is not NULL. Both situations could cause NULL dereference in the devfs_populate_loop() when creating a symlink for SI_ALIAS'ed device. Namely, cdp->cdp_c.si_parent may be NULL. Reported by: mav MFC after: 2 weeks
This commit is contained in:
parent
5692c36098
commit
ae95dc623a
@ -780,6 +780,7 @@ make_dev_alias(struct cdev *pdev, const char *fmt, ...)
|
||||
va_list ap;
|
||||
int i;
|
||||
|
||||
KASSERT(pdev != NULL, ("NULL pdev"));
|
||||
dev = devfs_alloc();
|
||||
dev_lock();
|
||||
dev->si_flags |= SI_ALIAS;
|
||||
@ -793,9 +794,9 @@ make_dev_alias(struct cdev *pdev, const char *fmt, ...)
|
||||
va_end(ap);
|
||||
|
||||
devfs_create(dev);
|
||||
dev_dependsl(pdev, dev);
|
||||
clean_unrhdrl(devfs_inos);
|
||||
dev_unlock();
|
||||
dev_depends(pdev, dev);
|
||||
|
||||
notify_create(dev);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user