Allow LinuxKPI character devices to receive mmap() calls from the Linux

binary mode user-space emulation layer. This is a regression issue after
r328436, when LinuxKPI character devices started to use DTYPE_DEV in
the "f_type" field of the associated file structure(s).

MFC after:	3 days
Found by:	Johannes Lundberg <johalun0@gmail.com>
Sponsored by:	Mellanox Technologies
This commit is contained in:
Hans Petter Selasky 2018-02-21 10:13:17 +00:00
parent eb96cc1364
commit 07c757ec25

View File

@ -129,7 +129,7 @@ linux_mmap_common(struct thread *td, uintptr_t addr, size_t len, int prot,
error = fget(td, fd, cap_rights_init(&rights, CAP_MMAP), &fp);
if (error != 0)
return (error);
if (fp->f_type != DTYPE_VNODE) {
if (fp->f_type != DTYPE_VNODE && fp->f_type != DTYPE_DEV) {
fdrop(fp, td);
return (EINVAL);
}