mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Cliff Wickman <cpw@sgi.com>
To: linux-kernel@vger.kernel.org
Cc: akpm@linux-foundation.org, mgorman@suse.de, paul.mundt@nokia.com,
	dhowells@redhat.com, aarcange@redhat.com, hughd@google.com,
	gorcunov@openvz.org, kamezawa.hiroyuki@gmail.com,
	n-horiguchi@ah.jp.nec.com, eag0628@gmail.com,
	khlebnikov@openvz.org, sasha.levin@oracle.com,
	siddhesh.poyarekar@gmail.com, rientjes@google.com,
	kirill.shutemov@linux.intel.com, viro@ZenIV.linux.org.uk,
	amwang@redhat.com
Subject: [PATCH] fs/proc: smaps should avoid VM_PFNMAP areas
Date: Mon, 29 Apr 2013 16:25:53 -0500	[thread overview]
Message-ID: <E1UWva5-0005fY-Km@eag09.americas.sgi.com> (raw)


/proc/<pid>/smaps should not be looking at VM_PFNMAP areas.

Certain tests in show_smap() (especially for huge pages) assume that the
mapped PFN's are backed with page structures.  And this is not usually true
for VM_PFNMAP areas.  This can result in panics on kernel page faults when
attempting to address those page structures.

VM_PFNMAP areas are used by
- graphics memory manager   gpu/drm/drm_gem.c
- global reference unit     sgi-gru/grufile.c
- sgi special memory        char/mspec.c
- probably several out-of-tree modules

I'm copying everyone who has changed fs/proc/task_mmu.c recently, in case
of some reason to provide /proc/<pid>/smaps for these areas that I am not
aware of.

Signed-off-by: Cliff Wickman <cpw@sgi.com>
---
 fs/proc/task_mmu.c |    3 +++
 1 file changed, 3 insertions(+)

Index: linux/fs/proc/task_mmu.c
===================================================================
--- linux.orig/fs/proc/task_mmu.c
+++ linux/fs/proc/task_mmu.c
@@ -589,6 +589,9 @@ static int show_smap(struct seq_file *m,
 		.private = &mss,
 	};
 
+	if (vma->vm_flags & VM_PFNMAP)
+		return 0;
+
 	memset(&mss, 0, sizeof mss);
 	mss.vma = vma;
 	/* mmap_sem is held in m_start */

             reply	other threads:[~2013-04-29 21:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-29 21:25 Cliff Wickman [this message]
2013-04-30  1:03 ` Naoya Horiguchi
     [not found] <E1UXF1l-00025N-UJ@eag09.americas.sgi.com>
2013-04-30 18:52 ` Cliff Wickman

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=E1UWva5-0005fY-Km@eag09.americas.sgi.com \
    --to=cpw@sgi.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=amwang@redhat.com \
    --cc=dhowells@redhat.com \
    --cc=eag0628@gmail.com \
    --cc=gorcunov@openvz.org \
    --cc=hughd@google.com \
    --cc=kamezawa.hiroyuki@gmail.com \
    --cc=khlebnikov@openvz.org \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=n-horiguchi@ah.jp.nec.com \
    --cc=paul.mundt@nokia.com \
    --cc=rientjes@google.com \
    --cc=sasha.levin@oracle.com \
    --cc=siddhesh.poyarekar@gmail.com \
    --cc=viro@ZenIV.linux.org.uk \
    /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

all inboxes | Powered by JetHome®