linux/mm
Linus Torvalds e4599a4a45 mm: fix up some user-visible effects of the stack guard page
commit d7824370e2 upstream.

This commit makes the stack guard page somewhat less visible to user
space. It does this by:

 - not showing the guard page in /proc/<pid>/maps

   It looks like lvm-tools will actually read /proc/self/maps to figure
   out where all its mappings are, and effectively do a specialized
   "mlockall()" in user space.  By not showing the guard page as part of
   the mapping (by just adding PAGE_SIZE to the start for grows-up
   pages), lvm-tools ends up not being aware of it.

 - by also teaching the _real_ mlock() functionality not to try to lock
   the guard page.

   That would just expand the mapping down to create a new guard page,
   so there really is no point in trying to lock it in place.

It would perhaps be nice to show the guard page specially in
/proc/<pid>/maps (or at least mark grow-down segments some way), but
let's not open ourselves up to more breakage by user space from programs
that depends on the exact deails of the 'maps' file.

Special thanks to Henrique de Moraes Holschuh for diving into lvm-tools
source code to see what was going on with the whole new warning.

Reported-and-tested-by: François Valenduc <francois.valenduc@tvcablenet.be
Reported-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-20 11:34:24 -07:00
..
allocpercpu.c
backing-dev.c Thaw refrigerated bdi flusher threads before invoking kthread_stop on them 2009-11-12 13:08:11 +01:00
bootmem.c
bounce.c
debug-pagealloc.c
dmapool.c
fadvise.c readahead: introduce FMODE_RANDOM for POSIX_FADV_RANDOM 2010-03-15 08:49:37 -07:00
failslab.c
filemap_xip.c const: mark struct vm_struct_operations 2009-09-27 11:39:25 -07:00
filemap.c do_generic_file_read: clear page errors when issuing a fresh read of the page 2010-07-05 11:10:57 -07:00
fremap.c
highmem.c highmem: Fix debug_kmap_atomic() to also handle KM_IRQ_PTE, KM_NMI, and KM_NMI_PTE 2009-11-10 04:15:47 +01:00
hugetlb.c mm: hugetlb: fix clear_huge_page() 2010-07-05 11:10:42 -07:00
hwpoison-inject.c
init-mm.c
internal.h ksm: fix mlockfreed to munlocked 2010-01-06 15:05:22 -08:00
Kconfig NOMMU: Optimise away the {dac_,}mmap_min_addr tests 2010-01-06 15:04:30 -08:00
Kconfig.debug
kmemcheck.c
kmemleak-test.c
kmemleak.c kmemleak: Check for NULL pointer returned by create_object() 2009-10-09 13:28:47 -07:00
ksm.c ksm: fix mlockfreed to munlocked 2010-01-06 15:05:22 -08:00
maccess.c
madvise.c
Makefile
memcontrol.c memcg: fix prepare migration 2010-05-12 14:57:00 -07:00
memory_hotplug.c mm: allow memory hotplug and hibernation in the same kernel 2009-11-17 17:40:33 -08:00
memory-failure.c HWPOISON: abort on failed unmap 2010-08-13 13:20:17 -07:00
memory.c mm: fix page table unmap for stack guard page properly 2010-08-20 11:34:23 -07:00
mempolicy.c tmpfs: cleanup mpol_parse_str() 2010-04-01 15:58:27 -07:00
mempool.c
migrate.c Fix potential crash with sys_move_pages 2010-02-23 07:37:42 -08:00
mincore.c mm: hugetlb: fix hugepage memory leak in mincore() 2009-12-18 14:04:29 -08:00
mlock.c mm: fix up some user-visible effects of the stack guard page 2010-08-20 11:34:24 -07:00
mm_init.c
mmap.c untangle the do_mremap() mess 2010-01-18 10:19:11 -08:00
mmu_context.c
mmu_notifier.c
mmzone.c
mprotect.c
mremap.c untangle the do_mremap() mess 2010-01-18 10:19:11 -08:00
msync.c
nommu.c NOMMU: Don't pass NULL pointers to fput() in do_mmap_pgoff() 2009-10-31 12:11:37 -07:00
oom_kill.c memcg: fix oom killing a child process in an other cgroup 2010-03-15 08:49:33 -07:00
page_alloc.c mm: fix migratetype bug which slowed swapping 2010-02-09 04:50:49 -08:00
page_cgroup.c
page_io.c
page_isolation.c
page-writeback.c writeback: account IO throttling wait as iowait 2009-10-09 12:40:42 +02:00
pagewalk.c mm: hugetlb: fix hugepage memory leak in walk_page_range() 2009-12-18 14:04:30 -08:00
percpu.c percpu: restructure pcpu_extend_area_map() to fix bugs and improve readability 2009-11-13 00:55:35 +09:00
prio_tree.c
quicklist.c
readahead.c readahead: fix NULL filp dereference 2010-04-26 07:41:19 -07:00
rmap.c mm/rmap.c: fix comment 2009-10-01 16:11:12 -07:00
shmem_acl.c
shmem.c const: mark struct vm_struct_operations 2009-09-27 11:39:25 -07:00
slab.c slab: initialize unused alien cache entry as NULL at alloc_alien_cache(). 2010-03-15 08:49:36 -07:00
slob.c
slub.c
sparse-vmemmap.c
sparse.c
swap_state.c
swap.c
swapfile.c mm: fix corruption of hibernation caused by reusing swap during image saving 2010-08-13 13:20:26 -07:00
thrash.c
truncate.c vfs: Fix vmtruncate() regression 2010-01-22 15:18:41 -08:00
util.c untangle the do_mremap() mess 2010-01-18 10:19:11 -08:00
vmalloc.c mm: purge fragmented percpu vmap blocks 2010-02-09 04:50:58 -08:00
vmscan.c vmscan: do not evict inactive pages when skipping an active list scan 2010-01-06 15:05:21 -08:00
vmstat.c