diff options
author | chris <chris@FreeBSD.org> | 2000-03-18 01:27:44 +0000 |
---|---|---|
committer | chris <chris@FreeBSD.org> | 2000-03-18 01:27:44 +0000 |
commit | dd595b28f0a9f0a3a9bad1b1750ce1b3b33d27af (patch) | |
tree | 68b51aeaec5d247c576126b0a84397e464643fe8 /sys/kern/vfs_export.c | |
parent | ef5b1638f234e3635320f16096f7f90791380499 (diff) | |
download | FreeBSD-src-dd595b28f0a9f0a3a9bad1b1750ce1b3b33d27af.zip FreeBSD-src-dd595b28f0a9f0a3a9bad1b1750ce1b3b33d27af.tar.gz |
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
Diffstat (limited to 'sys/kern/vfs_export.c')
-rw-r--r-- | sys/kern/vfs_export.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/kern/vfs_export.c b/sys/kern/vfs_export.c index 8b28d38..a528d87 100644 --- a/sys/kern/vfs_export.c +++ b/sys/kern/vfs_export.c @@ -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; |