linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Palmer Dabbelt <palmer@dabbelt.com>
To: arnd@arndb.de
Cc: 3chas3@gmail.com, hpa@zytor.com, mingo@redhat.com,
	plagnioj@jcrosoft.com, jikos@kernel.org,
	linux-api@vger.kernel.org, linux-arch@vger.kernel.org,
	linux-atm-general@lists.sourceforge.net,
	linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org, tglx@linutronix.de,
	tomi.valkeinen@ti.com, x86@kernel.org,
	Palmer Dabbelt <palmer@dabbelt.com>
Subject: [PATCH 04/13] Always expose MAP_UNINITIALIZED to userspace
Date: Wed, 09 Sep 2015 21:08:13 +0000	[thread overview]
Message-ID: <1441832902-28993-5-git-send-email-palmer@dabbelt.com> (raw)
In-Reply-To: <1441832902-28993-1-git-send-email-palmer@dabbelt.com>

This used to be hidden behind CONFIG_MMAP_ALLOW_UNINITIALIZED, so
userspace wouldn't actually ever see it.  While I could have kept
hiding it, the man pages seem to indicate that MAP_UNINITIALIZED
should be visible:

  mmap(2)
  MAP_UNINITIALIZED (since Linux 2.6.33)
    Don't clear anonymous pages.  This flag is intended to improve
    performance on embedded devices.  This flag is honored only if the
    kernel was configured with the CONFIG_MMAP_ALLOW_UNINITIALIZED
    option.  Because of the security implications, that option is
    normally enabled only on embedded devices (i.e., devices where one
    has complete control of the contents of user memory).

and since the only time it shows up in my /usr/include is in this
header I believe this should have been visible to userspace (as
non-zero, which wouldn't do anything when or'd into the flags) all
along.

Signed-off-by: Palmer Dabbelt <palmer@dabbelt.com>
Reviewed-by: Andrew Waterman <waterman@eecs.berkeley.edu>
Reviewed-by: Albert Ou <aou@eecs.berkeley.edu>
---
 include/uapi/asm-generic/mman-common.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/uapi/asm-generic/mman-common.h b/include/uapi/asm-generic/mman-common.h
index ddc3b36f1046..e58d1911ecc6 100644
--- a/include/uapi/asm-generic/mman-common.h
+++ b/include/uapi/asm-generic/mman-common.h
@@ -19,7 +19,7 @@
 #define MAP_TYPE	0x0f		/* Mask for type of mapping */
 #define MAP_FIXED	0x10		/* Interpret addr exactly */
 #define MAP_ANONYMOUS	0x20		/* don't use a file */
-#ifdef CONFIG_MMAP_ALLOW_UNINITIALIZED
+#if !defined(__KERNEL__) || defined(CONFIG_MMAP_ALLOW_UNINITIALIZED)
 # define MAP_UNINITIALIZED 0x4000000	/* For anonymous mmap, memory could be uninitialized */
 #else
 # define MAP_UNINITIALIZED 0x0		/* Don't support this flag */
-- 
2.4.6


  parent reply	other threads:[~2015-09-09 21:08 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <2644177.lVCYzIBfPW@wuerfel>
2015-09-09 21:08 ` [PATCH] Remove #ifdef CONFIG_64BIT from all asm-generic/fcntl.h Palmer Dabbelt
2015-09-09 21:08   ` [PATCH 01/13] " Palmer Dabbelt
2015-09-09 21:08   ` [PATCH 03/13] Hide COMPAT_ATM_ADDPARTY behind #ifdef __KERNEL__ Palmer Dabbelt
2015-09-09 21:08   ` Palmer Dabbelt [this message]
2015-09-09 21:08   ` [PATCH 05/13] Hide some of "struct elf_prstatus" " Palmer Dabbelt
2015-09-09 21:08   ` [PATCH 06/13] Hide ep_take_care_of_epollwakeup() " Palmer Dabbelt
2015-09-09 21:08   ` [PATCH 07/13] Make FB_BACKLIGHT_{LEVELS,MAX} always visible Palmer Dabbelt
2015-09-09 21:08   ` [PATCH 08/13] Hide MAX_SHARED_LIBS behind #ifdef __KERNEL__ Palmer Dabbelt
2015-09-09 21:08   ` [PATCH 09/13] Hide bp_type_idx " Palmer Dabbelt
2015-09-09 21:08   ` [PATCH 10/13] Hide USE_WCACHING " Palmer Dabbelt
2015-09-09 21:08   ` [PATCH 11/13] Hide MAX_RAW_MINORS " Palmer Dabbelt
2015-09-09 21:08   ` [PATCH 12/13] Hide AT_VECTOR_SIZE_ARCH " Palmer Dabbelt
2015-09-10 11:11   ` [PATCH 09/13] Hide bp_type_idx " David Howells
2015-09-10 11:12   ` [PATCH 10/13] Hide USE_WCACHING " David Howells
2015-09-10 11:13   ` [PATCH 11/13] Hide MAX_RAW_MINORS " David Howells
2015-09-10 11:14   ` [PATCH 12/13] Hide AT_VECTOR_SIZE_ARCH " David Howells
     [not found]   ` <1441832902-28993-1-git-send-email-palmer-96lFi9zoCfxBDgjK7y7TUQ@public.gmane.org>
2015-09-09 21:08     ` [PATCH 02/13] Always expose __SYSCALL(... fork ...) Palmer Dabbelt
2015-09-09 21:08     ` [PATCH 13/13] Re-enable and clean up "check_config()" in headers_check.pl Palmer Dabbelt
2015-09-10 11:15     ` [PATCH] Remove #ifdef CONFIG_64BIT from all asm-generic/fcntl.h David Howells
     [not found] ` <18147.1441883729-S6HVgzuS8uM4Awkfq6JHfwNdhmdF6hFW@public.gmane.org>
2015-09-10 11:18   ` David Howells
2015-09-14 22:50     ` Palmer Dabbelt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1441832902-28993-5-git-send-email-palmer@dabbelt.com \
    --to=palmer@dabbelt.com \
    --cc=3chas3@gmail.com \
    --cc=arnd@arndb.de \
    --cc=hpa@zytor.com \
    --cc=jikos@kernel.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-atm-general@lists.sourceforge.net \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=plagnioj@jcrosoft.com \
    --cc=tglx@linutronix.de \
    --cc=tomi.valkeinen@ti.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).