mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-27 16:39:08 +00:00
Fix kernel panic when d_fdopen csw method is called for NULL fp.
This may happen when kernel consumer calls VOP_OPEN(). Reported by: Tavis Ormandy <taviso cmpxchg8b com> through delphij MFC after: 3 days
This commit is contained in:
parent
3ca1a2d6a0
commit
1fef78c3f0
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=227062
@ -1050,6 +1050,10 @@ devfs_open(struct vop_open_args *ap)
|
||||
dsw = dev_refthread(dev, &ref);
|
||||
if (dsw == NULL)
|
||||
return (ENXIO);
|
||||
if (fp == NULL && dsw->d_fdopen != NULL) {
|
||||
dev_relthread(dev, ref);
|
||||
return (ENXIO);
|
||||
}
|
||||
|
||||
vlocked = VOP_ISLOCKED(vp);
|
||||
VOP_UNLOCK(vp, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user