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-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, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (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 2010E1F5AE for ; Fri, 24 Jul 2020 21:05:31 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D69D83857C64; Fri, 24 Jul 2020 21:05:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D69D83857C64 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1595624729; bh=+6M/1ATGfMeP8rXItjYvxeImFs1+QwJetYTvRHb39ys=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=Y6URUEk/80s5heZKZ6T2o7OAf9VyIRFfjDOjFuC75Gd9ycAGkdaNhwVIxhi1Swurx kAprzxHKtwyie2YZ1qZgmkUuir9u6FhNNpLKwNK7FTFyD3uHrmz+9oz755vXafYG4t 6gAl38jZaoRFhHbDcaGcbvpoytme1zr6PjWW8yVU= Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by sourceware.org (Postfix) with ESMTP id ABDA53857C41 for ; Fri, 24 Jul 2020 21:05:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org ABDA53857C41 Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-198-rihMJOhNOCadJfBf5lr5Uw-1; Fri, 24 Jul 2020 17:05:23 -0400 X-MC-Unique: rihMJOhNOCadJfBf5lr5Uw-1 Received: by mail-qv1-f71.google.com with SMTP id j8so4149907qvu.3 for ; Fri, 24 Jul 2020 14:05:23 -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:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=+6M/1ATGfMeP8rXItjYvxeImFs1+QwJetYTvRHb39ys=; b=V8HiFo1+5nYczp6bam3znNG0DsW3G4N/lUlOy6zOR2XxYbt3/2PHvIKFKlrMleNBWi 2yz7JX7QQQRiwAD9xpfInFWjBh23Gr02rZkrzYf9BWGWclEdWE3wn4DXkPCt9/BttoHA INb4qlPH7vLqVsnE/CP6TqtPByvYoqYEMEvNpc2vXHnrSeL4LDVisjNyDbjvgs2GZfZ6 txvNFVt9VR0833kIQW8EaHHcY3m29i5ukB2uqJor4huZvWI++LTWMEsHbqWnp7SmihGu Qmeb8glaZH7OxVEKaXeSyRQxKHDOX4I+czvmLWYXIn9Mi8POl/tMpMnqQNPQprGtnUY1 0jBA== X-Gm-Message-State: AOAM532k+FsNfwWVvvZ4Y5LNG+q5nc8i0CNiNd5FioC/61PYmhqOvg7j QeS5GuA8scH+gymrJGwLEbR4vbsq4e9Rmf4oWfD2bA4jMvo/USCq4WUAcjZWeTsiiz3jyYVHUWT 2+1d1K1RfOPhIpRWNKiBz X-Received: by 2002:a05:620a:1285:: with SMTP id w5mr11791061qki.21.1595624723188; Fri, 24 Jul 2020 14:05:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxdTKw5pxGwPll+Da5h2tPKwuinVlGsHKlEHWhGpe+WgxzvKJf7sl+8TzcCzYW5KjFz2RGVCg== X-Received: by 2002:a05:620a:1285:: with SMTP id w5mr11791045qki.21.1595624722981; Fri, 24 Jul 2020 14:05:22 -0700 (PDT) Received: from [192.168.1.4] (198-84-170-103.cpe.teksavvy.com. [198.84.170.103]) by smtp.gmail.com with ESMTPSA id y26sm2659803qto.75.2020.07.24.14.05.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 24 Jul 2020 14:05:22 -0700 (PDT) Subject: Re: [PATCH] Update tcache double-free check To: Eyal Itkin , GNU C Library References: Organization: Red Hat Message-ID: Date: Fri, 24 Jul 2020 17:05:21 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 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: Carlos O'Donell via Libc-alpha Reply-To: Carlos O'Donell Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" On 7/24/20 9:37 AM, Eyal Itkin via Libc-alpha wrote: > Hello, > > As we discussed, I've attached here the patch for updating the > double-free check in the tcache. The patch passes all of malloc's > existing tests (including the double free tests), and it was tested to > work as expected both with and without entropy. > > Once again, I apologize for sending the patch as an attachment instead > of inlined in the body of the mail itself (same Gmail issues as > before). > > I am aware that there might be whitespace issues with the patch, > please feel free to fix them on your end if possible. Do we have any concerns having all threads call getrandom()? If even *one* thread succeeded at calling getrandom() could we use that to make ~tcache more random? There is certainly a tradeoff here between the number of calls to getrandom() and the values we use in the key. I haven't measured the numbers to decide on this yet. Do your changes show up in benchtests/bench-malloc-{simple,thread}.c? -- Cheers, Carlos.