From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from olivedrab.birch.relay.mailchannels.net (olivedrab.birch.relay.mailchannels.net [23.83.209.135]) by sourceware.org (Postfix) with ESMTPS id 1AC473858D28 for ; Mon, 31 Jan 2022 05:32:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1AC473858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gotplt.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gotplt.org X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id DF0C9800C2D; Mon, 31 Jan 2022 05:32:38 +0000 (UTC) Received: from pdx1-sub0-mail-a305.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 93EA6800F17; Mon, 31 Jan 2022 05:32:38 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from pdx1-sub0-mail-a305.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.96.96.39 (trex/6.4.3); Mon, 31 Jan 2022 05:32:38 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Stretch-Lonely: 7f06e91201f922a9_1643607158759_353522338 X-MC-Loop-Signature: 1643607158759:915254977 X-MC-Ingress-Time: 1643607158759 Received: from [192.168.1.174] (unknown [1.186.224.220]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by pdx1-sub0-mail-a305.dreamhost.com (Postfix) with ESMTPSA id 4JnGsx09X4znd; Sun, 30 Jan 2022 21:32:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gotplt.org; s=gotplt.org; t=1643607158; bh=QS1Ut7/VeyW3mF526SqXAVy4Axo=; h=Date:Subject:To:From:Content-Type:Content-Transfer-Encoding; b=wsmZ9m/a1lzHd0rrr/bEXWGjJIxeTBvYb+DjmuS2xznStBCh3Gbbd4JcTQhvqtqvc lQztRqjXggGhPieV83culAa+F/Sp+SG0XESWB4FhMfFXntnBhGHBZfbaEDuLDC2g90 e+bdmMqFBWVCg23/ploFpWDCqfOIgwsUx8Q3rO+4= Message-ID: Date: Mon, 31 Jan 2022 11:02:32 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Subject: Re: [PATCH] malloc: Fix -Wuse-after-free warning in tst-mallocalign1 [BZ #26779] Content-Language: en-US To: Carlos O'Donell , libc-alpha@sourceware.org, joseph@codesourcery.com References: <20220131052132.3854764-1-carlos@redhat.com> From: Siddhesh Poyarekar In-Reply-To: <20220131052132.3854764-1-carlos@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3029.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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-List-Received-Date: Mon, 31 Jan 2022 05:32:41 -0000 On 31/01/2022 10:51, Carlos O'Donell via Libc-alpha wrote: > The test leaks bits from the freed pointer via the return value > in ret, and the compiler correctly identifies this issue. > We switch the test to use TEST_VERIFY and terminate the test > if any of the pointers return an unexpected alignment. > > This fixes another -Wuse-after-free error when compiling glibc > with gcc 12. > > Tested on x86_64 and i686 without regression. LGTM. Reviewed-by: Siddhesh Poyarekar