From nobody Mon May 13 18:57:26 2024 X-Original-To: freebsd-hackers@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 4VdTJ86Ds4z5KmtV for ; Mon, 13 May 2024 18:57:28 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) (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 "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VdTJ84823z4bXD for ; Mon, 13 May 2024 18:57:28 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Authentication-Results: mx1.freebsd.org; none Received: by mail-io1-xd33.google.com with SMTP id ca18e2360f4ac-7e1d924b0b0so82585139f.1 for ; Mon, 13 May 2024 11:57:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; t=1715626647; x=1716231447; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=n8vu5eXVbU32m2Rt3vEhIBgGc/G6o8sUBCV7DkFZN2Q=; b=eYVA2VQ3S8rOu7jotxTxxTLBfzArR7mprZ+G2+yuBaDfs6tHLZzxYXonpr331ANl9a Vs/yIVthDYtFu0sftUXj23UBUdQDApDj/H9G0twVcf77+G+oTu/2pi2xC0W8pNJrZdNp cpX2SB05lP/Dln2H8P2ETblOp2cuvfP2Vqefw41mVGtR/c7c2X/KSod0DK8jdvs2SfYX qkSL0N6Gi9ho/tlnGSUQ6iQNrOXZDBP/XBAGbTWSZNsT5P2N6P8eEkCvvgX0fNwNLpck 1XCY9zeiBep72yq/p9iPvfVELzL0gJ7a3TZuRrzXyn76zvlFL7cMyFR+HQzFDGO/+YJE yI0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715626647; x=1716231447; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=n8vu5eXVbU32m2Rt3vEhIBgGc/G6o8sUBCV7DkFZN2Q=; b=ZeKvbVfKfo3FThHORyci44RIMqbRTEMIUwezUEf0UZgubd8fzJJ9XTVQex/S1QWDti t9pj/3gHrlGpdp1hShBspRwiLYS4SSZ1f+e+SpkZpyItTCj7MnMvYosGs1D+daRqPzyq 0Rrvjxq96b23BqJxwl/CI366ayTCm4a0lKfPyUFvd5AxTE7EXBCE7XZoSMBzu7MPpX9x A5zRioQGONk0teystMGdtJoH1W4/T9P1/uXrODpmOe2+APpJ0ma3VUWzGxqkvpZUuJVO LeVJihmqHN5bz+M3a12SR0WkZMzqaCXAWmIoTbjVWuC/myZmuU13I5JtX8XS0gStjr5U 8/RA== X-Forwarded-Encrypted: i=1; AJvYcCUz0hcTBqa5GXwRav6Iou8z8ci6TJv+DTG9Xl24bpt/6n4WpNDwC0BHCgra5ze5/2rEoyLfD3Z3HgXa2Zobv6TrgHEAkUrrTSug86g= X-Gm-Message-State: AOJu0YxgZwJ/+QGLp/PRBTvpaGVWfdDdpn9FDlnNd850IogJO2Db3JYo qE8dsT5WYGwitVTrWQARsi8Pk1KGyIsjmQpmdoF0WuLzyzFw2kF8Eh2G2Cr+14FMBaiRlEdF3mm h X-Google-Smtp-Source: AGHT+IG+Qc7j361JvObbOe5V3jTFy42kj+2BUsCMMjsoNMHPkzaJlcbcuk2tM9YxjYN8WEZ+JvDJEA== X-Received: by 2002:a05:6602:14d:b0:7de:a980:f210 with SMTP id ca18e2360f4ac-7e1b51aaa9amr1091585639f.3.1715626647670; Mon, 13 May 2024 11:57:27 -0700 (PDT) Received: from mutt-hbsd ([184.99.37.29]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4893700e215sm2637951173.12.2024.05.13.11.57.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 11:57:26 -0700 (PDT) Date: Mon, 13 May 2024 18:57:26 +0000 From: Shawn Webb To: Cy Schubert Cc: Kyle Evans , "freebsd-hackers@FreeBSD.org" Subject: Re: Initial implementation of _FORTIFY_SOURCE Message-ID: X-Operating-System: FreeBSD mutt-hbsd 15.0-CURRENT-HBSD FreeBSD 15.0-CURRENT-HBSD X-PGP-Key: https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/blob/master/Shawn_Webb/03A4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc References: <20240513180924.29C872B4@slippy.cwsent.com> List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="nmt567hh7ns2zacp" Content-Disposition: inline In-Reply-To: <20240513180924.29C872B4@slippy.cwsent.com> 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] X-Rspamd-Queue-Id: 4VdTJ84823z4bXD --nmt567hh7ns2zacp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 13, 2024 at 11:09:24AM -0700, Cy Schubert wrote: > In message , Kyle Evans= =20 > write > s: > > Hi, > > > > As of 9bfd3b407 ("Add a build knob for _FORTIFY_SOURCE"), I've imported= =20 > > an initial version of FORTIFY_SOURCE from FreeBSD. FORTIFY_SOURCE is a= n=20 > > improvement over classical SSP, doing compiler-aided checking of stack= =20 > > object sizes to detect more fine-grained stack overflow without relying= =20 > > on the randomized stack canary just past the stack frame. > > > > This implementation is not yet complete, but we've done a review of=20 > > useful functions and syscalls to add checked variants of and intend to= =20 > > complete the implementation over the next month or so. > > > > Please test _FORTIFY_SOURCE out now by setting FORTIFY_SOURCE=3D2 in th= e=20 > > buildworld env -- I intend to flip the default to 2 when WITH_SSP is se= t=20 > > in the next month if nobody complains about serious breakage. I've=20 > > personally been rolling with FORTIFY_SOURCE=3D2 for the last three year= s=20 > > that this has been sitting in a local branch, so I don't really=20 > > anticipate any super-fundamental breakage. >=20 > Should this trigger a __FreeBSD_version bump? I would encourage that so to help the ports tree determine availability of the import. Additionally, I've enabled _FORTIFY_SOURCE in HardenedBSD base[1] and ports[2]. For base, it's only set (and to 2 by default) when MK_SSP is set to yes. In ports, it's set by default except for ports that have "kmod" in their USES. Are there any plans to support _FORTIFY_SOURCE in the kernel? [1]: https://git.hardenedbsd.org/hardenedbsd/HardenedBSD/-/commit/927fd28755da27= c5dd2b1b0d0396c93db585f933 [2]: https://git.hardenedbsd.org/hardenedbsd/ports/-/commit/3d7dcd284ce3083103ed= d6b28b3d232abbfeaa63 Thanks, --=20 Shawn Webb Cofounder / Security Engineer HardenedBSD Tor-ified Signal: +1 303-901-1600 / shawn_webb_opsec.50 https://git.hardenedbsd.org/hardenedbsd/pubkeys/-/raw/master/Shawn_Webb/03A= 4CBEBB82EA5A67D9F3853FF2E67A277F8E1FA.pub.asc --nmt567hh7ns2zacp Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEA6TL67gupaZ9nzhT/y5nonf44foFAmZCYo8ACgkQ/y5nonf4 4foM+A/9EleLWXUn6ckmHS1ujmx3Xpyc6ikwQ+42vyF4iOuYVXDvmH1bCQ9y3ZaN NkGT3ngGF8zcnoCPF9/DRK4BYE6ZnkMFokoz5pMvPGgD/xd1PIIv3cmpGTE67Lqy a3qLzX4N0jNwsPQuv5jzzWvTEDCEb5VpzVjiNRJfAtOf1FnzwEvB5plK9KwuQ89x U7mjtF/AFaZ3wJ/FTq2exv4HADEbv48wjDLk+M9UMQtBZOd4cBZquZKTtfxeboQD jPNzyMO3pdWCfBz6fbCMNbXMlo+/+LCUXu2YRuc4BbQQmFitKCP4iXD4xUrGGcba 0oV4xe3aW7l1DzEgQVHW5BOQTNm1hc68ynol27SQLQppKZJXe8SSxMlNZE52sQJw BpDN/DC5dcAnxKDwBvLYr5TQaZETjS+AoohaYgPS2z1ocUtaZZKbbhZYtGf3yAeF yoJtgJVOhhTqzE8QhTdtBx61RN1syNL5geDTo1U1F02kQb5H2+DVdvb/bxnm2kJi 7pxfm8/U5gV73aT1XTzGIYSnqrNbzRVkSvMYqgvWrhGb2SYNFPBa9fazouBOPvqa epwapkvkH/KWStOfc2gfxqx1vLcElj7Jg3oxG9Rv4hCYZMEZnXSJztNXiS3gxQxu CygJbBVpXyGBQvUJpVmDioqv+JD2lllWi426P6RNvBbk5Yl4Ujc= =mYBY -----END PGP SIGNATURE----- --nmt567hh7ns2zacp--