>>Kirill Korotaev wrote: >> >>> This patch fixes error path in setup_arg_pages() functions, since it >>> misses vm_unacct_memory() after successful call of >>> security_vm_enough_memory(). Also it cleans up error path. >> >>Ugh. The identifier `security_vm_enough_memory()' sounds like some >>predicate which has no side-effects. Except it performs accounting. Hence >>bugs like this. >> >>It's a shame that you mixed a largeish cleanup along with a bugfix - please >>don't do that in future. >> >>Patch looks OK to me. Hugh, could you please double-check sometime? > > > It's a good find, and the patch looks correct to me, so far as it goes. > But I think it's the wrong patch, and incomplete: it can be done more > appropriately, more simply and more completely in insert_vm_struct itself. > I'll post a replacement patch (or admit I'm wrong) in a little while. this looks like the weirdest solution to me... also it looks like not all the callers of insert_vm_struct do call security_vm_enough_memory(), e.g. ./arch/sparc/mm/sun4c.c ------------------------------------------------------------------ Also, Pavel missed ppc64 version of setup_arg_pages due to different name. I attached 2 new additional patches: 1. diff-ms-ppsleak-20050913: [PATCH] error path in ppc64::arch_setup_additional_pages() misses vm_unacct_memory() and kmem_cache_free() This patch fixes error path in arch_setup_additional_pages() function, since it misses vm_unacct_memory() and kmmem_cache_free() after successful call of security_vm_enough_memory(). Signed-Off-By: Pavel Emelianov Signed-Off-By: Kirill Korotaev 2. diff-ms-ppscleanup-20050913: [PATCH] This patch cleanups error path in ppc64::arch_setup_additional_pages() function. Signed-Off-By: Pavel Emelianov Signed-Off-By: Kirill Korotaev Kirill