From nobody Thu Jun 12 03:22:02 2025 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 4bHnrm3hfyz5y0Bw for ; Thu, 12 Jun 2025 03:22:16 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) (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-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bHnrm0v8qz3ttZ for ; Thu, 12 Jun 2025 03:22:16 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-234b9dfb842so5399235ad.1 for ; Wed, 11 Jun 2025 20:22:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1749698534; x=1750303334; darn=freebsd.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=7CEJYqHcq0j8xwhF0EQNwbZHX7W74nFlTtNAgWF/PBU=; b=CMHqwDbOqKJXF6DglAXQkdmYBD4AK9sTIEt9wdwFUzaMDwY9hGdLX68unsfSDZKH2S Cd2PDNxZocXGfZQQy/w1U5stx+y0/FZDEDGkqZ5iwf88NHPhf7HrUoGshFhQbRxEBCZN k2kkqFTuxeWMGavEUEKck/m07uVvm2BAyOf4gRSVNRnl9fZjguf9IW/NSIvIzZqa28E4 fXgpkGwfPrVmoZQKMNDihJs2aL5qvu2xsF2krK6qHngsklaOtnCg7Rp+/4kqbmCZd85K jztGiD5VEC2MRDwaA6IG241QNXHLOgwsWIiEJcmgEL2eXvyw+jqBi1bSgTGyA9W6S1Um vqpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749698534; x=1750303334; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7CEJYqHcq0j8xwhF0EQNwbZHX7W74nFlTtNAgWF/PBU=; b=mfAnQTPLJlG5SPsWceKZuTabiAKLjnipJPeJQWS959Vo6oKqeJ+dAa31mjgw4gvjfO UIBGHMKXB6uXAruIDChGSQN9hVzNXVhAEyAsU6A0Der1sErC2eA0QSKRb8b5bDQvHZK2 tJE4lTyeMFy4x9nwNyVe5G02ZgPyWy9Ou1agf9963xUshH4YNaA5Q51glXbw9KFYZdCs 4Okmg8/kVjZQU/tPzr1ns4GTc0DAc13tl8obhABnldAFCS3ravThr5iW+kluW8ALq4Aq FYowocE7HLS0HCwnHq67QsA0aUvQv8DdJ/A/EqKqHQx3eBLTqb1T2l7vqFu5XcHvR7wB cDjg== X-Forwarded-Encrypted: i=1; AJvYcCXv9/3JTQJ3lGSk/9KXf4YwyFlvaJXOXmPLNsuuS0nOogvqhYYm8QVT2xtlTpPcMimDbv4+WlmNiCVCRGFE6YN9V3LJ@freebsd.org X-Gm-Message-State: AOJu0Yw8i/JpljNRjKYMNrp9tqZCxGqAH86gr1rN01IuJaExoRACDuPl bEhe4JpLayfJpj8vbqpVVHKn78GVBP5r6luojuxoGBenYDW1P1W14Z3VhmzUbdQSmkvr1S2QcDu 9SSRilApqvPA/DaqIAKCkvj5qGKTK1Fehlf4AWUj+ew== X-Gm-Gg: ASbGncuzGSpZexroqRJ9zkZzf05KbKoTSZ1E2BJEE+rNYfblYkSqRHRdr/HcsCcQFkY Zc7EcgwSNxtxPasg4//CK0I/ifSSEAiiUjPUC37uVKXmGPmpYgY8tVJdfQBRxQvVEHNN3ysKaUE dkwR61h2PUho1r9IlFHpVv5GJt/6Nvy9JErlwK0/AwYPpqh7ZA4IcuyQ== X-Google-Smtp-Source: AGHT+IFE0L3hhsC6lMmRejCfBKHNdiXuv/nT5a2g7g4XvMp6V1s0dwMWRczaDok3il16tLt0yP4agNm3/IivYU30OgQ= X-Received: by 2002:a17:903:288:b0:234:f182:a735 with SMTP id d9443c01a7336-2364d8c01f0mr22990255ad.34.1749698533777; Wed, 11 Jun 2025 20:22:13 -0700 (PDT) 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 References: <202506112316.55BNGeGh046207@gitrepo.freebsd.org> <86507548-1B8C-4CD1-BB18-C884D38EA489@freebsd.org> In-Reply-To: From: Warner Losh Date: Wed, 11 Jun 2025 23:22:02 -0400 X-Gm-Features: AX0GCFtENSsExUTdb8oikCRLeravyKvadW4m7FGcZ3ui-ihxo_jBYLbf4c8YUGc Message-ID: Subject: Re: git: 3d12567133bf - main - Add the POSIX sig2str(3) & str2sig(3) calls To: Shawn Webb Cc: Jessica Clarke , Warner Losh , Ricardo Branco , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4bHnrm0v8qz3ttZ 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:15169, ipnet:2607:f8b0::/32, country:US] commit d8b51259caee09a4080e524ac254e1f5aecc46cc (HEAD -> main) Author: Warner Losh Date: Wed Jun 11 21:14:16 2025 -0600 ssp: Protect sig2str with proper visibility markers We only define SIG2STR_MAX with careful visibility, but define the fortified version unconditionally. It needs to have the same visibility both places. Fixes: 3d12567133bf Reviewed by: jrtc27, kevans Sponsored by: Netflix diff --git a/include/ssp/signal.h b/include/ssp/signal.h index 9f1a926b9db6..fb1da0db90d1 100644 --- a/include/ssp/signal.h +++ b/include/ssp/signal.h @@ -35,6 +35,7 @@ __BEGIN_DECLS +#if __POSIX_VISIBLE >=3D 202405 || __BSD_VISIBLE __ssp_redirect_raw_impl(int, sig2str, sig2str, (int signum, char *__restrict str)) { @@ -43,6 +44,7 @@ __ssp_redirect_raw_impl(int, sig2str, sig2str, return (__ssp_real(sig2str)(signum, str)); } +#endif __END_DECLS should fix it. I'm testing a build before pushing... does that work for yo= u? Warner Warner On Wed, Jun 11, 2025 at 11:14=E2=80=AFPM Shawn Webb wrote: > > On Thu, Jun 12, 2025 at 04:05:05AM +0100, Jessica Clarke wrote: > > On 12 Jun 2025, at 03:59, Warner Losh wrote: > > > > > > On Wed, Jun 11, 2025 at 10:56=E2=80=AFPM Shawn Webb wrote: > > >> > > >> On Wed, Jun 11, 2025 at 11:16:40PM +0000, Warner Losh wrote: > > >>> The branch main has been updated by imp: > > >>> > > >>> URL: https://cgit.FreeBSD.org/src/commit/?id=3D3d12567133bfb4082a51= 15f16a71a865ff2af7fb > > >>> > > >>> commit 3d12567133bfb4082a5115f16a71a865ff2af7fb > > >>> Author: Ricardo Branco > > >>> AuthorDate: 2025-05-10 20:56:03 +0000 > > >>> Commit: Warner Losh > > >>> CommitDate: 2025-06-11 23:16:22 +0000 > > >>> > > >>> Add the POSIX sig2str(3) & str2sig(3) calls > > >>> > > >>> Signed-off-by: Ricardo Branco > > >>> Reviewed by: imp, kib, des, jilles > > >>> Pull Request: https://github.com/freebsd/freebsd-src/pull/1696 > > >>> --- > > >>> include/signal.h | 9 ++++ > > >>> lib/libc/gen/Makefile.inc | 3 ++ > > >>> lib/libc/gen/Symbol.map | 2 + > > >>> lib/libc/gen/psignal.3 | 56 ++++++++++++++++++++++- > > >>> lib/libc/gen/sig2str.c | 112 +++++++++++++++++++++++++++++++++++= +++++++++++ > > >>> 5 files changed, 180 insertions(+), 2 deletions(-) > > >>> > > >>> diff --git a/include/signal.h b/include/signal.h > > >>> index c1d341f317f4..22fefb63568f 100644 > > >>> --- a/include/signal.h > > >>> +++ b/include/signal.h > > >>> @@ -40,6 +40,10 @@ > > >>> #include > > >>> #endif > > >>> > > >>> +#if __POSIX_VISIBLE >=3D 202405 || __BSD_VISIBLE > > >>> +#define SIG2STR_MAX 32 /* size of buffer required for sig2st= r() */ > > >>> +#endif > > >> > > >> Hey Warner and Ricardo, > > >> > > >> The above breaks building world when _FORTIFY_SOURCE=3D2. I've commi= tted > > >> in HardenedBSD a fix: > > >> https://git.hardenedbsd.org/hardenedbsd/HardenedBSD/-/commit/0572db2= 82c5a542fe0de52739932e91eade537ed > > >> > > >> I suppose that the !defined gate might not actually be desired, sinc= e > > >> doing it the way I did might cause issues if third-party code define= s > > >> the macro to a value smaller than what libc was built with. I might > > >> remove that gate. > > > > > > I don't think we need the !defined part of it... > > > > > > But what software is breaking? What's the error message? Maybe the > > > fact it's undefined is pointing at a different bug=E2=80=A6 > > > > Probably include/ssp/signal.h unconditionally defining the wrapper? > > Presumably gating that with the same condition as sig2str itself would > > fix things properly rather than such bogus hacks. > > > > But yes, including the actual error message when reporting a build > > failure would have been helpful. > > I apologize. I indeed should have included the error message. It's > included below. > > =3D=3D=3D=3D BEGIN LOG =3D=3D=3D=3D > =3D=3D=3D> lib/liblua (all) > cc -target x86_64-unknown-freebsd15.0 --sysroot=3D/usr/obj/usr/src/amd64.= amd64/tmp -B/usr/obj/usr/src/amd64.amd64/tmp/usr/bin -O2 -pipe -fno-common= -DHARDENEDBSD -I/usr/src/lib/liblua -I/usr/src/lib/liblua/modules -I/usr/s= rc/contrib/lua/src -DLUA_PROGNAME=3D"\"\"" -g -gz=3Dzlib -mretpoline -fPI= C -flto -fzero-call-used-regs=3Dused -MD -MF.depend.lapi.o -MTlapi.o -std= =3Dgnu17 -Wno-format-zero-length -fstack-protector-strong -D_FORTIFY_SOURCE= =3D2 -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno= -pointer-sign -Wdate-time -Wno-empty-body -Wno-string-plus-int -Wno-unused-= const-variable -Wno-error=3Dunused-but-set-parameter -Wno-error=3Dcast-func= tion-type-mismatch -Wno-tautological-compare -Wno-unused-value -Wno-parenth= eses-equality -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-t= ypedef -Wno-address-of-packed-member -Wno-switch -Wno-switch-enum -Wno-knr-= promoted-parameter -Qunused-arguments -c /usr/src/contrib/lua/src/lapi= .c -o lapi.o > In file included from /usr/src/contrib/lua/src/lapi.c:19: > In file included from /usr/src/contrib/lua/src/lapi.h:12: > In file included from /usr/src/contrib/lua/src/lstate.h:130: > In file included from /usr/obj/usr/src/amd64.amd64/tmp/usr/include/signal= .h:76: > /usr/obj/usr/src/amd64.amd64/tmp/usr/include/ssp/signal.h:41:23: error: u= se of undeclared identifier 'SIG2STR_MAX' > 41 | if (__ssp_bos(str) < SIG2STR_MAX) > | ^ > 1 error generated. > *** Error code 1 > > Stop. > make[5]: stopped making "all" in /usr/src/lib/liblua > =3D=3D=3D=3D END LOG =3D=3D=3D=3D > > -- > Shawn Webb > Cofounder / Security Engineer > HardenedBSD > > Signal Username: shawn_webb.74 > Tor-ified Signal: +1 303-901-1600 / shawn_webb_opsec.50 > https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/0= 3A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc