linux-sg2042/arch
Hugh Dickins 2fd4ef85e0 [PATCH] error path in setup_arg_pages() misses vm_unacct_memory()
Pavel Emelianov and Kirill Korotaev observe that fs and arch users of
security_vm_enough_memory tend to forget to vm_unacct_memory when a
failure occurs further down (typically in setup_arg_pages variants).

These are all users of insert_vm_struct, and that reservation will only
be unaccounted on exit if the vma is marked VM_ACCOUNT: which in some
cases it is (hidden inside VM_STACK_FLAGS) and in some cases it isn't.

So x86_64 32-bit and ppc64 vDSO ELFs have been leaking memory into
Committed_AS each time they're run.  But don't add VM_ACCOUNT to them,
it's inappropriate to reserve against the very unlikely case that gdb
be used to COW a vDSO page - we ought to do something about that in
do_wp_page, but there are yet other inconsistencies to be resolved.

The safe and economical way to fix this is to let insert_vm_struct do
the security_vm_enough_memory check when it finds VM_ACCOUNT is set.

And the MIPS irix_brk has been calling security_vm_enough_memory before
calling do_brk which repeats it, doubly accounting and so also leaking.
Remove that, and all the fs and arch calls to security_vm_enough_memory:
give it a less misleading name later on.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-Off-By: Kirill Korotaev <dev@sw.ru>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-09-14 11:18:13 -07:00
..
alpha [PATCH] alpha: fix-up schedule_timeout() usage 2005-09-10 10:06:37 -07:00
arm Merge master.kernel.org:/home/rmk/linux-2.6-arm 2005-09-13 15:19:14 -07:00
arm26 kbuild: arm26,sparc use generic asm-offset support 2005-09-09 20:35:55 +02:00
cris kbuild: rename prepare to archprepare to fix dependency chain 2005-09-11 22:30:22 +02:00
frv kbuild: frv,m32r,sparc64 introduce fake asm-offsets.h file 2005-09-09 22:47:53 +02:00
h8300 kbuild: h8300,m68knommu,sh,sh64 use generic asm-offsets.h support 2005-09-09 20:28:49 +02:00
i386 [PATCH] Even more fallout from ATI Xpress timer workaround 2005-09-13 15:07:06 -07:00
ia64 [PATCH] error path in setup_arg_pages() misses vm_unacct_memory() 2005-09-14 11:18:13 -07:00
m32r [PATCH] Remove even more stale references to Documentation/smp.tex 2005-09-10 10:06:24 -07:00
m68k Merge master.kernel.org:/pub/scm/linux/kernel/git/sam/kbuild 2005-09-09 15:46:49 -07:00
m68knommu [PATCH] m68knommu: startup code for the Drangen Engine 68328 based board 2005-09-12 20:04:15 -07:00
mips [PATCH] error path in setup_arg_pages() misses vm_unacct_memory() 2005-09-14 11:18:13 -07:00
parisc [PATCH] spinlock consolidation 2005-09-10 10:06:21 -07:00
ppc [PATCH] ppc32: remove use of asm/segment.h 2005-09-13 08:22:28 -07:00
ppc64 [PATCH] error path in setup_arg_pages() misses vm_unacct_memory() 2005-09-14 11:18:13 -07:00
s390 [PATCH] x86-64: Fix 32bit sendfile 2005-09-12 10:49:57 -07:00
sh kbuild: rename prepare to archprepare to fix dependency chain 2005-09-11 22:30:22 +02:00
sh64 kbuild: rename prepare to archprepare to fix dependency chain 2005-09-11 22:30:22 +02:00
sparc [SPARC]: Fix dot-symbol exporting for good. 2005-09-11 20:14:07 -07:00
sparc64 [PATCH] spinlock consolidation 2005-09-10 10:06:21 -07:00
um kbuild: rename prepare to archprepare to fix dependency chain 2005-09-11 22:30:22 +02:00
v850 [PATCH] V850: C99 initializers for hw_interrupt_type structures 2005-09-10 10:06:27 -07:00
x86_64 [PATCH] error path in setup_arg_pages() misses vm_unacct_memory() 2005-09-14 11:18:13 -07:00
xtensa kbuild: rename prepare to archprepare to fix dependency chain 2005-09-11 22:30:22 +02:00