On Wed, Aug 16, 2017 at 12:44:28AM -0700, Dan Williams wrote: > @@ -1411,6 +1422,9 @@ unsigned long do_mmap(struct file *file, unsigned long addr, > > /* fall through */ > case MAP_PRIVATE: > + if ((flags & (MAP_PRIVATE|MAP_DIRECT)) > + == (MAP_PRIVATE|MAP_DIRECT)) > + return -EINVAL; We've already checked for MAP_PRIVATE in this codepath. Simple (flags & MAP_DIRECT) would be enough. -- Kirill A. Shutemov