Gentoo Archives: gentoo-commits

From: "Mike Pagano (mpagano)" <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] linux-patches r1762 - genpatches-2.6/trunk/2.6.35
Date: Fri, 20 Aug 2010 20:45:16
Message-Id: 20100820204512.16D272004C@flycatcher.gentoo.org
1 Author: mpagano
2 Date: 2010-08-20 20:45:11 +0000 (Fri, 20 Aug 2010)
3 New Revision: 1762
4
5 Added:
6 genpatches-2.6/trunk/2.6.35/1002_linux-2.6.35.3.patch
7 Removed:
8 genpatches-2.6/trunk/2.6.35/1800_page-table-unmap-for-stack-guard-fix.patch
9 genpatches-2.6/trunk/2.6.35/1805_fix-user-visible-effects-of-stack-guard-page.patch
10 Log:
11 Linux patch 2.6.35.3 and removal of redundant patches
12
13 Added: genpatches-2.6/trunk/2.6.35/1002_linux-2.6.35.3.patch
14 ===================================================================
15 --- genpatches-2.6/trunk/2.6.35/1002_linux-2.6.35.3.patch (rev 0)
16 +++ genpatches-2.6/trunk/2.6.35/1002_linux-2.6.35.3.patch 2010-08-20 20:45:11 UTC (rev 1762)
17 @@ -0,0 +1,93 @@
18 +diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c
19 +index 227b044..ce9c6c2 100644
20 +--- a/arch/x86/kernel/cpu/vmware.c
21 ++++ b/arch/x86/kernel/cpu/vmware.c
22 +@@ -23,6 +23,7 @@
23 +
24 + #include <linux/dmi.h>
25 + #include <linux/module.h>
26 ++#include <linux/jiffies.h>
27 + #include <asm/div64.h>
28 + #include <asm/x86_init.h>
29 + #include <asm/hypervisor.h>
30 +diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
31 +index aea1d3f..439fc1f 100644
32 +--- a/fs/proc/task_mmu.c
33 ++++ b/fs/proc/task_mmu.c
34 +@@ -210,6 +210,7 @@ static void show_map_vma(struct seq_file *m, struct vm_area_struct *vma)
35 + int flags = vma->vm_flags;
36 + unsigned long ino = 0;
37 + unsigned long long pgoff = 0;
38 ++ unsigned long start;
39 + dev_t dev = 0;
40 + int len;
41 +
42 +@@ -220,8 +221,13 @@ static void show_map_vma(struct seq_file *m, struct vm_area_struct *vma)
43 + pgoff = ((loff_t)vma->vm_pgoff) << PAGE_SHIFT;
44 + }
45 +
46 ++ /* We don't show the stack guard page in /proc/maps */
47 ++ start = vma->vm_start;
48 ++ if (vma->vm_flags & VM_GROWSDOWN)
49 ++ start += PAGE_SIZE;
50 ++
51 + seq_printf(m, "%08lx-%08lx %c%c%c%c %08llx %02x:%02x %lu %n",
52 +- vma->vm_start,
53 ++ start,
54 + vma->vm_end,
55 + flags & VM_READ ? 'r' : '-',
56 + flags & VM_WRITE ? 'w' : '-',
57 +diff --git a/mm/memory.c b/mm/memory.c
58 +index aaaedbd..307bf77 100644
59 +--- a/mm/memory.c
60 ++++ b/mm/memory.c
61 +@@ -2792,24 +2792,23 @@ static int do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma,
62 + spinlock_t *ptl;
63 + pte_t entry;
64 +
65 +- if (check_stack_guard_page(vma, address) < 0) {
66 +- pte_unmap(page_table);
67 ++ pte_unmap(page_table);
68 ++
69 ++ /* Check if we need to add a guard page to the stack */
70 ++ if (check_stack_guard_page(vma, address) < 0)
71 + return VM_FAULT_SIGBUS;
72 +- }
73 +
74 ++ /* Use the zero-page for reads */
75 + if (!(flags & FAULT_FLAG_WRITE)) {
76 + entry = pte_mkspecial(pfn_pte(my_zero_pfn(address),
77 + vma->vm_page_prot));
78 +- ptl = pte_lockptr(mm, pmd);
79 +- spin_lock(ptl);
80 ++ page_table = pte_offset_map_lock(mm, pmd, address, &ptl);
81 + if (!pte_none(*page_table))
82 + goto unlock;
83 + goto setpte;
84 + }
85 +
86 + /* Allocate our own private page. */
87 +- pte_unmap(page_table);
88 +-
89 + if (unlikely(anon_vma_prepare(vma)))
90 + goto oom;
91 + page = alloc_zeroed_user_highpage_movable(vma, address);
92 +diff --git a/mm/mlock.c b/mm/mlock.c
93 +index 3f82720..49e5e4c 100644
94 +--- a/mm/mlock.c
95 ++++ b/mm/mlock.c
96 +@@ -167,6 +167,14 @@ static long __mlock_vma_pages_range(struct vm_area_struct *vma,
97 + if (vma->vm_flags & VM_WRITE)
98 + gup_flags |= FOLL_WRITE;
99 +
100 ++ /* We don't try to access the guard page of a stack vma */
101 ++ if (vma->vm_flags & VM_GROWSDOWN) {
102 ++ if (start == vma->vm_start) {
103 ++ start += PAGE_SIZE;
104 ++ nr_pages--;
105 ++ }
106 ++ }
107 ++
108 + while (nr_pages > 0) {
109 + int i;
110 +
111
112 Deleted: genpatches-2.6/trunk/2.6.35/1800_page-table-unmap-for-stack-guard-fix.patch
113 ===================================================================
114 --- genpatches-2.6/trunk/2.6.35/1800_page-table-unmap-for-stack-guard-fix.patch 2010-08-20 20:32:11 UTC (rev 1761)
115 +++ genpatches-2.6/trunk/2.6.35/1800_page-table-unmap-for-stack-guard-fix.patch 2010-08-20 20:45:11 UTC (rev 1762)
116 @@ -1,33 +0,0 @@
117 ---- a/mm/memory.c 2010-08-20 11:41:48.000000000 -0400
118 -+++ b/mm/memory.c 2010-08-20 11:44:30.000000000 -0400
119 -@@ -2792,24 +2792,22 @@ static int do_anonymous_page(struct mm_s
120 - spinlock_t *ptl;
121 - pte_t entry;
122 -
123 -- if (check_stack_guard_page(vma, address) < 0) {
124 -- pte_unmap(page_table);
125 -- return VM_FAULT_SIGBUS;
126 -- }
127 -+ pte_unmap(page_table);
128 -
129 -+ if (check_stack_guard_page(vma, address) < 0)
130 -+ return VM_FAULT_SIGBUS;
131 -+
132 -+ /* Use the zero-page for reads */
133 - if (!(flags & FAULT_FLAG_WRITE)) {
134 - entry = pte_mkspecial(pfn_pte(my_zero_pfn(address),
135 - vma->vm_page_prot));
136 -- ptl = pte_lockptr(mm, pmd);
137 -- spin_lock(ptl);
138 -+ page_table = pte_offset_map_lock(mm, pmd, address, &ptl);
139 - if (!pte_none(*page_table))
140 - goto unlock;
141 - goto setpte;
142 - }
143 -
144 - /* Allocate our own private page. */
145 -- pte_unmap(page_table);
146 --
147 - if (unlikely(anon_vma_prepare(vma)))
148 - goto oom;
149 - page = alloc_zeroed_user_highpage_movable(vma, address);
150
151 Deleted: genpatches-2.6/trunk/2.6.35/1805_fix-user-visible-effects-of-stack-guard-page.patch
152 ===================================================================
153 --- genpatches-2.6/trunk/2.6.35/1805_fix-user-visible-effects-of-stack-guard-page.patch 2010-08-20 20:32:11 UTC (rev 1761)
154 +++ genpatches-2.6/trunk/2.6.35/1805_fix-user-visible-effects-of-stack-guard-page.patch 2010-08-20 20:45:11 UTC (rev 1762)
155 @@ -1,85 +0,0 @@
156 -From: Linus Torvalds <torvalds@××××××××××××××××.org>
157 -Date: Sun, 15 Aug 2010 18:35:52 +0000 (-0700)
158 -Subject: mm: fix up some user-visible effects of the stack guard page
159 -X-Git-Tag: v2.6.36-rc1~5
160 -X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=d7824370e26325c881b665350ce64fb0a4fde24a
161 -
162 -mm: fix up some user-visible effects of the stack guard page
163 -
164 -This commit makes the stack guard page somewhat less visible to user
165 -space. It does this by:
166 -
167 - - not showing the guard page in /proc/<pid>/maps
168 -
169 - It looks like lvm-tools will actually read /proc/self/maps to figure
170 - out where all its mappings are, and effectively do a specialized
171 - "mlockall()" in user space. By not showing the guard page as part of
172 - the mapping (by just adding PAGE_SIZE to the start for grows-up
173 - pages), lvm-tools ends up not being aware of it.
174 -
175 - - by also teaching the _real_ mlock() functionality not to try to lock
176 - the guard page.
177 -
178 - That would just expand the mapping down to create a new guard page,
179 - so there really is no point in trying to lock it in place.
180 -
181 -It would perhaps be nice to show the guard page specially in
182 -/proc/<pid>/maps (or at least mark grow-down segments some way), but
183 -let's not open ourselves up to more breakage by user space from programs
184 -that depends on the exact deails of the 'maps' file.
185 -
186 -Special thanks to Henrique de Moraes Holschuh for diving into lvm-tools
187 -source code to see what was going on with the whole new warning.
188 -
189 -Reported-and-tested-by: François Valenduc <francois.valenduc@××××××××××.be
190 -Reported-by: Henrique de Moraes Holschuh <hmh@×××××××.br>
191 -Cc: stable@××××××.org
192 -Signed-off-by: Linus Torvalds <torvalds@××××××××××××××××.org>
193 ----
194 -
195 -diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
196 -index aea1d3f..439fc1f 100644
197 ---- a/fs/proc/task_mmu.c
198 -+++ b/fs/proc/task_mmu.c
199 -@@ -210,6 +210,7 @@ static void show_map_vma(struct seq_file *m, struct vm_area_struct *vma)
200 - int flags = vma->vm_flags;
201 - unsigned long ino = 0;
202 - unsigned long long pgoff = 0;
203 -+ unsigned long start;
204 - dev_t dev = 0;
205 - int len;
206 -
207 -@@ -220,8 +221,13 @@ static void show_map_vma(struct seq_file *m, struct vm_area_struct *vma)
208 - pgoff = ((loff_t)vma->vm_pgoff) << PAGE_SHIFT;
209 - }
210 -
211 -+ /* We don't show the stack guard page in /proc/maps */
212 -+ start = vma->vm_start;
213 -+ if (vma->vm_flags & VM_GROWSDOWN)
214 -+ start += PAGE_SIZE;
215 -+
216 - seq_printf(m, "%08lx-%08lx %c%c%c%c %08llx %02x:%02x %lu %n",
217 -- vma->vm_start,
218 -+ start,
219 - vma->vm_end,
220 - flags & VM_READ ? 'r' : '-',
221 - flags & VM_WRITE ? 'w' : '-',
222 -diff --git a/mm/mlock.c b/mm/mlock.c
223 -index 3f82720..49e5e4c 100644
224 ---- a/mm/mlock.c
225 -+++ b/mm/mlock.c
226 -@@ -167,6 +167,14 @@ static long __mlock_vma_pages_range(struct vm_area_struct *vma,
227 - if (vma->vm_flags & VM_WRITE)
228 - gup_flags |= FOLL_WRITE;
229 -
230 -+ /* We don't try to access the guard page of a stack vma */
231 -+ if (vma->vm_flags & VM_GROWSDOWN) {
232 -+ if (start == vma->vm_start) {
233 -+ start += PAGE_SIZE;
234 -+ nr_pages--;
235 -+ }
236 -+ }
237 -+
238 - while (nr_pages > 0) {
239 - int i;
240 -