summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2018-02-25 10:48:52 +0000
committerhselasky <hselasky@FreeBSD.org>2018-02-25 10:48:52 +0000
commit4dd27a98edf7cb1010611d2d28f862252610a958 (patch)
tree222587539c60fd2ba6fc3f267b66f19a39878565
parente57a5b4d46c32b52725b3772b72e13c6822e1bc2 (diff)
downloadFreeBSD-src-4dd27a98edf7cb1010611d2d28f862252610a958.zip
FreeBSD-src-4dd27a98edf7cb1010611d2d28f862252610a958.tar.gz
MFC r329703:
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). Found by: Johannes Lundberg <johalun0@gmail.com> Sponsored by: Mellanox Technologies
-rw-r--r--sys/compat/linux/linux_mmap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/compat/linux/linux_mmap.c b/sys/compat/linux/linux_mmap.c
index 11da2ebf..94dec5a 100644
--- a/sys/compat/linux/linux_mmap.c
+++ b/sys/compat/linux/linux_mmap.c
@@ -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);
}
OpenPOWER on IntegriCloud