From nobody Sat Jan 25 19:09:14 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 4YgPPZ5mVfz5lmH5; Sat, 25 Jan 2025 19:09:38 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YgPPZ58cgz3Pg7; Sat, 25 Jan 2025 19:09:38 +0000 (UTC) (envelope-from netchild@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737832178; 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: in-reply-to:in-reply-to:references:references; bh=VdYxXwGRLdlTN9KjJtViEzZ49sVVEpkFy3O11IKzeHo=; b=w54Kg1t+qpL+90bdDqVBlsodStXx6gNY5CeOHT+2S4SG72Wal8Pk5u1EPZMFRwwo8KDl8p hcLaqKM8m03U7hVRBgbsMkxhhW1GSTe2SxQqsC44D8/Xlg4LyWck+0dK/J6d7+pP6yUH73 g7XA7o7V92iuVittbKVnTk6xPzATCP3Nnuru2etpN1KPxoC/G7KREXczwEmELboaZrvyMM v451X8WWkuYwcxrF7kBeiY6zd5b42WBX2Y5xgRHcfxrUWhRDnt7doTrGSribj7TcWotWN9 KRxBoSe37GsopQ26K6bPf6+O8FjsqI3sDX3ZQSp4s6ztQ99LzwSIQf5YVarYrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737832178; 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: in-reply-to:in-reply-to:references:references; bh=VdYxXwGRLdlTN9KjJtViEzZ49sVVEpkFy3O11IKzeHo=; b=O5mg/YOGQIe+bBQIdG6u6XSxvJuzrHG8fcfY1ZtpFU5+jj+OYKxbHCJvbAlpicgBJOUDBb fmON36jyoNgDgHK+t+zxFTcAugo7qhi6ycW8jG0hQBzWTolJzeI/Io3zQ5bMJU3kOacIgf hNtQYEHSFn6PXrVS9J+ht9oKLeZWLv6m3Bk0V/YYmvKu5o6c/6HucRGd+nVkvgF+zmV9wV ZiNfsbg3K8TTXMi0cjeWB+m0gKv4vF8rW7f1bEzTVozerlx6lr6ss6Bgtt5Lb+g5zvabRp WQJvNPzxC9EyjtvqpUmke5avUr8GcPePjo3NbVDjcfSVdNilNQ9qJ2WU/Ct/Gw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737832178; a=rsa-sha256; cv=none; b=TpUPwwznf2flBZxfiCZOUhWpiTAp4OOXGvN/naXRQAXkC/Rh8Lj5AE5q6ASJEpYEpxCDRy 60z3FOaEadJ6/VVjEs0f+lgI1EwowR2wMjkM+tu3cGrZU6OYcbZ0zaAb9CgJivAD/XAafd WAKllx5KtmqiGX1juNIInc5tG1NHVBlaPx9Z+XcH7FGl2d5KosKz5F+cQ7PE5tlC/NFwbJ qDkiUI9+uU/Y4jp2d54QaOxMhyylXlGfJnUOvt5g+T8oxWbL7/vtgw29STADOvx5Rtkvun FBEHESRc4mUb147VgqRF+0Sx/GTa2NujFXWJchFemqS8+vw9MAs5+BVgyjRR/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from outgoing.leidinger.net (p5b16583a.dip0.t-ipconnect.de [91.22.88.58]) (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-signature ECDSA (prime256v1) client-digest SHA256) (Client CN "outgoing.leidinger.net", Issuer "E5" (verified OK)) (Authenticated sender: netchild) by smtp.freebsd.org (Postfix) with ESMTPSA id 4YgPPZ2KDQzFHm; Sat, 25 Jan 2025 19:09:38 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from webmail.leidinger.net (roundcube.Leidinger.net [192.168.1.123]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: alexander@leidinger.net) by outgoing.leidinger.net (Postfix) with ESMTPSA id 84F383A0; Sat, 25 Jan 2025 20:09:32 +0100 (CET) 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 Date: Sat, 25 Jan 2025 20:09:14 +0100 From: Alexander Leidinger To: Jessica Clarke Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: f934e629dc22 - main - Add stack clash protection to the WITH_SSP flag In-Reply-To: <81A8E695-5034-4945-8D07-DF95E76904D0@freebsd.org> References: <202501251308.50PD8Qsg042260@gitrepo.freebsd.org> <81A8E695-5034-4945-8D07-DF95E76904D0@freebsd.org> Message-ID: <9fec6bfae287dfc123a359c3e1164ae2@FreeBSD.org> Organization: FreeBSD Content-Type: multipart/signed; protocol="application/pgp-signature"; boundary="=_dfebb1064ab7e7467e9facd0bf4792ce"; micalg=pgp-sha256 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --=_dfebb1064ab7e7467e9facd0bf4792ce Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8; format=flowed Am 2025-01-25 19:32, schrieb Jessica Clarke: > On 25 Jan 2025, at 13:08, Alexander Leidinger > wrote: >> >> The branch main has been updated by netchild: >> >> URL: >> https://cgit.FreeBSD.org/src/commit/?id=f934e629dc22b859efabd3cdebc23b63b04fa2bb >> >> commit f934e629dc22b859efabd3cdebc23b63b04fa2bb >> Author: Alexander Leidinger >> AuthorDate: 2025-01-25 12:43:39 +0000 >> Commit: Alexander Leidinger >> CommitDate: 2025-01-25 12:45:53 +0000 >> >> Add stack clash protection to the WITH_SSP flag >> >> Some background info availabe in: >> >> https://best.openssf.org/Compiler-Hardening-Guides/Compiler-Options-Hardening-Guide-for-C-and-C++.html >> >> https://developers.redhat.com/blog/2020/05/22/stack-clash-mitigation-in-gcc-part-3 >> https://blog.llvm.org/posts/2021-01-05-stack-clash-protection/ >> >> Reviewed by: emaste >> Differential Revision: https://reviews.freebsd.org/D48651 > > Uh, it does require architecture-specific compiler support, which isn’t > implemented for all architectures in LLVM at least. RISC-V has only > recently (as in 1.5 months ago so not even released yet) gained > support, for example. So this is just going to spew out > -Wunused-command-line-argument warnings, and errors with -Werror, no? The online docs for gcc (https://gcc.gnu.org/onlinedocs/gcc//Instrumentation-Options.html) tell this: ---snip--- Most targets do not fully support stack clash protection. However, on those targets -fstack-clash-protection will protect dynamic stack allocations. -fstack-clash-protection may also provide limited protection for static stack allocations if the target supports -fstack-check=specific. ---snip--- I read this as it should not spill such warnings. Additionally other options there are listed as limited to some architectures, but this one is not listed as such. The online docs of clang (https://clang.llvm.org/docs/ClangCommandLineReference.html) do not limit this option for some architectures while for other options (e.g. -fzero-call-used-regs) it tells about architecture limits. In a discussion on -current in November there was the opinion it may depend on run time support, as I've searched but I've read only that this option depends on stack guard pages in the kernel. I have not found info about any required run-time support in e.g. libc or such (like for -fstack-protector(-strong)). If those docs are missing listing limits for this option, we can off course enable this with a little bit of code in bsd.compiler.mk only for those architectures where we do not get such warnings. Bye, Alexander. -- http://www.Leidinger.net Alexander@Leidinger.net: PGP 0x8F31830F9F2772BF http://www.FreeBSD.org netchild@FreeBSD.org : PGP 0x8F31830F9F2772BF --=_dfebb1064ab7e7467e9facd0bf4792ce Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc; size=833 Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEER9UlYXp1PSd08nWXEg2wmwP42IYFAmeVNusACgkQEg2wmwP4 2Ib1Lg/+NG5tAoqBMw2gnKjEMAV7P9lIgTE4k7M0aK019rJykVPiqdGS9VZpUMWD geO6jpocQ5E2yiLzoRJyBmwHpIdiz4Ic+GTgHS9U2MqdPUa+JDh9owbM/1UHNBHD t9cGBXtcFjowP05iNJ7xnidH1ey0o99aVWvv0ymm4yCCu538EBW5Ra2ZA7Z1qEZd buSLxGE+A6UT+/lA6LGmkLLtZXwDm5IkWbr01JxrGCv19vh9QyNZ9zNj45TuPhcd xc0jtiUmNu0ReFw8oXklwcR5wVtcN7CUTzH4Ua+GuyGvmEHn6cM7fRBsHH8eNSqY kLZqit4iyt2sBA3zBGAhFNhhxIoRLuKG8oVf+1qbDyYe97tAPwPqiGyYaZ45gwvS CcTCy+jVzcyWawlJdiO5dvxzANRwKRAeMHLQJ2i+NtO0+qPx4M5mCYP4nm6zYYOE Qf1WcLeqZPXqx+F66ziKT9kUSm6vzZjIiKSIHkVdDfd+ZPebgEdAxO62Bc+vr6rb fWje0SAytOOQmDXxvKQRuCUBc0eSTThspNL+RisKYp/XHAuAK5ULO4eKoLC37ket Oi4ZfD+7FYEDe/+jK6xV5PN1PIUMsjPa8vU9zxhboHzXuAbpogFyv4STJdAF3ijG 1bFmT3YCirr8NG9K8kpqtxQuxjGLHGoScjw5zk5zQQFZpgjtOqo= =aYvF -----END PGP SIGNATURE----- --=_dfebb1064ab7e7467e9facd0bf4792ce--