Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp1503316lqo; Sat, 18 May 2024 06:09:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX3zhLVbQDFsWVhLje2jQ5frZEBuF3E6tRRoeZhZw6Jy1DbzmY1cqzDdTpMO4o6uUD9HHW8N9VUh6uZBPvSO9djhdpGjuboVpO4DRLyTw== X-Google-Smtp-Source: AGHT+IEINgP0KihMHZozR4kebDohrbhHVGUSA9yHyiE3Y8PCEXPF8Rz5w+KMGBNHlsQ6GL1FXkbt X-Received: by 2002:a05:6214:3913:b0:69b:16d5:a8ac with SMTP id 6a1803df08f44-6a168152148mr321895646d6.4.1716037782507; Sat, 18 May 2024 06:09:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716037782; cv=pass; d=google.com; s=arc-20160816; b=KbwSN5cImBDRX8b68RWVfKggGk6Z7xvSaBQQbq5UWxJLNOwOp0XThxJE4pfrjmc0Gq /mFkAshtn3fVNtlP/iYElhH4+bx8j7+0P9Of9Dx/yzLNIR0Pzuvcq9SbmQQDELRLGzug UuYPvE2W8bytlTcQqmcoCTrOCmYldo2PODq4PeWs6osA9S9WvLx8lSS0GnR5p+Klg5qd j6xfov1ntG9qvakUraGg2fx1asxefLoZ6AH21/ULdFd5D/CzQpoaIQt+feOoVksq1LQa q/EMMWu+qq/+Pw2mb3CrSizqqYqbedrEy1puzovAZKWeNULjPfKzCAePcjJnnx/6D6e/ pOZA== 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=LWTy/AWDIxLug8r/jyGlNA64I7dG0aBjMEbJgOkManU=; fh=4lILvPJBgOQDo+8c9eQsNFVTVMsd1h327OoIe8+qKJE=; b=i2SImr66Bffr8BN+wv3g8oeKEEsCCfm5gcW7gVF/pPUYEGAs/kZBeCEy6s/+v12/d5 tOlxxDxsZktoGJ9SicClXfyHBSVq5TTbi+FVlIUgJBW6aZ2C+IKmshvelmth1iOevwA1 QopyOOnqg7NFF+51m/G3LsZqEj2zO0UEaet8cTXfEToGax/94JEhsZ0FHMuMYrPmc5Jj vkgIpEPBQzeJ5t+sjUuQuXm9LHvb2TERfaltgYAV0RrK493V7hyAWnA4MNAzCuNMQa+q TiXU6ojLyRPacSSLLZ+nas3HX/kaP6+AiVxgBstCWkr1TcmgYgUvyMq9nZjmDPCGR4oI 8u0w==; 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-182885-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182885-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6a15f29b3b7si210574426d6.295.2024.05.18.06.09.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 May 2024 06:09:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-182885-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; 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-182885-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182885-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 8A1961C20D7D for ; Sat, 18 May 2024 13:09:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 518E73BBE1; Sat, 18 May 2024 13:09:36 +0000 (UTC) Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.86.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 DFA72376E1 for ; Sat, 18 May 2024 13:09:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.58.86.151 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716037775; cv=none; b=Xj3T/ZTyDyO1+F+0cb64QkSSByR0+eJMCrNcxE09nwIuntIgaevQpYsG5m9WqvjdwB+gC/Fpy/2SldpDjNFGcKv7ISsIYHxQkD4QQJxV2U5DKqjeV1/YFEnGigh1GRWOxz4Cv1q27LXdK2w9jb/dP6bXgDiNE2eo8yfo4BRV2GA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716037775; c=relaxed/simple; bh=LWTy/AWDIxLug8r/jyGlNA64I7dG0aBjMEbJgOkManU=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: MIME-Version:Content-Type; b=q9/hyQ0nvTA8U/52FevRyHm8fZLVio8+nP3uDikTCZkotsckI94xXxYbrqNVtSQo4MI+iTgW0B1N47mclCzj2UjeegScqEA9BK8gKggJK6sh0NpaxvcpqH60MnJ4xZdvVkTWDgjNVEC1coiHIZHwtKpnop1SIvamOTNqSu4Tlhs= 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.86.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-319-xOLMYslUNASMd3-nOSLNBA-1; Sat, 18 May 2024 14:09:24 +0100 X-MC-Unique: xOLMYslUNASMd3-nOSLNBA-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; Sat, 18 May 2024 14:08:53 +0100 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Sat, 18 May 2024 14:08:53 +0100 From: David Laight To: 'Kees Cook' , Peter Zijlstra , Linus Torvalds CC: Kees Cook , Justin Stitt , 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: AQHap5VP7Alm1wU+TkWPeIXHcuXX+bGc9guA Date: Sat, 18 May 2024 13:08:52 +0000 Message-ID: References: <202404291502.612E0A10@keescook> <202405081144.D5FCC44A@keescook> <202405081354.B0A8194B3C@keescook> <20240515073636.GY40213@noisy.programming.kicks-ass.net> <25882715-FE44-44C0-BB9B-57F2E7D1F0F9@kernel.org> In-Reply-To: <25882715-FE44-44C0-BB9B-57F2E7D1F0F9@kernel.org> 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-Transfer-Encoding: base64 RnJvbTogS2VlcyBDb29rDQo+IFNlbnQ6IDE2IE1heSAyMDI0IDE0OjMxDQo+IA0KPiBPbiBNYXkg MTUsIDIwMjQgMTI6MzY6MzYgQU0gUERULCBQZXRlciBaaWpsc3RyYSA8cGV0ZXJ6QGluZnJhZGVh ZC5vcmc+IHdyb3RlOg0KPiA+T24gV2VkLCBNYXkgMDgsIDIwMjQgYXQgMDQ6NDc6MjVQTSAtMDcw MCwgTGludXMgVG9ydmFsZHMgd3JvdGU6DQo+ID4+IEZvciBleGFtcGxlLCB0aGUgbW9zdCBjb21t b24gY2FzZSBvZiBvdmVyZmxvdyB3ZSd2ZSBldmVyIGhhZCBoYXMgdmVyeQ0KPiA+PiBtdWNoIGJl ZW4gYXJyYXkgaW5kZXhpbmcuIE5vdywgc29tZXRpbWVzIHRoYXQgaGFzIGFjdHVhbGx5IGJlZW4g YWN0dWFsDQo+ID4+IHVuZGVmaW5lZCBiZWhhdmlvciwgYmVjYXVzZSBpdCdzIGJlZW4gb3ZlcmZs b3cgaW4gc2lnbmVkIHZhcmlhYmxlcywNCj4gPj4gYW5kIHRob3NlIGFyZSAiZWFzeSIgdG8gZmlu ZCBpbiB0aGUgc2Vuc2UgdGhhdCB5b3UganVzdCBzYXkgIm5vLCBjYW4ndA0KPiA+PiBkbyB0aGF0 Ii4gVUJTQU4gZmluZHMgdGhlbSwgYW5kIHRoYXQncyBnb29kLg0KPiA+DQo+ID5XZSBidWlsZCB3 aXRoIC1mbm8tc3RyaWN0LW92ZXJmbG93LCB3aGljaCBpbXBsaWVzIC1md3JhcHYsIHdoaWNoIHJl bW92ZXMNCj4gPnRoZSBVQiBmcm9tIHNpZ25lZCBvdmVyZmxvdy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