From nobody Sun May 19 14:10:49 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vj2fm4hF1z5K5xn for ; Sun, 19 May 2024 14:10:56 +0000 (UTC) (envelope-from pfg@freebsd.org) Received: from sonic314-20.consmr.mail.ne1.yahoo.com (sonic314-20.consmr.mail.ne1.yahoo.com [66.163.189.146]) (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) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vj2fl6WKwz4MSj for ; Sun, 19 May 2024 14:10:55 +0000 (UTC) (envelope-from pfg@freebsd.org) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1716127854; bh=7cj1Qyg+MPiT1VT9LMj372JWEYPpASuRVi5/YNcY8FA=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From:Subject:Reply-To; b=NNv7eAN/42eHsMoHZtGNmHU+OO7h5dn5C/nCBMezPXYrx/6d5jIFfHGh/vbtQ34IvJxhEEF1OQGCUj6cGqyk2kRGD1wyHx6lJDc9VduQMiRYBUeLwxIEfKdskg8j6YvdPtTPs6dGY84geMr4H29spdDl517XGb4GwxKJ2F1F7ye13Xp5GSAFYpdwTKHDDcp+WrrcFJXUkF8s+J1zIu2/3b8y8Mp2X4kM3cw0EIVTYjOTI8rUVEptxByEYdKdx8o5AsRc9xA+awXIlMBn03bMS7idlc1tHxfgF/mUA5r04D9oVpvnqas3SbmQMbJQ0fOc1rYbbqmV4XmdwHeRH7yQmw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1716127854; bh=yZ2B/w+fUf86P/+bQY7jekejNKia68iX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2V_f5.4X2.HGjwGe3F.DT15Sw54enxUXikZHIL_MZxnVmzSNcE9m 6RqNae9ONfXM5jUPe0mTf2TwNUyX.LsdOz.VoTpkcFN3UsXejuZamVFx3OowF7pLNKFBDEv2l3xZ YfanlulrZQXwqWPWJGScwu14WMdDgQ0tFtDWb7a48_BKwPktYZQcCA0isWvsN.pTeG3EKbq9UoKa m4mcWnnhm3pPMSTojE0FeaaA2NNDbEyiMuj8O2hZ87ePse4yNeF0OTCTaitFmM8qwKM9iO1GHDIn t60Jbu1VN46MgeRoBQ1D1eLiU6x7G81UQUMbGi3qZOrH8rtjU4.pf9P0REIWgKpfrhDjm8zrsolc MLmqbK1lZEyuu86oZdlcn8giJ8xxdwIPg091K6zUNCYWYNK3H_3uxqRhAUV3OUQA.4TMfLYDDB3m fXotR_PMLsmWX_POQ8Oc3WzTwyjypKULmRCw5TJsaGQOSlPCvGMsOUQ-- X-Sonic-MF: X-Sonic-ID: a5b606b5-fc51-4c37-ac01-414bbac8b011 Received: from sonic.gate.mail.ne1.yahoo.com by sonic314.consmr.mail.ne1.yahoo.com with HTTP; Sun, 19 May 2024 14:10:54 +0000 Date: Sun, 19 May 2024 14:10:49 +0000 (UTC) From: Pedro Giffuni To: Kyle Evans , "dev-commits-src-all@freebsd.org" , =?UTF-8?Q?J=C3=B6rg_Sonnenberger?= Cc: "src-committers@freebsd.org" , "dev-commits-src-main@freebsd.org" Message-ID: <625859379.1707787.1716127849819@mail.yahoo.com> In-Reply-To: <4888579.OV4Wx5bFTl@britannica.bec.de> References: <02326b5e-a1fe-4411-a869-d21f9a76130c@email.android.com> <6276b721-6c7b-41cd-9d1b-4169e86ec5e9@FreeBSD.org> <1413980952.1357400.1716093599901@mail.yahoo.com> <4888579.OV4Wx5bFTl@britannica.bec.de> Subject: Re: Re: git: be04fec42638 - main - Import _FORTIFY_SOURCE implementation from NetBSD List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1707786_1868843335.1716127849818" X-Mailer: WebService/1.1.22356 YMailNorrin X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:36646, ipnet:66.163.184.0/21, country:US] X-Rspamd-Queue-Id: 4Vj2fl6WKwz4MSj ------=_Part_1707786_1868843335.1716127849818 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable For the record ... When I was working on this, the default compiler on FreeBSD was still GCC 4= .2 and the static checks worked fine with it but not on clang. The runtime = checks worked fine on both. Pedro. On Sunday, May 19, 2024 at 12:11:15 AM GMT-5, J=C3=B6rg Sonnenberger wrote: =20 =20 =20 On Sunday, May 19, 2024 6:39:59=E2=80=AFAM GMT+2 Pedro Giffuni wrote: >=C2=A0 FWIW .. and let me be clear I haven't worked on this in ages and I = am not planning to retake this either... > clang just couldn't do the static=C2=A0 fortify_source checks=C2=A0 due t= o the way llvm uses an intermediate representation; the size just couldn't = be handled in the preprocessor. That hasn't been true for a long time. __builtin_object_size is only folded in the frontend if it absolutely has to because the context requires an Integer Constant Expression, otherwise it is folded only if the answer is definite. In all other cases it is left for the IR passes = to lower. > fortify_source does replace some key libc functions with memory checking = alternatives and that turns out to be annoying when debugging. Since the wrapper functions are always_inline, they are pretty much invisib= le to debuggers. Joerg =20 ------=_Part_1707786_1868843335.1716127849818 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
For the record ...

When I was working on this, the default compiler on FreeBSD was = still GCC 4.2 and the static checks worked fine with it but not on clang. T= he runtime checks worked fine on both.

Pedro.
<= br>
=20
=20
On Sunday, May 19, 2024 at 12:11:15 AM GMT-5, J=C3= =B6rg Sonnenberger <joerg@bec.de> wrote:


=20 =20
=20

On Sunday, May 19, 2024 6:39:59=E2=80=AFAM GMT+2 Pedro Giffuni wrote:

>= ;  FWIW .. and let me be clear I haven't worked on this in ages and I = am not planning to retake this either...

>= ; clang just couldn't do the static  fortify_source checks  due t= o the way llvm uses an intermediate representation; the size just couldn't = be handled in the preprocessor.


That hasn't been true for a long time. __builtin_object_size is only

fol= ded in the frontend if it absolutely has to because the context

req= uires an Integer Constant Expression, otherwise it is folded only

if = the answer is definite. In all other cases it is left for the IR passes to<= /p>

low= er.


> fortify_source does replace some key libc functions with memory check= ing alternatives and that turns out to be annoying when debugging.


Since the wrapper functions are always_inline, they are pretty much invisi= ble to debuggers.


Joerg

------=_Part_1707786_1868843335.1716127849818--