Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp226199rdb; Mon, 22 Jan 2024 18:51:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IErX+LzG/IIkthwtzPSY/Z30uJ6o+1zpfhbLg6hK6ZF/zCoNDk8qZmaSo7Zwrtiuhty+2qJ X-Received: by 2002:a05:600c:1d27:b0:40e:4f46:d100 with SMTP id l39-20020a05600c1d2700b0040e4f46d100mr88910wms.101.1705978319450; Mon, 22 Jan 2024 18:51:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705978319; cv=pass; d=google.com; s=arc-20160816; b=asM+8pQHrOo2QLf/p/OsmBnd8GV9Iv0SgxMZnFmO3iCiTK8mPCghHlBbiqdk2h88vA g6qk+TJS4TwLUYFFBU5UUyTWHX5D48zIMw8DvV9WY/OgOQMNcrci9RLMIDrgeSyaLCKe Z7HimIhhJkPRpVC7ThtgCwySAMA7VFVlE8cxTxF5ShmP2f8UgilwsiAkIyigChRDhgDl Ue1YrwSB2hhqmHb//f86tuzbbSLiVpj1k6nwEOpVxnZDS0kPIBHG954S2ePCJZxhiPxT 4SMbejXMkFFvtkfysM69I52FRWHSBHpzeDVmF2EvQCszPiSJVeUln6wa3ZkpTtpvZ4AH JLUA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:references:in-reply-to :user-agent:subject:cc:to:from:date:dkim-signature; bh=wCFAGCdjL92EtlxtfRHKDG0JhlIQGFfhuL4KcJbBF7s=; fh=xyVmWQcZw+V2SYWt2x9q9R7ouBk1MV/SEx7oH7PT7as=; b=Yzm8aoR97FERWCaqRBCZmopiT+1OBaSpVrPEH3wiYWZIU4sbvlv3vxInpJCPMKWlqX CNXp/dqaKINIGySXvGz8k17fUb0AcujDVE6zJuUraZnZSLO7ha40EiFDiEPr8TJJJ9iZ salB0UvpDG1abGvkNFYMYzpgctv7EUTpppJCdPk8OT/w+6BT1bWPG9UMHpWYXagSBL9/ 7/4dWJNGMLcE7P8i/dDlAZFb7jhiLT+OyEV4e1OhdqbS6amItE/OU3DIwo2zOMqcZjZ+ e365YsSvFqm0wgAt0FVDtGi5Si5ubUqCKS4smKm8Qzruy4DQ11A98Zqlu9OUMOGswgPQ YX/Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KZpqN2Yw; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-34651-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34651-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id y14-20020a170906448e00b00a2d5d8464d1si9393308ejo.998.2024.01.22.18.51.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 18:51:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-34651-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KZpqN2Yw; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-34651-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34651-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id AAFA31F26E72 for ; Tue, 23 Jan 2024 02:51:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3FA6220F1; Tue, 23 Jan 2024 02:51:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="KZpqN2Yw" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 631E91FBE; Tue, 23 Jan 2024 02:51:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705978291; cv=none; b=TDtkeqvEF3P0h3SrY3wQ4XoufE1v92mfMVXmOa58ybgqNkdJx97t45+ITNbFPiIS2L4la21Fr7l594q4C90UHca3V1SrElyQa2Qolrsh6DKrhYmEmm6KNDRWELoON6Nqa8xnsC6R3UpYQX/0UVaD0w9qYMupFFxvvAuprwt5X6o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705978291; c=relaxed/simple; bh=wCFAGCdjL92EtlxtfRHKDG0JhlIQGFfhuL4KcJbBF7s=; h=Date:From:To:CC:Subject:In-Reply-To:References:Message-ID: MIME-Version:Content-Type; b=iY1l22pP86MEfM1s4GbTE209ryTTSD16CLHmPsJcCI/Gq9tq0uI28txVCMLxtQhu+cUxKcRhxDFFXskNdWjyFNq/su7qLbfZ7/gJBChev/8UPx8kbdZuLtb6Jq71oOaENgLt40hE+8afoFN6CHrMAJM3wlU87GE29UKTAnzP+wI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KZpqN2Yw; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id DA0C8C43390; Tue, 23 Jan 2024 02:51:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705978291; bh=wCFAGCdjL92EtlxtfRHKDG0JhlIQGFfhuL4KcJbBF7s=; h=Date:From:To:CC:Subject:In-Reply-To:References:From; b=KZpqN2YwaFhawn6OAzQ07gadVTQA7uH7DtXfJEgLrYrqobaOfXhUukReonuopvHEj EdyDuEvSoE29JvwcRnq7KvGeGhmVNu8idXygYTd3GFnhEnA3fN3fSbrpZixpnBoqoI AmWOqsZIunA7fj61+Y1cVW5GSaK+769XlLPthc1+GJXkn96hvG8Qv6fs/4BkYGdBQJ fD2Tstf84JVngzAZ4VpAl60/dChtoOjOWCRZi2rF9vTdQFWtppRJJNTVNn+Vq3zySY uwIFpkdBAXhZgWFLiSPR5gL3JM8LSZtQ/WPWsk0IU5GlMsf/LcQjwt3rvfTKoTsn9K JoLsS4VL5QWEw== Date: Mon, 22 Jan 2024 18:51:29 -0800 From: Kees Cook To: Kent Overstreet , Kees Cook CC: linux-hardening@vger.kernel.org, "Gustavo A. R. Silva" , Bill Wendling , Justin Stitt , linux-kernel@vger.kernel.org Subject: =?US-ASCII?Q?Re=3A_=5BPATCH_00/82=5D_overflow=3A_Refacto?= =?US-ASCII?Q?r_open-coded_arithmetic_wrap-around?= User-Agent: K-9 Mail for Android In-Reply-To: <337u2jcp3s2vrvotj4jppgpr7zas5fod6k3mhe263ghpux7s5x@knz6eibm2jis> References: <20240122235208.work.748-kees@kernel.org> <337u2jcp3s2vrvotj4jppgpr7zas5fod6k3mhe263ghpux7s5x@knz6eibm2jis> Message-ID: <4DE92BD2-50FE-4634-ACF3-E0CC735EDAEB@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On January 22, 2024 6:22:13 PM PST, Kent Overstreet wrote: >On Mon, Jan 22, 2024 at 04:26:35PM -0800, Kees Cook wrote: >> In our continuing effort to eliminate root causes of flaws in the kerne= l, >> this series is the start to providing a way to have sensible coverage >> for catching unexpected arithmetic wrap-around=2E >>=20 >This all seems fine, but=2E=2E=2E Rust already has this at the type syste= m >level=2E=2E=2E=2E > >I know you're not one of the people bringing bickering into the Rust >threads, so I'm wondering if perhaps your secret plan is to annoy the >die hard "I want everything to be fast with razor blades everywhere" C >programmers enough to finally get onboard the "let's just switch to a >language with less razor wire" train=2E I don't want to annoy anyone, but yeah, in the process of getting rid of d= angerous stuff we do end up asking people to make changes they're not used = to=2E I hope to make it as easy as possible, though=2E I'm a big fan of Rust, but I know it's not going to happen over night; the= re is a LOT of C code in Linux=2E :) I look at making the kernel safer by r= emoving as many C foot-guns as possible=2E As we remove the ambiguities in = C that lead to vulnerabilities, we'll eventually meet halfway with the new = Rust code=2E -Kees --=20 Kees Cook