From nobody Sun May 19 05:09:56 2024 X-Original-To: dev-commits-src-all@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 4Vhpfj1fFRz5Kldr; Sun, 19 May 2024 05:10:05 +0000 (UTC) (envelope-from joerg@bec.de) Received: from mail.bec.de (mail.bec.de [163.172.4.16]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 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 4Vhpfh6ZS2z4bRd; Sun, 19 May 2024 05:10:04 +0000 (UTC) (envelope-from joerg@bec.de) Authentication-Results: mx1.freebsd.org; none From: =?ISO-8859-1?Q?J=F6rg?= Sonnenberger DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bec.de; s=mail; t=1716095397; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oFlPLDWldszaklAXAFgHXS1Dn6qjJZ7CCGuQyU91xw8=; b=Glmd1NagSyNsuvDm0YqWxCvSEuQ1k8w801ChkwYh1BPAc0IQlzmI7/1fiq9wFHLwxVVrqU EnxjlnBz1Udbi2QQG66hz+yNSey1EfygLR8ofpF6fsxT3lTimYnBw9HYYK2l9gsL84gCoR LigGLhyon1StvHw2e/v2MfmOt2p1NaL01EiLqQldsRjIxbmyOIDsKxAioMZV3kVwj+cmLr Y+wdodbHvOuAAXmIUyISG6xuMxhdvDPhGd07ePMQK+1VXx6xCMV8U5fWXLgFSWKZuWga2T UxJH4zNzs0TcGQDWsJjdl30vHllii3bmr6evsx5dKC5zx21vqubO3u1hzm9pfg== To: Kyle Evans , dev-commits-src-all@freebsd.org Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" , Pedro Giffuni Subject: Re: git: be04fec42638 - main - Import _FORTIFY_SOURCE implementation from NetBSD Date: Sun, 19 May 2024 07:09:56 +0200 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> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="nextPart26428586.1r3eYUQgxm" Content-Transfer-Encoding: 7Bit 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:12876, ipnet:163.172.0.0/16, country:FR] X-Rspamd-Queue-Id: 4Vhpfh6ZS2z4bRd 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"

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=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

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 che= cking alternatives and that turns out to be annoying when debugging.


Since the wrapper functions are always_inline, they are pretty much invi= sible to debuggers.


Joerg

--nextPart26428586.1r3eYUQgxm--