From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by sourceware.org (Postfix) with ESMTPS id 0AFB4385828E for ; Fri, 17 Feb 2023 22:58:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0AFB4385828E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-x42e.google.com with SMTP id e10so2522667wrg.4 for ; Fri, 17 Feb 2023 14:58:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=cOM7ahRBuf8KUffTrz7Y84RlNrBmaRxijz8epR1OkZ0=; b=pdUNHfM/rSuIBdr0r6TiuyQYGRk0AVRUUdOUouqb9JStLefgNlElLtdvYm0LKSk0sb JVbW8K26MIYkBeJl8zeaGOyV76QTKTahNzrXhtDZqe33fX/wmoBZQ6pkbQh7BnaM95KL cgFJUr+mTfC9uJzq+5YshyftV97LKXpkX6EIzcbT/6WK8ZQjg6N3QtUC6R+deiPyRbIh lSvsZ/f8ksOT9N6PtR+ktD3j37qyrHrZ991OyhA9mSDIzpKKA5cJy0/GCjTCWyiLYT/5 Z/mz3jJpYkEPNJIeaREmEcRE/jXwOXfQbpVN+d1zCgYYzoTWlsZjFCNKdzPyAMxmOePW SGTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=cOM7ahRBuf8KUffTrz7Y84RlNrBmaRxijz8epR1OkZ0=; b=pUv05Q816FRezxujtMrpFaALYDSJl2Grk3tInfE2rVH62vnjap8u83OyHFOtHPs2qI JvEaIqWYBaLnZYb8miRYeXcnym28EtVJCIjdYNnHbjV4BtbHjhKfhBNYf12LekLI3jql bazEceU+R0zoN8Rlh/An9msnYyrZYxd/qOVmdTyjRBtJAoepwlFVHOFk8Pxn7QKw0jgU zJazW5nndbhcJvnvoMDmUU2e1Q5Z5kUEVwHQSFIAAYaZQpbjnNN/KDxu5b9vfSFcRH+8 WPjpbNsb/tr2/1oPnRgcITsIjNEYMlZkXsLa0AAt9QL+BUwJCKIRLhVjRTfrRPXP08Jz 8Ltg== X-Gm-Message-State: AO0yUKXsXgRXTJGgEaQI9XJ8EdAa69ALgppGa3zgkoomJROM0BBhHI6Y hw9aYP5Zr2iqQIylNQ+IKas= X-Google-Smtp-Source: AK7set97FFkvuqCyffkUQRQa2drwYL6w6vfTgzWrxFk2srS4kN4pR2/nLIKioyYSmIZPLs9/OCtCXg== X-Received: by 2002:a5d:4c51:0:b0:2c3:db9e:4b06 with SMTP id n17-20020a5d4c51000000b002c3db9e4b06mr691967wrt.45.1676674697520; Fri, 17 Feb 2023 14:58:17 -0800 (PST) Received: from [192.168.0.160] ([170.253.36.171]) by smtp.gmail.com with ESMTPSA id r10-20020a5d694a000000b002c5539171d1sm5237785wrw.41.2023.02.17.14.58.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 17 Feb 2023 14:58:16 -0800 (PST) Message-ID: Date: Fri, 17 Feb 2023 23:58:07 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH] Make -Wuse-after-free=3 the default one in -Wall To: Siddhesh Poyarekar , gcc@gcc.gnu.org Cc: Alejandro Colomar , Andreas Schwab , David Malcolm , Florian Weimer , Iker Pedrosa , Jens Gustedt , Jonathan Wakely , Mark Wielaard , Martin Uecker , Michael Kerrisk , Paul Eggert , Sam James , Yann Droneaud References: <20230217212044.5178-1-alx@kernel.org> <193404c7-20ac-7ba3-e010-f8921721fdb8@gotplt.org> Content-Language: en-US From: Alejandro Colomar In-Reply-To: <193404c7-20ac-7ba3-e010-f8921721fdb8@gotplt.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------BJLqaDKXPmhh9L46vjo5k5dJ" X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------BJLqaDKXPmhh9L46vjo5k5dJ Content-Type: multipart/mixed; boundary="------------ytk7ZgCscnA1rZ0M03zUWR0i"; protected-headers="v1" From: Alejandro Colomar To: Siddhesh Poyarekar , gcc@gcc.gnu.org Cc: Alejandro Colomar , Andreas Schwab , David Malcolm , Florian Weimer , Iker Pedrosa , Jens Gustedt , Jonathan Wakely , Mark Wielaard , Martin Uecker , Michael Kerrisk , Paul Eggert , Sam James , Yann Droneaud Message-ID: Subject: Re: [PATCH] Make -Wuse-after-free=3 the default one in -Wall References: <20230217212044.5178-1-alx@kernel.org> <193404c7-20ac-7ba3-e010-f8921721fdb8@gotplt.org> In-Reply-To: <193404c7-20ac-7ba3-e010-f8921721fdb8@gotplt.org> --------------ytk7ZgCscnA1rZ0M03zUWR0i Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Siddhesh, On 2/17/23 22:39, Siddhesh Poyarekar wrote: > On 2023-02-17 16:20, Alejandro Colomar wrote: >> Link: >> Link: >> Cc: Andreas Schwab >> Cc: David Malcolm >> Cc: Florian Weimer >> Cc: Iker Pedrosa >> Cc: Jens Gustedt >> Cc: Jonathan Wakely >> Cc: Mark Wielaard >> Cc: Martin Uecker >> Cc: Michael Kerrisk >> Cc: Paul Eggert >> Cc: Sam James >> Cc: Siddhesh Poyarekar >> Cc: Yann Droneaud >> Signed-off-by: Alejandro Colomar >> --- >> >> Hi Siddhesh, >> >> Here's a patch for it. It is untested yet. Please have a look at it.= >> I'm not used to GCC customs, so corrections are welcome :) >> >> Cheers, >> >> Alex >=20 > You've got the customs right as far as submission is concerned; gcc=20 > accepts patches under DCO. I'm not a maintainer though, so I can't=20 > approve the change, I can only comment on it in the hope of influencing= =20 > maintainers' opinions. :) > In any case it's probably suitable as a proposal=20 > for gcc 14, given that 13 is in stage 4, regression fixes only. Sure, 14 is good. >=20 > I'm split about where -Wuse-after-free=3D3 should be enabled. On the o= ne=20 > hand, I'd like it to go into -Wall and alongside _FORTIFY_SOURCE=3D3,=20 > given that the latter already breaks the incorrect provenance=20 > assumptions in such code patterns. However on the other hand, it may=20 > lead to annoyed developers, even though the usage is, strictly speaking= ,=20 > UB. I don't know about the false positive rate of -Wuse-after-free=3D3= =20 > either (specifically in the context of UB-ness of the code it warns=20 > about), maybe someone else may be able to chime in on that. >=20 > Maybe a good compromise here is -Wextra, but if there's consensus=20 > developing towards adding it to -Wall, I'll happily jump to that side. Since -Wall already had -Wuaf=3D2, and to not overcomplicate it, I put it= in -Wall too. Anyway, I don't expect it to have many false positives, but maybe someone else can chime in. Both are fine, IMO. I use -Wall -Wextra always together, so I wouldn't even notice :) >=20 > Thanks, > Sid On 2/17/23 22:41, Siddhesh Poyarekar wrote: > On 2023-02-17 16:39, Siddhesh Poyarekar wrote: >> You've got the customs right as far as submission is concerned; gcc=20 >=20 > Oh, one correction: patches typically go to gcc-patches at gcc dot gnu = > dot org. Okay, I'll take that note for next time. For this one, should I resend, or is it okay as is? Both are fine for me. Cheers, Alex --=20 GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5 --------------ytk7ZgCscnA1rZ0M03zUWR0i-- --------------BJLqaDKXPmhh9L46vjo5k5dJ Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE6jqH8KTroDDkXfJAnowa+77/2zIFAmPwBn8ACgkQnowa+77/ 2zLeRQ/9E3FjODkybjYyuRTaih2A8yGHa8sqRVp0pL+lExWr31wJ4VtHP98FDzcn bMEqzFQlNRFvXEFbXmBknho/NA7xgaPBflDTyraMmldys7btpug4uhr6fkRVG4GZ fvHXSaTQ8BJ/UdeeD+94mJ00igGq/I57rVfZU2dfuu5F/D0etUmyh5R8jZ9mxXZj DtiUfVNuYqlDeq4xD38laAWZDy7VXThQDf5yK9yraG3kO/4eavLcXsWAF8x36L6A MHk7xim0BofFiSaUKSc/pu3C4v+MqJnMJloKK5298HiZc/wWKSaaIT4epF07WCv1 WMeXjJXe7TN4VRwVLlySpUvfL+4akqqo54I5TPmEEytb7x+Mri8NZgW6/lSshYJv qJS0brTCdpd/zmoXXWo3hjXbROUoCkXHEi4Ptnz3xlLlAlwe0ok5SBOuFfjhslSz aXBEF8RZ647tm+LZK3drswL++kLe6PFs8fE6ARs57SyS9bA61OGoLI9kGRTrKzbb EuMmu7jsjzcN8aH3lbjeu5EkksW+yDlDJaIsmRORQDmL74vqWqlQZRfc7eBHP02G m924GT9CTMwa1pGLV15Iis0V9Lp2D3gdEQNhEMVaMcTbE6VwuU6rC7EFNjYj53X1 EPg8kYbxLjD80DpYzncDKeCbgI5RcANGULamVZEW02IsbC30mLE= =VZKw -----END PGP SIGNATURE----- --------------BJLqaDKXPmhh9L46vjo5k5dJ--