Skip to contentSkip to conversation

errorpath in expand_stack() [2.6.7-rc1]

DISCUSSION Herbert Poetzl 2 participants 2 messages May 24, 2004

lore
Share & tools
lore
#0 lore raw

another question:

I'm not sure the vm_unacct_memory(grow) is
correct here, but if, shouldn't there be the
same in the security_vm_enough_memory(grow)
path?

mm/mmap.c ~1260 expand_stack()

        /* Overcommit.. */
        if (security_vm_enough_memory(grow)) {
                anon_vma_unlock(vma);
                return -ENOMEM;
        }

        if (vma->vm_end - address > current->rlim[RLIMIT_STACK].rlim_cur ||
                        ((vma->vm_mm->total_vm + grow) << PAGE_SHIFT) >
                        current->rlim[RLIMIT_AS].rlim_cur) {
                anon_vma_unlock(vma);
                vm_unacct_memory(grow);
                return -ENOMEM;
        }

TIA,
Herbert

#1 lore raw
Quoted 7 lines · * Herbert Poetzl ([email protected]) wrote:

another question:

I'm not sure the vm_unacct_memory(grow) is
correct here, but if, shouldn't there be the
same in the security_vm_enough_memory(grow)
path?

Currently, this is done inside the call to security_vm_enough_memory.

thanks,
-chris

Signature · 1 line
Linux Security Modules     http://lsm.immunix.org     http://lsm.bkbits.net