diff mbox

hide guard page for stacks that grow upwards

Message ID 4c74419664798b8c9@agluck-desktop.sc.intel.com (mailing list archive)
State Accepted
Headers show

Commit Message

Luck, Tony Aug. 24, 2010, 10:03 p.m. UTC
None
diff mbox

Patch

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' : '-',