Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Feb 2017 20:51:42 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-fs@FreeBSD.org
Subject:   [Bug 217062] for file systems mounted with -o noexec, exec=off property does not work for mmap
Message-ID:  <bug-217062-3630-Li12Tj3hcx@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-217062-3630@https.bugs.freebsd.org/bugzilla/>
References:  <bug-217062-3630@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D217062

--- Comment #7 from commit-hook@freebsd.org ---
A commit references this bug:

Author: kib
Date: Sun Feb 19 20:51:05 UTC 2017
New revision: 313967
URL: https://svnweb.freebsd.org/changeset/base/313967

Log:
  Apply noexec mount option for mmap(PROT_EXEC).

  Right now the noexec mount option disallows image activators to try
  execve the files on the mount point.  Also, after r127187, noexec
  also limits max_prot map entries permissions for mappings of files
  from such mounts, but not the actual mapping permissions.

  As result, the API behaviour is inconsistent.  The files from noexec
  mount can be mapped with PROT_EXEC, but if mprotect(2) drops execution
  permission, it cannot be re-enabled later.  Make this consistent
  logically and aligned with behaviour of other systems, by disallowing
  PROT_EXEC for mmap(2).

  Note that this change only ensures aligned results from mmap(2) and
  mprotect(2), it does not prevent actual code execution from files
  coming from noexec mount.  Such files can always be read into
  anonymous executable memory and executed from there.

  Reported by:  shamaz.mazum@gmail.com
  PR:   217062
  Reviewed by:  alc
  Sponsored by: The FreeBSD Foundation
  MFC after:    1 week

Changes:
  head/sys/fs/devfs/devfs_vnops.c
  head/sys/kern/vfs_vnops.c

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-217062-3630-Li12Tj3hcx>