android_kernel_xiaomi_sm8350/arch/x86_64
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
..
boot [PATCH] x86-64: Fix gcc 4 warnings about pointer signedness 2005-09-12 10:50:56 -07:00
crypto
ia32 [PATCH] error path in setup_arg_pages() misses vm_unacct_memory() 2005-09-14 11:18:13 -07:00
kernel [PATCH] x86_64: Export end_pfn 2005-09-13 09:59:04 -07:00
lib kbuild: alpha,x86_64 use generic asm-offsets.h support 2005-09-09 21:28:48 +02:00
mm [PATCH] x86-64: Use correct mask to compute conflicting nodes in SRAT 2005-09-12 10:50:58 -07:00
oprofile
pci [PATCH] x86-64: Use ACPI PXM to parse PCI<->node assignments 2005-09-12 10:49:57 -07:00
defconfig [PATCH] x86-64: Update defconfig 2005-09-12 10:49:55 -07:00
Kconfig Merge linux-2.6 with linux-acpi-2.6 2005-09-08 01:45:47 -04:00
Kconfig.debug
Makefile kbuild: alpha,x86_64 use generic asm-offsets.h support 2005-09-09 21:28:48 +02:00