From patchwork Sun Oct 4 13:09:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Topi Miettinen X-Patchwork-Id: 40657 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 256BA385780E; Sun, 4 Oct 2020 13:09:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 256BA385780E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1601816989; bh=7USDt3tvTYmxhfu+BgQKb/20G7+qPdp+qhldtRHy1I0=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=iV27yiWN0sAk2z9L7l4SDFA6NhAEfuiVAoVa75HJD3yNwQqM3w0KR23phymWFpe/K /6rcXenhyikYOK5OuxIFSHBvsJEx5D8nDgQRZq7dYUYIwwCCnRfXUCYEgVMAQ19gOK umPxhgp5TGbAKF89D6xPqI6oUvCrZHcneVmvZsEA= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-lf1-x141.google.com (mail-lf1-x141.google.com [IPv6:2a00:1450:4864:20::141]) by sourceware.org (Postfix) with ESMTPS id 9B18B385780E for ; Sun, 4 Oct 2020 13:09:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9B18B385780E Received: by mail-lf1-x141.google.com with SMTP id d24so3743313lfa.8 for ; Sun, 04 Oct 2020 06:09:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=7USDt3tvTYmxhfu+BgQKb/20G7+qPdp+qhldtRHy1I0=; b=LoGiaS2ncUd/4GJ0BFtEZYYGrHY9pjDgUhVow5i7YmPXcuX7bnCfjPUOeR7sc5VYK8 3ZKGcLzJ1M4Rkn5s6CcVaCyrVUoT/VyVcE6/1sVo2DnpyeQk661V4puQpTXQ7iuEj9xe 9PCRt9p3tgG8DANEzurmmvMR1DQS6d/zQdh2662/uCmqn3JWk1d6UdS+mnXlTdf0iqIJ Ssi+nM7GOCA4q8tqjGp5/k6LyI0Irp9WuFJ3f0P1/iDGBvlQKZm3o9zt3IlxP7N7uKR1 PuRhKqAlv/Q4AViLqJm8nc3zqkHvojmmO224V8uUOijYEhULzPlsWXL8SJ45edVr5AY0 xGxQ== X-Gm-Message-State: AOAM5327jaPswSdYp5UXZ4z35rimS+SKM8NfQbx2cmGU/ZYWu0+ZPcJH ewZaEt8UiWYXnGPA9LxiFcfafL73CNU= X-Google-Smtp-Source: ABdhPJyFjAfnJ3pwMkYEUBieXrm8M7NfoXierDxhBZKNrcWqgK+KzVu0c7AY2jiIrBADUedGccd4kw== X-Received: by 2002:a19:f71a:: with SMTP id z26mr251235lfe.90.1601816984139; Sun, 04 Oct 2020 06:09:44 -0700 (PDT) Received: from localhost.localdomain (88-114-211-119.elisa-laajakaista.fi. [88.114.211.119]) by smtp.gmail.com with ESMTPSA id i7sm2264454ljb.44.2020.10.04.06.09.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Oct 2020 06:09:43 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [RFC PATCH 0/3] Improved ALSR Date: Sun, 4 Oct 2020 16:09:35 +0300 Message-Id: <20201004130938.64575-1-toiwoton@gmail.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Topi Miettinen via Libc-alpha From: Topi Miettinen Reply-To: Topi Miettinen Cc: Topi Miettinen Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Problem with using sbrk() for allocations is that the location of the memory is relatively predicatable since it's always located next to data segment. This series makes malloc() and TCB use mmap() instead. Topi Miettinen (3): csu: randomize location of TCB malloc: always use mmap() to improve ASLR dl-sysdep: disable remaining calls to sbrk() csu/libc-tls.c | 20 ++++++++++++++------ elf/dl-sysdep.c | 2 ++ malloc/arena.c | 5 ++++- malloc/malloc.c | 16 +++++++++++++--- malloc/morecore.c | 2 ++ sysdeps/unix/sysv/linux/dl-sysdep.c | 2 ++ sysdeps/unix/sysv/linux/mmap64.c | 19 +++++++++++++++++++ sysdeps/unix/sysv/linux/mmap_internal.h | 3 +++ 8 files changed, 59 insertions(+), 10 deletions(-)