In vn_isdisk(), check whether vp->v_rdev is NULL. If it is, then
return ENXIO (Device not configured). Without this, vn_isdisk() could (and did in the case of lstat() under fdesc) pass a NULL pointer to devsw(), which caused a page fault. Reviewed by: alfred
This commit is contained in:
parent
686ed81847
commit
b081a64afb
@ -2909,6 +2909,11 @@ vn_isdisk(vp, errp)
|
||||
*errp = ENOTBLK;
|
||||
return (0);
|
||||
}
|
||||
if (vp->v_rdev == NULL) {
|
||||
if (errp != NULL)
|
||||
*errp = ENXIO;
|
||||
return (0);
|
||||
}
|
||||
if (!devsw(vp->v_rdev)) {
|
||||
if (errp != NULL)
|
||||
*errp = ENXIO;
|
||||
|
@ -2909,6 +2909,11 @@ vn_isdisk(vp, errp)
|
||||
*errp = ENOTBLK;
|
||||
return (0);
|
||||
}
|
||||
if (vp->v_rdev == NULL) {
|
||||
if (errp != NULL)
|
||||
*errp = ENXIO;
|
||||
return (0);
|
||||
}
|
||||
if (!devsw(vp->v_rdev)) {
|
||||
if (errp != NULL)
|
||||
*errp = ENXIO;
|
||||
|
Loading…
x
Reference in New Issue
Block a user