Date: Sun, 19 May 2024 07:09:56 +0200 From: =?ISO-8859-1?Q?J=F6rg?= Sonnenberger <joerg@bec.de> To: Kyle Evans <kevans@freebsd.org>, dev-commits-src-all@freebsd.org Cc: "src-committers@freebsd.org" <src-committers@freebsd.org>, "dev-commits-src-all@freebsd.org" <dev-commits-src-all@freebsd.org>, "dev-commits-src-main@freebsd.org" <dev-commits-src-main@freebsd.org>, Pedro Giffuni <pfg@freebsd.org> Subject: Re: git: be04fec42638 - main - Import _FORTIFY_SOURCE implementation from NetBSD Message-ID: <4888579.OV4Wx5bFTl@britannica.bec.de> In-Reply-To: <1413980952.1357400.1716093599901@mail.yahoo.com> References: <02326b5e-a1fe-4411-a869-d21f9a76130c@email.android.com> <6276b721-6c7b-41cd-9d1b-4169e86ec5e9@FreeBSD.org> <1413980952.1357400.1716093599901@mail.yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. --nextPart26428586.1r3eYUQgxm Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 no= t planning to retake this either... > clang just couldn't do the static fortify_source checks due to 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 --nextPart26428586.1r3eYUQgxm Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="utf-8" <html> <head> <meta http-equiv=3D"content-type" content=3D"text/html; charset=3DUTF-8"> </head> <body><p style=3D"margin-top:0;margin-bottom:0;margin-left:0;margin-right:0= ;">On Sunday, May 19, 2024 6:39:59=E2=80=AFAM GMT+2 Pedro Giffuni wrote:</p> <p style=3D"margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">>= ; FWIW .. and let me be clear I haven't worked on this in ages and I = am not planning to retake this either...</p> <p style=3D"margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">>= ; 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.</p> <br /><p style=3D"margin-top:0;margin-bottom:0;margin-left:0;margin-right:0= ;">That hasn't been true for a long time. __builtin_object_size is only</p> <p style=3D"margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">fol= ded in the frontend if it absolutely has to because the context</p> <p style=3D"margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">req= uires an Integer Constant Expression, otherwise it is folded only</p> <p style=3D"margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">if = the answer is definite. In all other cases it is left for the IR passes to<= /p> <p style=3D"margin-top:0;margin-bottom:0;margin-left:0;margin-right:0;">low= er.</p> <br /><p style=3D"margin-top:0;margin-bottom:0;margin-left:0;margin-right:0= ;">> fortify_source does replace some key libc functions with memory che= cking alternatives and that turns out to be annoying when debugging.</p> <br /><p style=3D"margin-top:0;margin-bottom:0;margin-left:0;margin-right:0= ;">Since the wrapper functions are always_inline, they are pretty much invi= sible to debuggers.</p> <br /><p style=3D"margin-top:0;margin-bottom:0;margin-left:0;margin-right:0= ;">Joerg</p> </body> </html> --nextPart26428586.1r3eYUQgxm--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4888579.OV4Wx5bFTl>