Gentoo Archives: gentoo-commits

From: "Mike Pagano (mpagano)" <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] linux-patches r1764 - genpatches-2.6/trunk/2.6.34
Date: Sat, 21 Aug 2010 21:11:44
Message-Id: 20100821211141.0C0BF2004E@flycatcher.gentoo.org
1 Author: mpagano
2 Date: 2010-08-21 21:11:40 +0000 (Sat, 21 Aug 2010)
3 New Revision: 1764
4
5 Added:
6 genpatches-2.6/trunk/2.6.34/1004_linux-2.6.34.5.patch
7 Removed:
8 genpatches-2.6/trunk/2.6.34/1700_vmware-jiffies-include-fix.patch
9 genpatches-2.6/trunk/2.6.34/1800_page-table-unmap-for-stack-guard-fix.patch
10 genpatches-2.6/trunk/2.6.34/1805_fix-user-visible-effects-of-stack-guard-page.patch
11 Modified:
12 genpatches-2.6/trunk/2.6.34/0000_README
13 Log:
14 Linux patch 2.6.34.5 and removal of redundant patches
15
16 Modified: genpatches-2.6/trunk/2.6.34/0000_README
17 ===================================================================
18 --- genpatches-2.6/trunk/2.6.34/0000_README 2010-08-21 20:58:01 UTC (rev 1763)
19 +++ genpatches-2.6/trunk/2.6.34/0000_README 2010-08-21 21:11:40 UTC (rev 1764)
20 @@ -55,18 +55,10 @@
21 From: http://www.kernel.org
22 Desc: Linux 2.6.34.4
23
24 -Patch: 1700_vmware-jiffies-include-fix.patch
25 -From: http://bugs.gentoo.org/show_bug.cgi?id=332949
26 -Desc: Add missing include
27 +Patch: 1004_linux-2.6.34.5.patch
28 +From: http://www.kernel.org
29 +Desc: Linux 2.6.34.5
30
31 -Patch: 1800_page-table-unmap-for-stack-guard-fix.patch
32 -From: https://bugzilla.kernel.org/show_bug.cgi?id=16588
33 -Desc: Fix page table unmap for stack guard page properly
34 -
35 -Patch: 1805_fix-user-visible-effects-of-stack-guard-page.patch
36 -From: http://bugs.gentoo.org/show_bug.cgi?id=333477
37 -Desc: Make the stack guard page somewhat less visible to user space
38 -
39 Patch: 2600_synaptic-cap-ID-check-fix.patch
40 From: http://bugs.gentoo.org/show_bug.cgi?id=328527
41 Desc: Synaptics capability ID check fix
42
43 Added: genpatches-2.6/trunk/2.6.34/1004_linux-2.6.34.5.patch
44 ===================================================================
45 --- genpatches-2.6/trunk/2.6.34/1004_linux-2.6.34.5.patch (rev 0)
46 +++ genpatches-2.6/trunk/2.6.34/1004_linux-2.6.34.5.patch 2010-08-21 21:11:40 UTC (rev 1764)
47 @@ -0,0 +1,93 @@
48 +diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c
49 +index 562d5f0..e44e02d 100644
50 +--- a/arch/x86/kernel/cpu/vmware.c
51 ++++ b/arch/x86/kernel/cpu/vmware.c
52 +@@ -23,6 +23,7 @@
53 +
54 + #include <linux/dmi.h>
55 + #include <linux/module.h>
56 ++#include <linux/jiffies.h>
57 + #include <asm/div64.h>
58 + #include <asm/vmware.h>
59 + #include <asm/x86_init.h>
60 +diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
61 +index 47f5b14..3544f60 100644
62 +--- a/fs/proc/task_mmu.c
63 ++++ b/fs/proc/task_mmu.c
64 +@@ -210,6 +210,7 @@ static void show_map_vma(struct seq_file *m, struct vm_area_struct *vma)
65 + int flags = vma->vm_flags;
66 + unsigned long ino = 0;
67 + unsigned long long pgoff = 0;
68 ++ unsigned long start;
69 + dev_t dev = 0;
70 + int len;
71 +
72 +@@ -220,8 +221,13 @@ static void show_map_vma(struct seq_file *m, struct vm_area_struct *vma)
73 + pgoff = ((loff_t)vma->vm_pgoff) << PAGE_SHIFT;
74 + }
75 +
76 ++ /* We don't show the stack guard page in /proc/maps */
77 ++ start = vma->vm_start;
78 ++ if (vma->vm_flags & VM_GROWSDOWN)
79 ++ start += PAGE_SIZE;
80 ++
81 + seq_printf(m, "%08lx-%08lx %c%c%c%c %08llx %02x:%02x %lu %n",
82 +- vma->vm_start,
83 ++ start,
84 + vma->vm_end,
85 + flags & VM_READ ? 'r' : '-',
86 + flags & VM_WRITE ? 'w' : '-',
87 +diff --git a/mm/memory.c b/mm/memory.c
88 +index daa100f..e48eb86 100644
89 +--- a/mm/memory.c
90 ++++ b/mm/memory.c
91 +@@ -2783,24 +2783,23 @@ static int do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma,
92 + spinlock_t *ptl;
93 + pte_t entry;
94 +
95 +- if (check_stack_guard_page(vma, address) < 0) {
96 +- pte_unmap(page_table);
97 ++ pte_unmap(page_table);
98 ++
99 ++ /* Check if we need to add a guard page to the stack */
100 ++ if (check_stack_guard_page(vma, address) < 0)
101 + return VM_FAULT_SIGBUS;
102 +- }
103 +
104 ++ /* Use the zero-page for reads */
105 + if (!(flags & FAULT_FLAG_WRITE)) {
106 + entry = pte_mkspecial(pfn_pte(my_zero_pfn(address),
107 + vma->vm_page_prot));
108 +- ptl = pte_lockptr(mm, pmd);
109 +- spin_lock(ptl);
110 ++ page_table = pte_offset_map_lock(mm, pmd, address, &ptl);
111 + if (!pte_none(*page_table))
112 + goto unlock;
113 + goto setpte;
114 + }
115 +
116 + /* Allocate our own private page. */
117 +- pte_unmap(page_table);
118 +-
119 + if (unlikely(anon_vma_prepare(vma)))
120 + goto oom;
121 + page = alloc_zeroed_user_highpage_movable(vma, address);
122 +diff --git a/mm/mlock.c b/mm/mlock.c
123 +index 8f4e2df..8268859 100644
124 +--- a/mm/mlock.c
125 ++++ b/mm/mlock.c
126 +@@ -167,6 +167,14 @@ static long __mlock_vma_pages_range(struct vm_area_struct *vma,
127 + if (vma->vm_flags & VM_WRITE)
128 + gup_flags |= FOLL_WRITE;
129 +
130 ++ /* We don't try to access the guard page of a stack vma */
131 ++ if (vma->vm_flags & VM_GROWSDOWN) {
132 ++ if (start == vma->vm_start) {
133 ++ start += PAGE_SIZE;
134 ++ nr_pages--;
135 ++ }
136 ++ }
137 ++
138 + while (nr_pages > 0) {
139 + int i;
140 +
141
142 Deleted: genpatches-2.6/trunk/2.6.34/1700_vmware-jiffies-include-fix.patch
143 ===================================================================
144 --- genpatches-2.6/trunk/2.6.34/1700_vmware-jiffies-include-fix.patch 2010-08-21 20:58:01 UTC (rev 1763)
145 +++ genpatches-2.6/trunk/2.6.34/1700_vmware-jiffies-include-fix.patch 2010-08-21 21:11:40 UTC (rev 1764)
146 @@ -1,10 +0,0 @@
147 ---- a/arch/x86/kernel/cpu/vmware.c 2010-08-16 13:45:53.000000000 -0400
148 -+++ b/arch/x86/kernel/cpu/vmware.c 2010-08-16 13:46:18.000000000 -0400
149 -@@ -26,6 +26,7 @@
150 - #include <asm/div64.h>
151 - #include <asm/vmware.h>
152 - #include <asm/x86_init.h>
153 -+#include <linux/jiffies.h>
154 -
155 - #define CPUID_VMWARE_INFO_LEAF 0x40000000
156 - #define VMWARE_HYPERVISOR_MAGIC 0x564D5868
157
158 Deleted: genpatches-2.6/trunk/2.6.34/1800_page-table-unmap-for-stack-guard-fix.patch
159 ===================================================================
160 --- genpatches-2.6/trunk/2.6.34/1800_page-table-unmap-for-stack-guard-fix.patch 2010-08-21 20:58:01 UTC (rev 1763)
161 +++ genpatches-2.6/trunk/2.6.34/1800_page-table-unmap-for-stack-guard-fix.patch 2010-08-21 21:11:40 UTC (rev 1764)
162 @@ -1,76 +0,0 @@
163 -From 11ac552477e32835cb6970bf0a70c210807f5673 Mon Sep 17 00:00:00 2001
164 -From: Linus Torvalds <torvalds@××××××××××××××××.org>
165 -Date: Sat, 14 Aug 2010 11:44:56 -0700
166 -Subject: [PATCH] mm: fix page table unmap for stack guard page properly
167 -MIME-Version: 1.0
168 -Content-Type: text/plain; charset=utf8
169 -Content-Transfer-Encoding: 8bit
170 -
171 -We do in fact need to unmap the page table _before_ doing the whole
172 -stack guard page logic, because if it is needed (mainly 32-bit x86 with
173 -PAE and CONFIG_HIGHPTE, but other architectures may use it too) then it
174 -will do a kmap_atomic/kunmap_atomic.
175 -
176 -And those kmaps will create an atomic region that we cannot do
177 -allocations in. However, the whole stack expand code will need to do
178 -anon_vma_prepare() and vma_lock_anon_vma() and they cannot do that in an
179 -atomic region.
180 -
181 -Now, a better model might actually be to do the anon_vma_prepare() when
182 -_creating_ a VM_GROWSDOWN segment, and not have to worry about any of
183 -this at page fault time. But in the meantime, this is the
184 -straightforward fix for the issue.
185 -
186 -See https://bugzilla.kernel.org/show_bug.cgi?id=16588 for details.
187 -
188 -Reported-by: Wylda <wylda@×××××.cz>
189 -Reported-by: Sedat Dilek <sedat.dilek@×××××.com>
190 -Reported-by: Mike Pagano <mpagano@g.o>
191 -Reported-by: François Valenduc <francois.valenduc@××××××××××.be>
192 -Tested-by: Ed Tomlinson <edt@×××.ca>
193 -Cc: Pekka Enberg <penberg@××××××.org>
194 -Cc: Greg KH <gregkh@××××.de>
195 -Cc: stable@××××××.org
196 -Signed-off-by: Linus Torvalds <torvalds@××××××××××××××××.org>
197 ----
198 - mm/memory.c | 13 ++++++-------
199 - 1 files changed, 6 insertions(+), 7 deletions(-)
200 -
201 -diff --git a/mm/memory.c b/mm/memory.c
202 -index 9b3b73f..b6e5fd2 100644
203 ---- a/mm/memory.c
204 -+++ b/mm/memory.c
205 -@@ -2792,24 +2792,23 @@ static int do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma,
206 - spinlock_t *ptl;
207 - pte_t entry;
208 -
209 -- if (check_stack_guard_page(vma, address) < 0) {
210 -- pte_unmap(page_table);
211 -+ pte_unmap(page_table);
212 -+
213 -+ /* Check if we need to add a guard page to the stack */
214 -+ if (check_stack_guard_page(vma, address) < 0)
215 - return VM_FAULT_SIGBUS;
216 -- }
217 -
218 -+ /* Use the zero-page for reads */
219 - if (!(flags & FAULT_FLAG_WRITE)) {
220 - entry = pte_mkspecial(pfn_pte(my_zero_pfn(address),
221 - vma->vm_page_prot));
222 -- ptl = pte_lockptr(mm, pmd);
223 -- spin_lock(ptl);
224 -+ page_table = pte_offset_map_lock(mm, pmd, address, &ptl);
225 - if (!pte_none(*page_table))
226 - goto unlock;
227 - goto setpte;
228 - }
229 -
230 - /* Allocate our own private page. */
231 -- pte_unmap(page_table);
232 --
233 - if (unlikely(anon_vma_prepare(vma)))
234 - goto oom;
235 - page = alloc_zeroed_user_highpage_movable(vma, address);
236 ---
237 -1.7.2.2
238 -
239
240 Deleted: genpatches-2.6/trunk/2.6.34/1805_fix-user-visible-effects-of-stack-guard-page.patch
241 ===================================================================
242 --- genpatches-2.6/trunk/2.6.34/1805_fix-user-visible-effects-of-stack-guard-page.patch 2010-08-21 20:58:01 UTC (rev 1763)
243 +++ genpatches-2.6/trunk/2.6.34/1805_fix-user-visible-effects-of-stack-guard-page.patch 2010-08-21 21:11:40 UTC (rev 1764)
244 @@ -1,85 +0,0 @@
245 -From: Linus Torvalds <torvalds@××××××××××××××××.org>
246 -Date: Sun, 15 Aug 2010 18:35:52 +0000 (-0700)
247 -Subject: mm: fix up some user-visible effects of the stack guard page
248 -X-Git-Tag: v2.6.36-rc1~5
249 -X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=d7824370e26325c881b665350ce64fb0a4fde24a
250 -
251 -mm: fix up some user-visible effects of the stack guard page
252 -
253 -This commit makes the stack guard page somewhat less visible to user
254 -space. It does this by:
255 -
256 - - not showing the guard page in /proc/<pid>/maps
257 -
258 - It looks like lvm-tools will actually read /proc/self/maps to figure
259 - out where all its mappings are, and effectively do a specialized
260 - "mlockall()" in user space. By not showing the guard page as part of
261 - the mapping (by just adding PAGE_SIZE to the start for grows-up
262 - pages), lvm-tools ends up not being aware of it.
263 -
264 - - by also teaching the _real_ mlock() functionality not to try to lock
265 - the guard page.
266 -
267 - That would just expand the mapping down to create a new guard page,
268 - so there really is no point in trying to lock it in place.
269 -
270 -It would perhaps be nice to show the guard page specially in
271 -/proc/<pid>/maps (or at least mark grow-down segments some way), but
272 -let's not open ourselves up to more breakage by user space from programs
273 -that depends on the exact deails of the 'maps' file.
274 -
275 -Special thanks to Henrique de Moraes Holschuh for diving into lvm-tools
276 -source code to see what was going on with the whole new warning.
277 -
278 -Reported-and-tested-by: François Valenduc <francois.valenduc@××××××××××.be
279 -Reported-by: Henrique de Moraes Holschuh <hmh@×××××××.br>
280 -Cc: stable@××××××.org
281 -Signed-off-by: Linus Torvalds <torvalds@××××××××××××××××.org>
282 ----
283 -
284 -diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
285 -index aea1d3f..439fc1f 100644
286 ---- a/fs/proc/task_mmu.c
287 -+++ b/fs/proc/task_mmu.c
288 -@@ -210,6 +210,7 @@ static void show_map_vma(struct seq_file *m, struct vm_area_struct *vma)
289 - int flags = vma->vm_flags;
290 - unsigned long ino = 0;
291 - unsigned long long pgoff = 0;
292 -+ unsigned long start;
293 - dev_t dev = 0;
294 - int len;
295 -
296 -@@ -220,8 +221,13 @@ static void show_map_vma(struct seq_file *m, struct vm_area_struct *vma)
297 - pgoff = ((loff_t)vma->vm_pgoff) << PAGE_SHIFT;
298 - }
299 -
300 -+ /* We don't show the stack guard page in /proc/maps */
301 -+ start = vma->vm_start;
302 -+ if (vma->vm_flags & VM_GROWSDOWN)
303 -+ start += PAGE_SIZE;
304 -+
305 - seq_printf(m, "%08lx-%08lx %c%c%c%c %08llx %02x:%02x %lu %n",
306 -- vma->vm_start,
307 -+ start,
308 - vma->vm_end,
309 - flags & VM_READ ? 'r' : '-',
310 - flags & VM_WRITE ? 'w' : '-',
311 -diff --git a/mm/mlock.c b/mm/mlock.c
312 -index 3f82720..49e5e4c 100644
313 ---- a/mm/mlock.c
314 -+++ b/mm/mlock.c
315 -@@ -167,6 +167,14 @@ static long __mlock_vma_pages_range(struct vm_area_struct *vma,
316 - if (vma->vm_flags & VM_WRITE)
317 - gup_flags |= FOLL_WRITE;
318 -
319 -+ /* We don't try to access the guard page of a stack vma */
320 -+ if (vma->vm_flags & VM_GROWSDOWN) {
321 -+ if (start == vma->vm_start) {
322 -+ start += PAGE_SIZE;
323 -+ nr_pages--;
324 -+ }
325 -+ }
326 -+
327 - while (nr_pages > 0) {
328 - int i;
329 -