kernel-ark/arch/ppc64/kernel
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
..
vdso32 kbuild: m68k,parisc,ppc,ppc64,s390,xtensa use generic asm-offsets.h support 2005-09-09 20:57:26 +02:00
vdso64 kbuild: m68k,parisc,ppc,ppc64,s390,xtensa use generic asm-offsets.h support 2005-09-09 20:57:26 +02:00
align.c
asm-offsets.c Merge master.kernel.org:/pub/scm/linux/kernel/git/dwmw2/audit-2.6 2005-09-13 09:47:30 -07:00
binfmt_elf32.c
bitops.c
bpa_iic.c [PATCH] ppc64: fix IPI on bpa_iic 2005-09-09 22:11:34 +10:00
bpa_iic.h
bpa_iommu.c
bpa_iommu.h
bpa_nvram.c
bpa_setup.c
btext.c
cpu_setup_power4.S [PATCH] merge some from Rusty's trivial patches 2005-09-10 10:06:30 -07:00
cputable.c
dma.c
eeh.c [PATCH] Separate pci bits out of struct device_node 2005-09-09 22:11:38 +10:00
entry.S Merge master.kernel.org:/pub/scm/linux/kernel/git/dwmw2/audit-2.6 2005-09-13 09:47:30 -07:00
firmware.c
head.S kbuild: m68k,parisc,ppc,ppc64,s390,xtensa use generic asm-offsets.h support 2005-09-09 20:57:26 +02:00
HvCall.c
hvCall.S
hvconsole.c
hvcserver.c
HvLpConfig.c
HvLpEvent.c
i8259.c
i8259.h
idle_power4.S kbuild: m68k,parisc,ppc,ppc64,s390,xtensa use generic asm-offsets.h support 2005-09-09 20:57:26 +02:00
idle.c
init_task.c
ioctl32.c
iomap.c Merge master.kernel.org:/pub/scm/linux/kernel/git/paulus/ppc64-2.6 2005-09-09 10:38:02 -07:00
iommu.c [PATCH] Separate pci bits out of struct device_node 2005-09-09 22:11:38 +10:00
irq.c
iSeries_htab.c
iSeries_iommu.c
iSeries_irq.c
iSeries_pci.c [PATCH] ppc64: indent pci code 2005-09-12 17:19:12 +10:00
iSeries_proc.c
iSeries_setup.c
iSeries_setup.h
iSeries_smp.c
iSeries_vio.c
iSeries_VpdInfo.c [PATCH] PCI: remove CONFIG_PCI_NAMES 2005-09-08 14:57:23 -07:00
ItLpQueue.c
kprobes.c
lmb.c
lparcfg.c
LparData.c
lparmap.c
machine_kexec.c
Makefile
maple_pci.c [PATCH] ppc64: indent pci code 2005-09-12 17:19:12 +10:00
maple_setup.c
maple_time.c
mf.c
misc.S Merge master.kernel.org:/pub/scm/linux/kernel/git/sam/kbuild 2005-09-09 15:46:49 -07:00
module.c
mpic.c
mpic.h
nvram.c
of_device.c
pacaData.c
pci_direct_iommu.c
pci_dn.c [PATCH] Separate pci bits out of struct device_node 2005-09-09 22:11:38 +10:00
pci_iommu.c [PATCH] Separate pci bits out of struct device_node 2005-09-09 22:11:38 +10:00
pci.c ppc64: Set up PCI tree from Open Firmware device tree 2005-09-12 17:17:36 +10:00
pci.h [PATCH] Separate pci bits out of struct device_node 2005-09-09 22:11:38 +10:00
pmac_feature.c [PATCH] Separate pci bits out of struct device_node 2005-09-09 22:11:38 +10:00
pmac_low_i2c.c
pmac_nvram.c
pmac_pci.c [PATCH] ppc64: indent pci code 2005-09-12 17:19:12 +10:00
pmac_setup.c ppc64: Set up PCI tree from Open Firmware device tree 2005-09-12 17:17:36 +10:00
pmac_smp.c
pmac_time.c
pmac.h
pmc.c [PATCH] more SPIN_LOCK_UNLOCKED -> DEFINE_SPINLOCK conversions 2005-09-09 14:03:48 -07:00
ppc_ksyms.c
proc_ppc64.c
process.c [PATCH] ppc64: Add ptrace data breakpoint support 2005-09-12 17:19:12 +10:00
prom_init.c
prom.c [PATCH] Separate pci bits out of struct device_node 2005-09-09 22:11:38 +10:00
pSeries_hvCall.S
pSeries_iommu.c [PATCH] Separate pci bits out of struct device_node 2005-09-09 22:11:38 +10:00
pSeries_lpar.c
pSeries_nvram.c
pSeries_pci.c
pSeries_reconfig.c
pSeries_setup.c [PATCH] ppc64: Make eeh_init function again 2005-09-13 08:26:15 -07:00
pSeries_smp.c [PATCH] ppc64: Fix for missing start-cpu rtas token 2005-09-12 17:19:12 +10:00
pSeries_vio.c
ptrace32.c [PATCH] ppc64: Add ptrace data breakpoint support 2005-09-12 17:19:12 +10:00
ptrace.c [PATCH] ppc64: Add ptrace data breakpoint support 2005-09-12 17:19:12 +10:00
ras.c [PATCH] ppc64: Add ptrace data breakpoint support 2005-09-12 17:19:12 +10:00
rtas_flash.c
rtas_pci.c [PATCH] Separate pci bits out of struct device_node 2005-09-09 22:11:38 +10:00
rtas-proc.c
rtas.c
rtasd.c
rtc.c
scanlog.c
semaphore.c
setup.c [PATCH] ppc64: Remove unused code 2005-09-12 17:19:12 +10:00
signal32.c [PATCH] ppc64: Add ptrace data breakpoint support 2005-09-12 17:19:12 +10:00
signal.c [PATCH] ppc64: Add ptrace data breakpoint support 2005-09-12 17:19:12 +10:00
smp-tbsync.c
smp.c
spider-pic.c
sys_ppc32.c Allow PCI config space syscalls to be used by 64-bit processes. 2005-09-09 23:02:36 +10:00
syscalls.c [PATCH] powerpc: Make check_bugs() static inline 2005-09-09 22:11:35 +10:00
sysfs.c
time.c
traps.c
u3_iommu.c [PATCH] Separate pci bits out of struct device_node 2005-09-09 22:11:38 +10:00
udbg_16550.c
udbg_scc.c
udbg.c [PATCH] ppc64: iSeries early printk breakage 2005-09-09 22:11:34 +10:00
vdso.c [PATCH] error path in setup_arg_pages() misses vm_unacct_memory() 2005-09-14 11:18:13 -07:00
vecemu.c
vector.S
vio.c
viopath.c
vmlinux.lds.S
xics.c [PATCH] ppc64: xics cleanup 2005-09-12 17:19:12 +10:00