Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp643302rdb; Tue, 23 Jan 2024 10:06:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IHNL+rfxCBq4zyL7x6xhs8VfAGedk1cXsgtSEuM9q6UME1aK/JMG9hhQfKJN/vF++dzpIxY X-Received: by 2002:a17:90b:216:b0:28e:72c5:ebfa with SMTP id fy22-20020a17090b021600b0028e72c5ebfamr2825054pjb.47.1706033205456; Tue, 23 Jan 2024 10:06:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706033205; cv=pass; d=google.com; s=arc-20160816; b=e0Cuuu/OTeXu/ygZZ+xfLoKy+FR6P3shOibly7zdlyZKBehy3Yco9Xxxq+4Bfzic8H MSq3OOsXQA81dOS8TvY/QHRYl5sEBZBIOLIu8vD8RG/fM2ZbQLIR7dnhQA3s91dz6qXe przBSeed09sqCu17T/FrGX4bFMxHsth16rpeTw0spulXhzWO2M/j05xkDXJ0ljfXlgpi HUXQ9A31yb79Yo2AI1up4OiNQASfrY9Ze3dcPmzPjr0/y7FehOaG5tesl2/z9K8+Wjl2 HSb5TqoegEjXsnzOOvzG7OxliWbDVGRwo40iBWsHa4xy7WYENNk26xVYPo0PIOW/+aSO lVjQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=sPOVFQl2tkZfe3QyiMSbVqeq8qtXQuoltOLEZXEAb4Y=; fh=ZUN0agJ1/5bEeK6s4pWPkMkxGTBtVOR/yf7EYmeNjKI=; b=tPjmImv8S/4ZQVqM1uQ37q3gkrKGukXri9M0TqTfw/XZkwQGoVZkBML67DHHZ3qj+B VHUHf2/emL3VFxLt23cifmvziJcBfxwZ/8BpGUvxZNjS5TXAJm5ddKIof6Z4ayUEag5o 1C71o1irKXB87wOFdMkKaIKrv0Hs8w/ymCXOdMK5N7/l4aZMH+ivS9hpR8sO56J+0NLu D/BHwxpHMznUnOhPv1Gxscq4+JHWk9G8DU311HmgArWn5XUd5eX2o6+UJfcRBYRGtMEB 2ex97xG5UFlq7U/rF3n+7cihPthX+dM/RbPeuYNqPOooPmLaFVBFZ8YJj0LMpepDUW7c BT8g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b="SXl8Q/ec"; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-35844-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35844-linux.lists.archive=gmail.com@vger.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 y14-20020a17090a600e00b002907debffa7si5386950pji.135.2024.01.23.10.06.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 10:06:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-35844-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=@linux-foundation.org header.s=google header.b="SXl8Q/ec"; arc=pass (i=1 spf=pass spfdomain=linuxfoundation.org dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-35844-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35844-linux.lists.archive=gmail.com@vger.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 B294A28630A for ; Tue, 23 Jan 2024 18:06:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C60EF81215; Tue, 23 Jan 2024 18:06:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="SXl8Q/ec" Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) (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 10F208120A for ; Tue, 23 Jan 2024 18:06:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706033194; cv=none; b=KXXBM8X/YdSzjcqeQAx8s8pyofBPjNrm9KxPfLZQGPmSHFGeBvDVp9EXRAQnTShK+9aLGaPPKWDfrfOYLRImb6CdlCC5nZYDQRCeEj0MoB3RBiubhZWK8tX7QpdyoIZbTI7GNjiVrVhkHlE4zhc2sKLnceVAqIq0nAiseoPH4/U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706033194; c=relaxed/simple; bh=DSKd2JcJ2/mza9EM+Xnm+jdVYiFpr3Vkuf4kEF/SCIw=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=fNBOifAECOqZCM5Fa0yWiDOn7eaNMIuDIliOX2oEftKK9khXPfvCYcGUSiXryopLIFLN9PwVhT+YiR6oaicDpoBjoO3lTqs+hNqO5247GwvvUnYLCPV3dUrR0OHtwhPvk8QqtMmKmxAu2FyTkkWVLIR2eE2zNkBHxMQ2cjFYWqg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org; spf=pass smtp.mailfrom=linuxfoundation.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=SXl8Q/ec; arc=none smtp.client-ip=209.85.208.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linuxfoundation.org Received: by mail-ed1-f51.google.com with SMTP id 4fb4d7f45d1cf-55a3a875f7fso5091673a12.3 for ; Tue, 23 Jan 2024 10:06:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; t=1706033191; x=1706637991; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=sPOVFQl2tkZfe3QyiMSbVqeq8qtXQuoltOLEZXEAb4Y=; b=SXl8Q/ecMZB/UMQysXz88PMxEHev6hL077NpL5gsMW0TCuAY6Qi4bOPVjKrRIksIgR x2PfsxlrYyrbtec2IZKHXirj/fN+YmY2ITshai5EaHMNKEezjye6HWUsAwvkgJ6KEQ1Y wkDBxgZphwqfTAI2QGvHisqkiDS+3EfNAzQp4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706033191; x=1706637991; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=sPOVFQl2tkZfe3QyiMSbVqeq8qtXQuoltOLEZXEAb4Y=; b=e97DUPTzNvWWPrvxVjDLyjwV6FVQMtWO+1qd6vzwZyf7iAd7dhPLYldu6q7GQznYFO QYPjEAkrYIaSmGJoFbwAhivLLCWx0vJdMsruCgjOLwvgcFKWe086n1ZOVkoeenQNGIap 2TiHs69qIB2D9OkDG0dxPuNseVx9zAvnitZ8Ueag1HkcPZ2k2qCzKItl0wzjPPSZxOII Uv9SxAm5IfsIVingyGRkZJcwNKYxfGqDGWHaC2sjHXdpBMNvBe7+h6E+i1dpMoRR+R6Y mPLM5BUxeBlnj8f46UCVGoBx2OxX4XYZdss4pWhvCdOqI/7pnLBasFqbRDUSCL3HYt+6 vyCQ== X-Gm-Message-State: AOJu0YzzqU31KgjEzSrPpoqHjj/PDfOUZjHJJXBhUE9PRxPRRbfYtO7T J60XYWvx5H8txSpM8hFgTgQfTOED95dnAoPOr106Xd+5z32DV4f/oObSlN+ifsD9QgnZIljE1B7 jOKPMlQ== X-Received: by 2002:aa7:dd44:0:b0:558:251b:3bd1 with SMTP id o4-20020aa7dd44000000b00558251b3bd1mr1078528edw.37.1706033191009; Tue, 23 Jan 2024 10:06:31 -0800 (PST) Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com. [209.85.128.42]) by smtp.gmail.com with ESMTPSA id x9-20020aa7cd89000000b00558e0481b2fsm14224968edv.47.2024.01.23.10.06.30 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 23 Jan 2024 10:06:30 -0800 (PST) Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-40ea5653f6bso43304865e9.3 for ; Tue, 23 Jan 2024 10:06:30 -0800 (PST) X-Received: by 2002:a05:600c:42cb:b0:40e:4ab9:70df with SMTP id j11-20020a05600c42cb00b0040e4ab970dfmr368030wme.245.1706033189635; Tue, 23 Jan 2024 10:06:29 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240122235208.work.748-kees@kernel.org> <20240123002814.1396804-34-keescook@chromium.org> <202401221713.3FCABC9290@keescook> In-Reply-To: <202401221713.3FCABC9290@keescook> From: Linus Torvalds Date: Tue, 23 Jan 2024 10:06:12 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 34/82] ipc: Refactor intentional wrap-around calculation To: Kees Cook Cc: linux-hardening@vger.kernel.org, Andrew Morton , "Liam R. Howlett" , Mark Brown , Mike Kravetz , Vasily Averin , Alexander Mikhalitsyn , "Gustavo A. R. Silva" , Bill Wendling , Justin Stitt , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" On Mon, 22 Jan 2024 at 17:38, Kees Cook wrote: > > I've tried to find the right balance between not enough details and too > much. I guess I got it wrong. My complaint isn't about the level of detail. My complaint is about how the commit log IS ACTIVELY MISLEADING GARBAGE and does not match the actual patch in any way, shape, or form. It talks about completely irrelevant issues that simply have nothing to do with it. It talks about undefined behavior and about a "unsigned wrap-around sanitizer[2]", which is nonsensical, since there is no undefined behavior to sanitize. It literally gives a link to a github "issue" for that claim, but when you follow the link, it's actually about *signed* overflow, which is something entirely different. And honestly, the patch itself is garbage. The code is fine. Any "sanitizer" that complains about that code is pure and utter shite. Really. If you actually have some real "detect unsigned wraparound" tool (NOTE: that is *NOT* undefined behavior, and that is *NOT* a "sanitizer", it's at most some helpful checker), then such a tool had better recognize the perfectly fine traditional idiom for this, which is to do the addition and check that the result is smaller. Like the code does. See what I'm saying? The patch is garbage. Any sanitizer that would complain about the old code is garbage. And the commit message is worse than garbage, it is actively misleading to the point that I'd call it lying, trying to confuse the issues by bringing up things that are utterly and entirely irrelevant to the patch. So: - get rid of that commit message that is lying garbage - fix the so-called "sanitizer". - stop calling the unsigned wrap-around a "sanitizer" and talking about "undefined behavior" in the same sentence, since it's neither. Do you really not see why I think that thing is actively *WRONG*? Linus