From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 73949 invoked by alias); 28 Oct 2016 14:11:59 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 73922 invoked by uid 89); 28 Oct 2016 14:11:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.2 spammy=H*M:48fd, Along X-HELO: mail-qt0-f170.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding; bh=cUXyENHbxU5EUH7oDtx5SRo3bRWQ7/QgL0eY18W07gM=; b=lOEl0gN7oBEIszCa9X98lXwWat8vgR5ssV1aBCSrbqediNEX+vvt9Olzd2CVb7AMs6 EZVxHXrzuq0rDk5tC5qCI589h/CNWWErjIg9J4di3rDQYTXkLmkRVnJ/As2JrjDI4CuF tEcy5/ZbPWx5Sz64XOfiBeu27MN+CG8efyq1qWrT5KpBHW6uTxwR6iFcU3Aixmuaes5s wM/ytjLUDiBNsxnk4kPOridohPKBC2gbidqHFO2ep57Hyt+Gq5WrvC5sFEyp8naxle8H CNSy4LjtaIG3bX2OdhKVeIFFaeh8R4o0D4StM/wAKfKmSRDzeyO/Dbn9k33PJnmw3aui Lt4g== X-Gm-Message-State: ABUngveQgkKk234FXjq+8smybCdzptV6SVx8cJcDpDZ7HapC8HQ82hRoxuqU8wLkANOALrmc X-Received: by 10.237.37.72 with SMTP id w8mr3845972qtc.80.1477663915496; Fri, 28 Oct 2016 07:11:55 -0700 (PDT) Subject: Re: [PATCH] malloc: Use accessors for chunk metadata access To: Florian Weimer , GNU C Library References: <5443da2a-7b59-929f-c6ce-ad6c19b0f2ea@redhat.com> From: Carlos O'Donell Message-ID: Date: Fri, 28 Oct 2016 14:11:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <5443da2a-7b59-929f-c6ce-ad6c19b0f2ea@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-10/txt/msg00538.txt.bz2 On 10/28/2016 09:02 AM, Florian Weimer wrote: > I verified that malloc/malloc.o on x86_64 is virtually unchanged > before and after this patch, exception for line numbers and assert > messages. This looks good to me and I know that the accessors have the eventual goal of providing chunk header hardening. I particularly like that you renamed prev_size and size for safety to ensure you catch any code other people might have written that could still function after the conversion e.g. custom downstream patches. Along with the GCC poison pragma :-) Can I ask for one thing? Add a 'chunk_main_arena()' accessor to cleanup the double-negatives in the code e.g. assert (! chunk_non_main_arena (bck->bk)); Or rename it because it's only ever used in double negatives: chunk_main_arena chunk_main_heap etc. Please keep 'main' somewhere in the name to indicate that this is the main arena. OK to checkin with that one tweak. -- Cheers, Carlos.