Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp414341rdb; Tue, 23 Jan 2024 03:50:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IGeDB82i+e4AYPLmZzwtg3ZeF2FJOJFjCOpucnK2M2vn83sz37jIbYsqz+neiQw15qDzObK X-Received: by 2002:a05:6358:e9c3:b0:175:51c2:47fc with SMTP id hc3-20020a056358e9c300b0017551c247fcmr4505771rwb.29.1706010642171; Tue, 23 Jan 2024 03:50:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706010642; cv=pass; d=google.com; s=arc-20160816; b=DaaMAMoPrsde+eC8NtOBGsQ2Nci1vdi9S/szupEAYEE/4UzsSDH/Fs0iRS28cGqJ8u /+kFRExDANJ1w7/Lqg6WXmoFLla+70D0QHHK52sht2gU5t7ftUoeFaD92umvfK2wBUo5 8fGS8GkWikCsy1eMUwYekVsQm3mJOHrdCrS2MatVUtgWoh3F3SHZoWeE3YZv6FxjOh4n p4GAzn9+4rUUVS0sRrBM/R8qh5td7/1aZX2gq3h7IQRZAwLxIaYYTr5Vxp5wKY/pKTQo qV4j3WEFcg5Jn4vkoNaWv+bbVb+qEYGRYiQ3HoDgbA+OqPVDPXw4hbzdnJJznaq2SVN2 AlLA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=date:message-id:user-agent:cc:to:references:in-reply-to:from :subject:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:dkim-signature; bh=2qa4e6uCbJSz818GkMCHhAtRppDBHZiuAnH1WP/TFMc=; fh=Jm7BJ5tUwhZElct2I4ROBYH+m5Q0EVoRsb42yBMUCDY=; b=V/s7mWhS2fW/60QCE554bOziar7ocR5PFdaf0ObI2AgHKE4F2HVxTXhSaixa6dEOa3 fjztMkqWggwApLlVgj+AFxPfVtahulwrjj80jn6lRNzo8bNxK4/8p9EyGTRmS1lCiGxz K+YDsvi4Qz7dcvuN38jWEaLZ5x8ZW5Hc0Y7tf1qsV7s82/BtdGQWukW0oqr5btqtGU/W u+bp8aXFHl07fZ27F0JoP1tumbyNfhkTFMWM3wPRN24MUImvst+4L+F5315+7fE3MBEL MaAUiA12Q1g8H03zcrU86wWiQZoHqViIHRjrtIsX3HIh7bqbx/DcOAulNwghYwoSd1bW +uuQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cZgXUmTm; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-2378-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-2378-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id ka33-20020a056a0093a100b006dd82ed2c1csi214993pfb.84.2024.01.23.03.50.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 03:50:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-2378-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cZgXUmTm; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-2378-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-2378-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 51EF5283C19 for ; Tue, 23 Jan 2024 11:50:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 63CB45D8EB; Tue, 23 Jan 2024 11:50:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="cZgXUmTm" X-Original-To: linux-wireless@vger.kernel.org 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 39C845DF01; Tue, 23 Jan 2024 11:50:36 +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=1706010637; cv=none; b=sbvEnfZ7aFfuVajXz1kWjBbXU9CS2yZLjZnTm3ywOcctffEUnJqM9htP1AkzCLAhqkYZNToq2Z17bgZjIisthvqBRFZ7FlAIj35rchNI2/3Ht/eaeJL76zj/uvU+lFXf+NeePemHT7aucDNaS/5Nwy08+r3Ca3Awk2anvKqfpRw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706010637; c=relaxed/simple; bh=uSTO8tH5YxpcnUPEXZwGy9prSprH8Zu1Qe34MWqhmyY=; h=Content-Type:MIME-Version:Subject:From:In-Reply-To:References:To: Cc:Message-ID:Date; b=e6wevvrxQXnuGxnUiSz9sputvWp6fbd2v+m37y1d1sX0AgQuBjGKvaCd8GvVoAJhnta4RSNcHJFsrxHaCXbhAVtKwkgXQgXdGrnvfOq1oU9d2oytsIbP+InAf+uPr69yqpwM0ESpjDyBx1QvgmfbSuh+8VcKsaXUSRIhPt1pawE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=cZgXUmTm; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3FE4AC433C7; Tue, 23 Jan 2024 11:50:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706010636; bh=uSTO8tH5YxpcnUPEXZwGy9prSprH8Zu1Qe34MWqhmyY=; h=Subject:From:In-Reply-To:References:To:Cc:Date:From; b=cZgXUmTmwr71LfYbg/xyAdSCYpFflWAb9FF9yaqxLkHGt+txt3QMj0ZAPQQ4VO8Vl ppCBCvi8PgdTjeo67hXb0USc/Y/1RhWieCaoce5/aQZzSZO/t9hP+EpEw2DncoSk37 gDJYhys/PqHbJ5kUfnc04U4t84GPXl0lZAPxvT4AtoAWMyPbnjekAf+JeQFfEcvnLT RbBp2gWc1VV0vneDDnXG4fVMDub1tIDGR9FgodUgaf569MFrKQ3XYHaPueqEDiwcQL 2s5yxB1YpGoq/G/hM9JPvCyv9+lhi69CAgCDg03V7ZiofHt6b4tcaU6ZC7qr8F7jYa lJDfYW3nstsVg== Content-Type: text/plain; charset="utf-8" Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [PATCH 41/82] wil6210: Refactor intentional wrap-around test From: Kalle Valo In-Reply-To: <20240123002814.1396804-41-keescook@chromium.org> References: <20240123002814.1396804-41-keescook@chromium.org> To: Kees Cook Cc: linux-hardening@vger.kernel.org, Kees Cook , Johannes Berg , Max Chen , Yang Shen , linux-wireless@vger.kernel.org, "Gustavo A. R. Silva" , Bill Wendling , Justin Stitt , linux-kernel@vger.kernel.org User-Agent: pwcli/0.1.1-git (https://github.com/kvalo/pwcli/) Python/3.11.2 Message-ID: <170601063238.3962299.12030024839048269322.kvalo@kernel.org> Date: Tue, 23 Jan 2024 11:50:34 +0000 (UTC) Kees Cook wrote: > In an effort to separate intentional arithmetic wrap-around from > unexpected wrap-around, we need to refactor places that depend on this > kind of math. One of the most common code patterns of this is: > > VAR + value < VAR > > Notably, this is considered "undefined behavior" for signed and pointer > types, which the kernel works around by using the -fno-strict-overflow > option in the build[1] (which used to just be -fwrapv). Regardless, we > want to get the kernel source to the position where we can meaningfully > instrument arithmetic wrap-around conditions and catch them when they > are unexpected, regardless of whether they are signed[2], unsigned[3], > or pointer[4] types. > > Refactor open-coded wrap-around addition test to use add_would_overflow(). > This paves the way to enabling the wrap-around sanitizers in the future. > > Link: https://git.kernel.org/linus/68df3755e383e6fecf2354a67b08f92f18536594 [1] > Link: https://github.com/KSPP/linux/issues/26 [2] > Link: https://github.com/KSPP/linux/issues/27 [3] > Link: https://github.com/KSPP/linux/issues/344 [4] > Cc: Kalle Valo > Cc: Johannes Berg > Cc: Max Chen > Cc: Yang Shen > Cc: linux-wireless@vger.kernel.org > Signed-off-by: Kees Cook > Acked-by: Kalle Valo If you can edit before commit please add "wifi:" prefix to the wireless patches: ERROR: 'wifi:' prefix missing: '[PATCH 41/82] wil6210: Refactor intentional wrap-around test' ERROR: 'wifi:' prefix missing: '[PATCH 62/82] mwifiex: pcie: Refactor intentional wrap-around test' 2 patches set to Not Applicable. 13526631 [41/82] wil6210: Refactor intentional wrap-around test 13526632 [62/82] mwifiex: pcie: Refactor intentional wrap-around test -- https://patchwork.kernel.org/project/linux-wireless/patch/20240123002814.1396804-41-keescook@chromium.org/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches