From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS17314 8.43.84.0/22 X-Spam-Status: No, score=-4.3 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 476311F8C6 for ; Wed, 14 Jul 2021 17:43:00 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 596AF3987015 for ; Wed, 14 Jul 2021 17:42:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 596AF3987015 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1626284579; bh=NYx3ggsjy1sj/N39LIJajfADtOjua0Fu/YXtD8dwSbk=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=NL5XhS0f81Jj5SB6QDFtWQX1KJBfOOO8P0Q4oB5a42sjsT6YAbb1OTp5A0NSznYEg GYY38e/JGAwvprMJa+p6lMfx8jf7065Yiy4jthG50fFmCm1eaTmEC8hckBKToMJfnb 6rDuMNy/nRhTUurH9PV/TNCcYDd0LMOhL4/ZwALM= Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by sourceware.org (Postfix) with ESMTPS id 57B733864819 for ; Wed, 14 Jul 2021 17:42:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 57B733864819 Received: by mail-pg1-x52c.google.com with SMTP id d12so3222097pgd.9 for ; Wed, 14 Jul 2021 10:42:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=NYx3ggsjy1sj/N39LIJajfADtOjua0Fu/YXtD8dwSbk=; b=qu8jfLng9ioIqKq85kSIxFZ5BkI71lf1/yZu/X1U/yXHJutsOw66WbYM7hTQu5+4Bj BeYb0MuYfmD3Z7M5QeNoqYCggEoTUKsAAjGgz/wD7bEMEa4CHx6ReBBlsP7CclgADx// DM6x+Sp6n/oDuIdx5HPv1rXa7ZnurDSWR/tOPbIRvCz0asPKETTbHnKP6sc+ALxMn7Oz X8iFbDpuLVJoP5MBqrLOContkgOhg/umyKFh33L1xETAVNF7Z5C1eIDamcSHjZhEYfWO dJM7qY8bKoKc7Cj9Mr+ETTpCuFZyCaOw13bFWoAN0nnXTqn0U1M+rv+aBVG10nAJ7zAK u0Kg== X-Gm-Message-State: AOAM533ZF6YhjJRUW1KFITJXcLZDSvT2N62coTpQkLhS9SqLMWdL9YJH qkSGcTDYvc9QVM6QY9C+WbJpmS9/AOrNDw== X-Google-Smtp-Source: ABdhPJzFbPk6kHrmUtta6viWZ/Kgr4IcDXJnXKb87PqlquOfMYacgLrRahR/g03fTxzOnBFu2wEpMA== X-Received: by 2002:a63:5f0b:: with SMTP id t11mr10786699pgb.392.1626284558162; Wed, 14 Jul 2021 10:42:38 -0700 (PDT) Received: from [192.168.1.108] ([177.194.59.218]) by smtp.gmail.com with ESMTPSA id bj15sm2920468pjb.6.2021.07.14.10.42.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 14 Jul 2021 10:42:37 -0700 (PDT) Subject: Re: [PATCH v8 03/10] Remove __morecore and __default_morecore To: Carlos O'Donell , Guillaume Morin , Siddhesh Poyarekar References: <20210713073845.504356-1-siddhesh@sourceware.org> <20210713073845.504356-4-siddhesh@sourceware.org> <9925362a-d278-a0ad-f504-ae08ca93f628@gotplt.org> <20210714125415.GA24678@bender.morinfr.org> <45ba79b4-02e6-fae5-ae9b-db6c8a01aecb@gotplt.org> <20210714164204.GA1103@bender.morinfr.org> Message-ID: <63c84757-92b6-703f-b017-126518bf008b@linaro.org> Date: Wed, 14 Jul 2021 14:42:34 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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: , From: Adhemerval Zanella via Libc-alpha Reply-To: Adhemerval Zanella Cc: fweimer@redhat.com, Siddhesh Poyarekar , libc-alpha@sourceware.org Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" On 14/07/2021 14:15, Carlos O'Donell via Libc-alpha wrote: > On 7/14/21 12:42 PM, Guillaume Morin wrote: >> That said, I was personally aware since it was pointed out on a >> libhugetlbfs github issue that it was deprecated in 2.32. I think the >> hope was it would be replaced by something usable, and users would not >> be left with *no* solution (I was also quietly hoping Eric Munson, the >> libhugetlbfs maintainer would be reaching out). But if you remove it, I >> am not quite sure what you expect libhugetlbfs users to do, really. > > Please work with upstream libhugetlbfs to prioritize issue #52. > > Deprecation of morecore in glibc #52 (2020-08-27): > https://github.com/libhugetlbfs/libhugetlbfs/issues/52 > I agree with Carlos and Siddhesh rationale that a dangling function pointer in an essential code as malloc is a security liability and it is about time to get removed (as there is PoC out there that does it to exploit glibc malloc). However I think we can work towards a solution to enable within glibc instead of pushing the support on libhugetlfs, which does *not* aim to be a malloc replacement but rather a way to explicit provide and manage large pages. There is some discussion last year about providing large pages support directly on glibc without resorting to THP [1]. The idea is to hook up the mmap/madvise with the required flags, which seems similar of what is required by libhugetls morecore() implementation [2]. So I think it should be feasible to add support for the required bits on glibc and provide a tunable to actually use it. The proposed patchset does require some additional work, such as providing is through a tunable, allowing different sizes depending of the architecture, and maybe just dump the sbrk change in favor of just using mmap() for the case of large pages. Guillaume, would this be suffice for your use cases. The libhugetlsfs projects does provide more functionality than glibc scope, for instance a linker script to for bss/data and exe section to large parges, so I glibc support would be a complement to what libhugetls provides. [1] https://sourceware.org/pipermail/libc-alpha/2020-May/113539.html [2] https://github.com/libhugetlbfs/libhugetlbfs/blob/master/morecore.c