From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id EB0DD3858402 for ; Fri, 28 Jan 2022 13:10:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EB0DD3858402 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com IronPort-SDR: qwkUMeL925eojDEAZ4O29o1AW7TTA+sa14S8EHTUEQnwPGSIaYhuWZB8zVhW4IJJ1IvjaflOnu tX0Y2lkoQNcVXm8GDXK85QLtlB91lzk+Mpp0xI7OmIhtqvasWoGodHYIGGk+SbMGjDKj561JhT yi+0QgnupTWy0Jufwg09YaKzV7XllgZ98FKPO9S5BMLQ3M8376EMsvLoczXX9/SK90on/Irhw+ TeOqbXTV1C4GAH+i8LmURfU7TB5ZNbAW5/zfmonmhUxRHHxLKU3YE6eW7Tpx/X8fKBBByZuPZv IgOPr7Fgm5VPG7OuPwa71I0x X-IronPort-AV: E=Sophos;i="5.88,324,1635235200"; d="scan'208";a="73876325" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa1.mentor.iphmx.com with ESMTP; 28 Jan 2022 05:10:17 -0800 IronPort-SDR: mj0j9jbHq9BHH1IaTuN9OVEO4KPmbvLMHtSnzmr00hItSN3Otjxc8MIKTe2KxGOdRiMnsrIJIi MlJQ65HHYaLPXmaeLlJdouzhMF9kSW2X2zFQTSWBpNr9u5pMBPDO5YbyVEfK8lpbRxb3b91nrp 4YkWiBSnEwPsCtbXoWtoSn56qtyJltenKnv9pnkxhLrJ0o1I6kirDWOCGERCOv3d2uzImfCk9J 1dwtISXZqKpI5Hmlyv1VlrGJtubKoWaUaLB9hoo9+y2/NvMMNK9hSeoIUaOCh9wWEfwD2XeszU 33w= Date: Fri, 28 Jan 2022 13:10:10 +0000 From: Joseph Myers X-X-Sender: jsm28@digraph.polyomino.org.uk To: Carlos O'Donell CC: Martin Sebor , Subject: Re: [PATCH v3 5/5] avoid -Wuse-after-free [BZ #26779] In-Reply-To: <7b1e2fda-b440-ad77-4586-7e73b7c927b0@redhat.com> Message-ID: References: <53f20975-a2c9-674d-2a43-b1b323ee545c@gmail.com> <50baa5fb-c1ee-f7dc-b7d6-cf4587782062@gmail.com> <3ad704bb-a061-1dc2-3b6d-8343f70a3c92@gmail.com> <7b1e2fda-b440-ad77-4586-7e73b7c927b0@redhat.com> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-11.mgc.mentorg.com (139.181.222.11) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-3115.2 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, 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: Fri, 28 Jan 2022 13:10:21 -0000 Note that there are still -Wuse-after-free build failures in the testsuite for many 32-bit platforms. E.g., on i686-linux-gnu: tst-mallocalign1.c: In function 'do_test': tst-mallocalign1.c:69:1: error: pointer 'p' used after 'free' [-Werror=use-after-free] 69 | } | ^ tst-mallocalign1.c:42:3: note: call to 'free' here 42 | free (p); | ^~~~~~~~ Also, the s390x-linux-gnu-O3 build-many-glibcs.py configuration shows failures: In function 'do_test', inlined from 'legacy_test_function' at ../test-skeleton.c:55:10: tst-realloc.c:134:12: error: pointer 'p' may be used after 'realloc' [-Werror=use-after-free] 134 | if (c[i] != 0xff) | ~^~~ tst-realloc.c:124:7: note: call to 'realloc' here 124 | c = realloc (p, -1); | ^~~~~~~~~~~~~~~ tst-realloc.c:134:12: error: pointer 'p' may be used after 'realloc' [-Werror=use-after-free] 134 | if (c[i] != 0xff) | ~^~~ tst-realloc.c:124:7: note: call to 'realloc' here 124 | c = realloc (p, -1); | ^~~~~~~~~~~~~~~ tst-realloc.c:134:12: error: pointer 'p' may be used after 'realloc' [-Werror=use-after-free] 134 | if (c[i] != 0xff) | ~^~~ tst-realloc.c:124:7: note: call to 'realloc' here 124 | c = realloc (p, -1); | ^~~~~~~~~~~~~~~ tst-realloc.c:134:12: error: pointer 'p' may be used after 'realloc' [-Werror=use-after-free] 134 | if (c[i] != 0xff) | ~^~~ tst-realloc.c:124:7: note: call to 'realloc' here 124 | c = realloc (p, -1); | ^~~~~~~~~~~~~~~ tst-realloc.c:134:12: error: pointer 'p' may be used after 'realloc' [-Werror=use-after-free] 134 | if (c[i] != 0xff) | ~^~~ tst-realloc.c:124:7: note: call to 'realloc' here 124 | c = realloc (p, -1); | ^~~~~~~~~~~~~~~ tst-realloc.c:134:12: error: pointer 'p' may be used after 'realloc' [-Werror=use-after-free] 134 | if (c[i] != 0xff) | ~^~~ tst-realloc.c:124:7: note: call to 'realloc' here 124 | c = realloc (p, -1); | ^~~~~~~~~~~~~~~ tst-realloc.c:134:12: error: pointer 'p' may be used after 'realloc' [-Werror=use-after-free] 134 | if (c[i] != 0xff) | ~^~~ tst-realloc.c:124:7: note: call to 'realloc' here 124 | c = realloc (p, -1); | ^~~~~~~~~~~~~~~ tst-realloc.c:134:12: error: pointer 'p' may be used after 'realloc' [-Werror=use-after-free] 134 | if (c[i] != 0xff) | ~^~~ tst-realloc.c:124:7: note: call to 'realloc' here 124 | c = realloc (p, -1); | ^~~~~~~~~~~~~~~ tst-realloc.c:134:12: error: pointer 'p' may be used after 'realloc' [-Werror=use-after-free] 134 | if (c[i] != 0xff) | ~^~~ tst-realloc.c:124:7: note: call to 'realloc' here 124 | c = realloc (p, -1); | ^~~~~~~~~~~~~~~ tst-realloc.c:134:12: error: pointer 'p' may be used after 'realloc' [-Werror=use-after-free] 134 | if (c[i] != 0xff) | ~^~~ tst-realloc.c:124:7: note: call to 'realloc' here 124 | c = realloc (p, -1); | ^~~~~~~~~~~~~~~ tst-realloc.c:134:12: error: pointer 'p' may be used after 'realloc' [-Werror=use-after-free] 134 | if (c[i] != 0xff) | ~^~~ tst-realloc.c:124:7: note: call to 'realloc' here 124 | c = realloc (p, -1); | ^~~~~~~~~~~~~~~ tst-realloc.c:134:12: error: pointer 'p' may be used after 'realloc' [-Werror=use-after-free] 134 | if (c[i] != 0xff) | ~^~~ tst-realloc.c:124:7: note: call to 'realloc' here 124 | c = realloc (p, -1); | ^~~~~~~~~~~~~~~ tst-realloc.c:134:12: error: pointer 'p' may be used after 'realloc' [-Werror=use-after-free] 134 | if (c[i] != 0xff) | ~^~~ tst-realloc.c:124:7: note: call to 'realloc' here 124 | c = realloc (p, -1); | ^~~~~~~~~~~~~~~ tst-realloc.c:134:12: error: pointer 'p' may be used after 'realloc' [-Werror=use-after-free] 134 | if (c[i] != 0xff) | ~^~~ tst-realloc.c:124:7: note: call to 'realloc' here 124 | c = realloc (p, -1); | ^~~~~~~~~~~~~~~ tst-realloc.c:134:12: error: pointer 'p' may be used after 'realloc' [-Werror=use-after-free] 134 | if (c[i] != 0xff) | ~^~~ tst-realloc.c:124:7: note: call to 'realloc' here 124 | c = realloc (p, -1); | ^~~~~~~~~~~~~~~ -- Joseph S. Myers joseph@codesourcery.com