From: "Luck, Tony" <tony.luck@intel.com>
To: "Linus Torvalds" <torvalds@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, linux-parisc@vger.kernel.org,
linux-ia64@vger.kernel.org
Subject: [PATCH] hide guard page for stacks that grow upwards
Date: Tue, 24 Aug 2010 15:03:02 -0700 [thread overview]
Message-ID: <4c74419664798b8c9@agluck-desktop.sc.intel.com> (raw)
pa-risc and ia64 have stacks that grow upwards. Don't
show the guard page on upward growing vma in /proc/$$/maps
Signed-off-by: Tony Luck <tony.luck@intel.com>
---
This looks useful too ... but I can't see where the code is that
made vm_start be PAGE_SIZE lower to begin with. I'd expect to have
to make a matching change to make vm_end PAGE_SIZE higher for the
VM_GROWSUP areas.
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 439fc1f..ef262f6 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -210,7 +210,7 @@ static void show_map_vma(struct seq_file *m, struct vm_area_struct *vma)
int flags = vma->vm_flags;
unsigned long ino = 0;
unsigned long long pgoff = 0;
- unsigned long start;
+ unsigned long start, end;
dev_t dev = 0;
int len;
@@ -223,12 +223,15 @@ static void show_map_vma(struct seq_file *m, struct vm_area_struct *vma)
/* We don't show the stack guard page in /proc/maps */
start = vma->vm_start;
+ end = vma->vm_end;
if (vma->vm_flags & VM_GROWSDOWN)
start += PAGE_SIZE;
+ if (vma->vm_flags & VM_GROWSUP)
+ end -= PAGE_SIZE;
seq_printf(m, "%08lx-%08lx %c%c%c%c %08llx %02x:%02x %lu %n",
start,
- vma->vm_end,
+ end,
flags & VM_READ ? 'r' : '-',
flags & VM_WRITE ? 'w' : '-',
flags & VM_EXEC ? 'x' : '-',
next reply other threads:[~2010-08-24 22:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-24 22:03 Luck, Tony [this message]
2010-08-24 22:23 ` [PATCH] hide guard page for stacks that grow upwards Linus Torvalds
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=4c74419664798b8c9@agluck-desktop.sc.intel.com \
--to=tony.luck@intel.com \
--cc=linux-ia64@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-parisc@vger.kernel.org \
--cc=torvalds@linux-foundation.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