From e7cb2d35f0bac1f4e9c7969e66e3013118802279 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Fri, 10 Dec 2010 15:51:43 +0100 Subject: [PATCH] ntdll: Report a failed executable mmap on nonexec filesystems. --- dlls/ntdll/virtual.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c index d7a04c39d6..6f8b9a3225 100644 --- a/dlls/ntdll/virtual.c +++ b/dlls/ntdll/virtual.c @@ -877,6 +877,9 @@ static NTSTATUS map_file_into_view( struct file_view *view, int fd, size_t start if (mmap( (char *)view->base + start, size, prot, flags, fd, offset ) != (void *)-1) goto done; + if ((errno == EPERM) && (prot & PROT_EXEC)) + ERR( "failed to set %08x protection on file map, noexec filesystem?\n", prot ); + /* mmap() failed; if this is because the file offset is not */ /* page-aligned (EINVAL), or because the underlying filesystem */ /* does not support mmap() (ENOEXEC,ENODEV), we do it by hand. */ -- 2.32.0.93.g670b81a890