From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) (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 D858914E2DF for ; Thu, 25 Apr 2024 17:19:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714065567; cv=none; b=NCW6e5gP/v9zAji972w+3g+Pty83zuutJp1Yq6hne8smqp6Ma4KYRfh8ZfR2XT8Pbk9yH6HMvIowpVCqaMNh5dXjgTpX798mwNP1OyaNKc4qxW3r7Q5SaMGAHlmZKLW+ltYcs5m//kmdkDyFY3AO0soKaoPzoLkVeIOXDapAadM= 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.176 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="bUhsoazE" Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-6ed3cafd766so1215930b3a.0 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=nQm6TJwfff/twBQ6wT4f73pkhuijE6x/oae4VaeKJ+OZsW/1S8LeIbz1cHGYI22Y7/ dwY1GVo1eUWrkpdymmHvYGDq1BwAl4ph14Z86w32oDZ08COFtYSMKMbxenVyuS897hda eo4vA5dalg3sc4fqv20K+ys5PEZR3g7QRF+MiN/lV5Rd9hRh6NdE+pGNvl9yAqOoWmMs im4DCTo6Zc6vwpvke2z4X1sUxRe5szfkTc1Dmt01KgXLrINR9DQPQrXrCGQ1A/p5txm+ Okwwg+hCbUm8LMThytCnJDqs8BcFiMUDUyMv9XkyRN3wup1b+huNWHKNHwXb2maifiWZ VZ5Q== X-Forwarded-Encrypted: i=1; AJvYcCVDx3WCYLwOeJ/bNdO+wwvK8aK8C9Pr0dmBpLVkW61AsJDq3uTmokfBoylbJ7iR/ch28mUtxtYjU746hgyxdiB1l7LHteI5 X-Gm-Message-State: AOJu0Yz14YxMDMkKQyMeX7oT6svr+Jw2oO8knx8N5eIbE5+CNdP7zXru qdw+9xOf6RWdKjvuLRgoz3CMtpm1u17K1paj3lPsKRFLgvwc84BJdGp8rLVH6g== X-Google-Smtp-Source: AGHT+IGSQtc03FJYmN67TcOlJEb4jjwUjOrO3E0QvJYydq58tzeFvCMVkx0opll0cr92togJ9vRyLg== 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: netdev@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