lkml.org 
[lkml]   [2003]   [Dec]   [7]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateSun, 7 Dec 2003 14:39:06 +0100
FromAlex Riesen <>
SubjectRe: [PATCH] FIx 'noexec' behavior
On 2003-12-07 12:17:37, wli wrote:
> You took a fault in do_mmap_pgoff().
...
> +		if (file->f_vfsmnt && (prot & PROT_EXEC)) {
> +			if (file->f_vfsmnt->mnt_flags & MNT_NOEXEC)
> +				return -EPERM;
> +		}

I had to put a check for 'file' (as Ulrich suggested).
Otherwise it deadlocks again.
Is it possible for ->f_vfsmnt to be NULL at all? Should it be tested?

diff -Nru a/mm/mmap.c b/mm/mmap.c
--- a/mm/mmap.c Sun Dec  7 14:37:33 2003
+++ b/mm/mmap.c Sun Dec  7 14:37:33 2003
@@ -478,7 +478,7 @@
        if (file && (!file->f_op || !file->f_op->mmap))
                return -ENODEV;
 
-       if ((prot & PROT_EXEC) && (file->f_vfsmnt->mnt_flags & MNT_NOEXEC))
+       if ((prot & PROT_EXEC) && file && (file->f_vfsmnt->mnt_flags & MNT_NOEXEC))
                return -EPERM;
 
        if (!len)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:59    [from the cache]
©2003-2008