linux/arch/x86_64/ia32
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
..
fpu32.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
ia32_aout.c [PATCH] turn many #if $undefined_string into #ifdef $undefined_string 2005-07-27 16:26:08 -07:00
ia32_binfmt.c [PATCH] error path in setup_arg_pages() misses vm_unacct_memory() 2005-09-14 11:18:13 -07:00
ia32_ioctl.c [PATCH] lost fput in 32bit ioctl on x86-64 2005-09-09 14:19:43 -07:00
ia32_signal.c [PATCH] x86_64: never block forced SIGSEGV 2005-06-23 09:45:13 -07:00
ia32entry.S [PATCH] x86-64: Fix CFI information 2005-09-12 10:50:56 -07:00
ipc32.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
Makefile [PATCH] x86_64: Icecream has no way of detecting assembler-level includes 2005-07-28 21:46:01 -07:00
ptrace32.c [PATCH] x86_64: fix 32-bit thread debugging 2005-08-04 16:28:27 -07:00
sys_ia32.c [PATCH] x86-64: Fix 32bit sendfile 2005-09-12 10:49:57 -07:00
syscall32_syscall.S [PATCH] x86_64: Icecream has no way of detecting assembler-level includes 2005-07-28 21:46:01 -07:00
syscall32.c [PATCH] error path in setup_arg_pages() misses vm_unacct_memory() 2005-09-14 11:18:13 -07:00
tls32.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
vsyscall-sigreturn.S [PATCH] x86-64: i386 vDSO: add PT_NOTE segment 2005-04-16 15:24:50 -07:00
vsyscall-syscall.S kbuild: alpha,x86_64 use generic asm-offsets.h support 2005-09-09 21:28:48 +02:00
vsyscall-sysenter.S kbuild: alpha,x86_64 use generic asm-offsets.h support 2005-09-09 21:28:48 +02:00
vsyscall.lds [PATCH] x86_64: fix PT_NOTE addition to IA32 vDSO 2005-04-28 22:47:29 -07:00