https://bugs.kde.org/show_bug.cgi?id=357833

--- Comment #5 from Mark Wielaard <m...@redhat.com> ---
For reference here is the full commit explaining that previously the
RLIMIT_DATA value indeed was mostly harmless only affecting brk, but now
restricts any data area allocations:

commit 84638335900f1995495838fe1bd4870c43ec1f67
Author:     Konstantin Khlebnikov <koc...@gmail.com>
AuthorDate: Thu Jan 14 15:22:07 2016 -0800
Commit:     Linus Torvalds <torva...@linux-foundation.org>
CommitDate: Thu Jan 14 16:00:49 2016 -0800

    mm: rework virtual memory accounting

    When inspecting a vague code inside prctl(PR_SET_MM_MEM) call (which
    testing the RLIMIT_DATA value to figure out if we're allowed to assign
    new @start_brk, @brk, @start_data, @end_data from mm_struct) it's been
    commited that RLIMIT_DATA in a form it's implemented now doesn't do
    anything useful because most of user-space libraries use mmap() syscall
    for dynamic memory allocations.

    Linus suggested to convert RLIMIT_DATA rlimit into something suitable
    for anonymous memory accounting.  But in this patch we go further, and
    the changes are bundled together as:

     * keep vma counting if CONFIG_PROC_FS=n, will be used for limits
     * replace mm->shared_vm with better defined mm->data_vm
     * account anonymous executable areas as executable
     * account file-backed growsdown/up areas as stack
     * drop struct file* argument from vm_stat_account
     * enforce RLIMIT_DATA for size of data areas

    This way code looks cleaner: now code/stack/data classification depends
    only on vm_flags state:

     VM_EXEC & ~VM_WRITE            -> code  (VmExe + VmLib in proc)
     VM_GROWSUP | VM_GROWSDOWN      -> stack (VmStk)
     VM_WRITE & ~VM_SHARED & !stack -> data  (VmData)

    The rest (VmSize - VmData - VmStk - VmExe - VmLib) could be called
    "shared", but that might be strange beast like readonly-private or VM_IO
    area.

     - RLIMIT_AS            limits whole address space "VmSize"
     - RLIMIT_STACK         limits stack "VmStk" (but each vma individually)
     - RLIMIT_DATA          now limits "VmData"

    Signed-off-by: Konstantin Khlebnikov <koc...@gmail.com>
    Signed-off-by: Cyrill Gorcunov <gorcu...@openvz.org>
    Cc: Quentin Casasnovas <quentin.casasno...@oracle.com>
    Cc: Vegard Nossum <vegard.nos...@oracle.com>
    Acked-by: Linus Torvalds <torva...@linux-foundation.org>
    Cc: Willy Tarreau <w...@1wt.eu>
    Cc: Andy Lutomirski <l...@amacapital.net>
    Cc: Kees Cook <keesc...@google.com>
    Cc: Vladimir Davydov <vdavy...@virtuozzo.com>
    Cc: Pavel Emelyanov <xe...@virtuozzo.com>
    Cc: Peter Zijlstra <a.p.zijls...@chello.nl>
    Signed-off-by: Andrew Morton <a...@linux-foundation.org>
    Signed-off-by: Linus Torvalds <torva...@linux-foundation.org>

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to