Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp114726lqo; Thu, 9 May 2024 14:31:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU0O3ZkAddAl+q9dx6fEqiFIKUTfO9MkPg2m778llikUu0pnieYIkzZgC6ERUHJABwDiCOItPVto3W/D/hkh4xYYigg0nBbTHf1zDvQGg== X-Google-Smtp-Source: AGHT+IEq18MdjBjls64hQIlp02tIXfiSpvLFCwKjhq8ACDGNb8GK6Kn0rcuZyH50z1Oe5fr2b6v6 X-Received: by 2002:a17:90a:b796:b0:2b1:dd0e:e20 with SMTP id 98e67ed59e1d1-2b6ccb7e5f8mr787810a91.38.1715290263290; Thu, 09 May 2024 14:31:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715290263; cv=pass; d=google.com; s=arc-20160816; b=O723yp8HjCTCLJ0Z8RnfuoFaSJFgxSK6VGiEgUugKhOJx3tx1/dYvbaA9mk2kvwEXu XLLJNKEIMKm/hbzF8yOH+4nJepwKldUUWtEDlN5MBT6QuDbbYAnuGIxXgK+5qIVeduDx iJSfKoPtP28SxlJzqjwGeEC1JoPhN0/+dJ4TrUfhvoZQcUQD7zMZfZfKPiglbMlno6Yg XvRyLEqn+E9jIdzJp5zDeh4mqSoG7Co7RPBBR/074XM2Bx+mwIQAEwmfT50RpNxipB5V x8LwR8sTx7x816kcEDctiddxpS0W9O0kZ1J5kXw7r9AUgJEqJ+hnV93qMmzoMroT87oh 764g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:accept-language :in-reply-to:references:message-id:date:thread-index:thread-topic :subject:cc:to:from; bh=SEFpFTBcxfnU5YKbgVM3TPjMbGxapd0haMRAIoOJewg=; fh=EfwF85fLNjiUu+tr3GrTR7TSzHQ1nJnHuct4uIaqXB8=; b=SDMhONnIYUf2CQhL/KLi1TjmRlV7sQznr45b5/kkJcGgKVQzCegx3PXfTOvO/YnxNE 9lTo5CLYI6xiqUMAAFV66btipapluRyrcDd5kSQKGPgrAhOKz0e8D6K2Pvw+H/cBkvsI 7oGN/WfqVS6zoUM+nyqpKA2VY2NaMHPB143nLl2Y2FCiVHsKNynt7H50bZUod1g+9UR9 3ZnvYS1vLuqZPpRQlUZKFQ0ICAQAmXEnNNNOE42uUPGXun7Lntxdb6CEeW3T569iXUHN wHOgWvmcD65mdqryEfB5xi7XZTbYbWQARO7k7goqGpwCACSXAgA/tf92F8dcycb/8Kzp GtOA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=aculab.com dmarc=pass fromdomain=aculab.com); spf=pass (google.com: domain of linux-kernel+bounces-174989-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174989-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2b6290d19fasi4262650a91.184.2024.05.09.14.31.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 14:31:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-174989-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; arc=pass (i=1 spf=pass spfdomain=aculab.com dmarc=pass fromdomain=aculab.com); spf=pass (google.com: domain of linux-kernel+bounces-174989-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174989-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com 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 1B325287113 for ; Thu, 9 May 2024 21:24:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AB0B38595F; Thu, 9 May 2024 21:24:02 +0000 (UTC) Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.85.151]) (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 9950380632 for ; Thu, 9 May 2024 21:24:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.58.85.151 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715289842; cv=none; b=kiPy/07Cc65kyMBMbwOSE5DrpxEh5zq03/Q94Jhgga4KGVVzbjTgizCoHtguusZ5kYZfCvkaKyVUzCYlD3mmQ6xiEwxbvMBB8Ldd0dcb7TdkyvU4uAuLfxnEEQQjJybvl6Ou5choL9cWpn8QRHUxoTShHdh0kel2GOqumdzcX68= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715289842; c=relaxed/simple; bh=SEFpFTBcxfnU5YKbgVM3TPjMbGxapd0haMRAIoOJewg=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: MIME-Version:Content-Type; b=QjCTnxQEQ150bS+d1uoaiPo991ULIhWRNWS/B/l0SvMrwEQx5oUmKXq1hlZfphnWYUqFvfN3Bl8/5muMBX1EVe/7aARz/rITeWd1j/kZPzLLScXFPQ99Qk8PPUPHOjDndPOmBK983H22Ku0rwol9/S3/x35Z9lRoHyX/5cBfia4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ACULAB.COM; spf=pass smtp.mailfrom=aculab.com; arc=none smtp.client-ip=185.58.85.151 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ACULAB.COM Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aculab.com Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with both STARTTLS and AUTH (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-262-ZHxZcEbrMxKlg_Jm_e8yvA-1; Thu, 09 May 2024 22:23:57 +0100 X-MC-Unique: ZHxZcEbrMxKlg_Jm_e8yvA-1 Received: from AcuMS.Aculab.com (10.202.163.4) by AcuMS.aculab.com (10.202.163.4) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Thu, 9 May 2024 22:23:29 +0100 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Thu, 9 May 2024 22:23:29 +0100 From: David Laight To: 'Linus Torvalds' , Kees Cook CC: Justin Stitt , Peter Zijlstra , Mark Rutland , "linux-hardening@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "llvm@lists.linux.dev" Subject: RE: [RFC] Mitigating unexpected arithmetic overflow Thread-Topic: [RFC] Mitigating unexpected arithmetic overflow Thread-Index: AQHaoaITK91jQ1nmYEmzGISNIfAGlrGPZyIw Date: Thu, 9 May 2024 21:23:29 +0000 Message-ID: References: <202404291502.612E0A10@keescook> <202405081144.D5FCC44A@keescook> <202405081354.B0A8194B3C@keescook> In-Reply-To: Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content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