android_kernel_samsung_msm8976/arch/mips
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
..
arc Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
au1000 [PATCH] mips: nuke trailing whitespace 2005-09-05 00:06:07 -07:00
boot Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
cobalt Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
configs [PATCH] mips: add TANBAC TB0287 support 2005-09-09 13:57:30 -07:00
ddb5xxx [PATCH] mips: nuke trailing whitespace 2005-09-05 00:06:07 -07:00
dec [PATCH] mips: nuke trailing whitespace 2005-09-05 00:06:07 -07:00
galileo-boards/ev96100 Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
gt64120 Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
ite-boards [PATCH] mips: nuke trailing whitespace 2005-09-05 00:06:07 -07:00
jazz Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
jmr3927 Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
kernel [PATCH] error path in setup_arg_pages() misses vm_unacct_memory() 2005-09-14 11:18:13 -07:00
lasat [PATCH] mips: nuke trailing whitespace 2005-09-05 00:06:07 -07:00
lib [PATCH] spinlock consolidation 2005-09-10 10:06:21 -07:00
lib-32 kbuild: mips use generic asm-offsets.h support 2005-09-09 22:32:31 +02:00
lib-64 kbuild: mips use generic asm-offsets.h support 2005-09-09 22:32:31 +02:00
math-emu [PATCH] mips: fix build warnings 2005-09-05 00:06:08 -07:00
mips-boards [PATCH] mips: nuke trailing whitespace 2005-09-05 00:06:07 -07:00
mm [PATCH] mips: fix build warnings 2005-09-05 00:06:08 -07:00
momentum [PATCH] mips: nuke trailing whitespace 2005-09-05 00:06:07 -07:00
oprofile Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
pci [PATCH] mips: add TANBAC TB0287 support 2005-09-09 13:57:30 -07:00
pmc-sierra/yosemite [PATCH] mips: nuke trailing whitespace 2005-09-05 00:06:07 -07:00
qemu [PATCH] mips: add support for Qemu system architecture 2005-09-05 00:06:04 -07:00
sgi-ip22 [PATCH] mips: nuke trailing whitespace 2005-09-05 00:06:07 -07:00
sgi-ip27 [PATCH] NTP: ntp-helper functions 2005-09-07 16:57:34 -07:00
sgi-ip32 [PATCH] mips: nuke trailing whitespace 2005-09-05 00:06:07 -07:00
sibyte [PATCH] mips: nuke trailing whitespace 2005-09-05 00:06:07 -07:00
sni [PATCH] mips: nuke trailing whitespace 2005-09-05 00:06:07 -07:00
tx4927 [PATCH] mips: nuke trailing whitespace 2005-09-05 00:06:07 -07:00
vr41xx [PATCH] mips: nuke trailing whitespace 2005-09-05 00:06:07 -07:00
defconfig [PATCH] mips: fix coherency configuration 2005-09-05 00:06:07 -07:00
Kconfig [PATCH] mips: add TANBAC TB0287 support 2005-09-09 13:57:30 -07:00
Kconfig.debug Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
Makefile kbuild: mips use generic asm-offsets.h support 2005-09-09 22:32:31 +02:00