Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp1272106lqd; Thu, 25 Apr 2024 10:19:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXubD6MW7Q0yHhtICEEUdcbLbn0c7dgne9NKBdPZUEmhjsga9zh30GlgdWm+VHAdZ0+MPK/RBzATF6HVcxR6cWOqh6Vc06SFrRJIYaN9w== X-Google-Smtp-Source: AGHT+IEQipBJpGpCSTwUiR3yLjncNFP40v+U87hg9NTkqfc0e54b1VEcmpICPWJWUcVY3N2D12VL X-Received: by 2002:a50:d74e:0:b0:572:2f0d:f4cb with SMTP id i14-20020a50d74e000000b005722f0df4cbmr211340edj.1.1714065589998; Thu, 25 Apr 2024 10:19:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714065589; cv=pass; d=google.com; s=arc-20160816; b=aC9rQdU+qttC8f8ApSdX4FvvU/KcpigKldZHfhxjtWWDEJEHXMAV4o7LZGt6GaBzMs ZQX/aPcaRG6BiMqigF4ZZrb6uJeZ3Ug5P6TLXDym0k6q2Oh29eQJ+nkmGlfcrHn7GtSH 8uws8P7/gdyXE563UbQFEM6SgVmCOls95/bTfJoln2W+22WwvDKNR+ccorg7/2FF51YD XuW3TyCsvswrgnIQx7kXB+auKdIeVpx9ZFtuucEqacVUBTFMGV/d00Jlz1KtayvNzYag OBSv4kE69Y8O2fCxdglsKUeCJx5tCVYL+g5fcyNESNDLLJg4mBq1UJO/iGkDZ+jn4uLk sxYQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=aEArpaPdCkeLMM8e+oCYdabZOyUvDXBNvCNCU3D6sx8=; fh=UQA5YJdBcqXkqMoJejaOqmTo6XAhlhAvKjrSweB0Rh8=; b=m8OQMkXUd7Brmp+z0lBmA6Uh2FN6BYGB5kbXfw7PgpsQ8k6ANP66AYrpKMVRMQYyhv SgnXLqGr5A23U7GwnnKS4BF8+DoLwZ7uJf6cNc+nKsE7PfgwreoSU9LuaUC9dlELN4/v bZEWS3S3pAuhwB1fYx0ofEChkMeZzOOPtp7seqwUqKyPcaU6r511qhD38/FZKYtgNC8M QXp4KLAhzdiMG0FSUA/rxlT33Zz+l35kRiIw016xgQpQZ2z5v3YSxzci3+TanOg0i/vE wYAc9OVFBk+iKsYBVcFrqCBlIbwzN+ErFR3KvbfjBCPpoWZS9pL9wN8af+I7DJ9pDoL8 MXMA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=bUhsoazE; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-158969-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-158969-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id g18-20020aa7d1d2000000b0056c05c5ff27si9403884edp.206.2024.04.25.10.19.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 10:19:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-158969-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=@chromium.org header.s=google header.b=bUhsoazE; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-158969-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-158969-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.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 B84131F22575 for ; Thu, 25 Apr 2024 17:19:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D4E0F14EC76; Thu, 25 Apr 2024 17:19:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="bUhsoazE" Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D18901E864 for ; Thu, 25 Apr 2024 17:19:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714065567; cv=none; b=P6J5wbKBX1QRmJuODoGkfBk5LC/GzttGgMMGOhg0KnaxXob1wZc5YXi6e7ef+d5rlg4AOBvVi2Gcb25yjeIOns5mafuWUSqIVmE/Bw+NHxCAw7k+GgPRvhAbcqzYGK3akOufD/955vJ60JzHJnOfrLZsuVNdH5XOSP9381SECdg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714065567; c=relaxed/simple; bh=47qf1VJfN1htPuzwcBHn7Dk8utfEzpjninPu15D1DHo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=kW4hebDIVT1l85ImSItoFRvqf2Ghqp+/Z8svAb0hT4ZLiBXqZPmMK/HQE8q/l4cuxBRMMGc+k4Z5mjMAjRpNbP/9TlpJtVT5bsOxewDLHqGacue8BH4aHzK2ur+3+QDtRYR27n4Y5bkEwSt6MiuMT95xwg7OIYDNalxtGpdRfXQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=bUhsoazE; arc=none smtp.client-ip=209.85.210.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-6e46dcd8feaso661155b3a.2 for ; Thu, 25 Apr 2024 10:19:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714065565; x=1714670365; darn=vger.kernel.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=aEArpaPdCkeLMM8e+oCYdabZOyUvDXBNvCNCU3D6sx8=; b=bUhsoazEiKVsAiQqTGzXYanKMj8Pzq27+Zql8Qk9Qqme1aSDIVMMwmgYh2aPydQizn AV5AHN02njPVBwXTqrzFkC2cWU/XmgTZaoMCHDV5drBzA0NZOxv/Xs7I/CXYRjktLV1g TT5g9O0I0JuLSa4mUeRACWnJoMNveeifZgPBU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714065565; x=1714670365; 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=aEArpaPdCkeLMM8e+oCYdabZOyUvDXBNvCNCU3D6sx8=; b=Bxht+85rlNoV7sPsTeS95QIMWd6rEg9Jac9EsbqaOJ8BqVDwWb1J+doGiv3iR9Cqj1 t298MKSLMIhaiOjKjmnty0Di+uGa+VPY+9WAiJF7GyGO1ySRkS8u1dKsCzo5nCaM++NT 3cHNSwP9VL8U4Zd2tWgODHCKaisxmBDSMSOi61tAFNZLLSgit22ThZ4N65a+SgQ15T8g M1h0qqkpi6YSYvnaGxj446S8p3XYA3chWdGpjmkqF/e25Eq7hlvI9hpPN3l0/5wgkEUY dsuJqCG5GUtHu1VnJXPoLNGXGSLWQMZbdKr3xlJwVkugOVVcCAyyySNuFcj8exgjXBqY 2c8w== X-Forwarded-Encrypted: i=1; AJvYcCVrfyMS7odp61d6UF5a06A2BNwW+rt6MqNgQue9D6l4U8LA+LJDRfG1TvsTvzA1MaxdQ/VwMobk2fKbCiJRfZ+D4fgbT7qgwjsV0g60 X-Gm-Message-State: AOJu0YzHSBDuqcvVew50J4CblVMi78gMFiNta5xaWs3jqOUJIXUhKOWM 81rvYzLlIhgSwSuUn1ENr0ID/CKAuDvU6o5dFkJsQHMi70ECG1J+i0Het4cyyw== X-Received: by 2002:a05:6a00:1941:b0:6ea:f05d:d2e9 with SMTP id s1-20020a056a00194100b006eaf05dd2e9mr507849pfk.15.1714065565180; Thu, 25 Apr 2024 10:19:25 -0700 (PDT) Received: from www.outflux.net ([198.0.35.241]) by smtp.gmail.com with ESMTPSA id n56-20020a056a000d7800b006e6b7124b33sm13379389pfv.209.2024.04.25.10.19.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 10:19:24 -0700 (PDT) Date: Thu, 25 Apr 2024 10:19:24 -0700 From: Kees Cook To: Mark Rutland Cc: Peter Zijlstra , Will Deacon , Boqun Feng , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Jakub Kicinski , Catalin Marinas , Arnd Bergmann , Andrew Morton , "David S. Miller" , David Ahern , Eric Dumazet , Paolo Abeni , "Paul E. McKenney" , Uros Bizjak , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org, netdev@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH 1/4] locking/atomic/x86: Silence intentional wrapping addition Message-ID: <202404251018.C12E9F23@keescook> References: <20240424191225.work.780-kees@kernel.org> <20240424191740.3088894-1-keescook@chromium.org> <20240424224141.GX40213@noisy.programming.kicks-ass.net> <202404241542.6AFC3042C1@keescook> 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=us-ascii Content-Disposition: inline In-Reply-To: On Thu, Apr 25, 2024 at 11:15:17AM +0100, Mark Rutland wrote: > To be clear, I dislike the function annotation because then it applies to > *everything* within the function, which is overly broad and the intent becomes > unclear. That makes it painful to refactor the code (since e.g. if we want to > add another operation to the function which *should not* wrap, that gets > silenced too). Yeah, I find that a convincing argument for larger functions, but it seemed to me that for these 1-line implementations it was okay. But regardless, yup, no function-level annotation here. > I'm happy with something that applies to specific types/variables or specific > operations (which is what these patches do). Thanks! -- Kees Cook