From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44F54C4332B for ; Thu, 4 Mar 2021 00:07:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0B62F64F47 for ; Thu, 4 Mar 2021 00:07:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231534AbhCCX7s (ORCPT ); Wed, 3 Mar 2021 18:59:48 -0500 Received: from eu-smtp-delivery-151.mimecast.com ([185.58.86.151]:27937 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379852AbhCCPbz (ORCPT ); Wed, 3 Mar 2021 10:31:55 -0500 Received: from AcuMS.aculab.com (156.67.243.126 [156.67.243.126]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-129-p7FEIIrCNG6cb_3HeC64uw-1; Wed, 03 Mar 2021 15:29:45 +0000 X-MC-Unique: p7FEIIrCNG6cb_3HeC64uw-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) by AcuMS.aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 3 Mar 2021 15:29:37 +0000 Received: from AcuMS.Aculab.com ([fe80::43c:695e:880f:8750]) by AcuMS.aculab.com ([fe80::43c:695e:880f:8750%12]) with mapi id 15.00.1347.000; Wed, 3 Mar 2021 15:29:37 +0000 From: David Laight To: 'Linus Walleij' , Will Deacon CC: Jian Cai , Nick Desaulniers , Manoj Gupta , Luis Lozano , clang-built-linux , Nathan Chancellor , Russell King , Catalin Marinas , James Morris , "Serge E. Hallyn" , Arnd Bergmann , Masahiro Yamada , Kees Cook , Ard Biesheuvel , =?utf-8?B?QW5kcmVhcyBGw6RyYmVy?= , "Ingo Molnar" , Marc Zyngier , Andrew Morton , Mike Rapoport , Mark Rutland , David Brazdil , James Morse , Linux ARM , Linux Kernel Mailing List , "linux-security-module@vger.kernel.org" Subject: RE: [PATCH v4] ARM: Implement SLS mitigation Thread-Topic: [PATCH v4] ARM: Implement SLS mitigation Thread-Index: AQHXEECBQRoTQnOC90iuKvtWWC/yz6pyYx/A Date: Wed, 3 Mar 2021 15:29:37 +0000 Message-ID: <49e8725f29ab4ecda6d669e9216bca29@AcuMS.aculab.com> References: <20210219201852.3213914-1-jiancai@google.com> <20210219230841.875875-1-jiancai@google.com> <20210222115816.GA8605@willie-the-truck> <20210223100453.GB10254@willie-the-truck> In-Reply-To: Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=C51A453 smtp.mailfrom=david.laight@aculab.com 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 Precedence: bulk List-ID: RnJvbTogTGludXMgV2FsbGVpag0KPiBTZW50OiAwMyBNYXJjaCAyMDIxIDE1OjE5DQo+IA0KPiBP biBUdWUsIEZlYiAyMywgMjAyMSBhdCAxMTowNSBBTSBXaWxsIERlYWNvbiA8d2lsbEBrZXJuZWwu b3JnPiB3cm90ZToNCj4gPiBPbiBNb24sIEZlYiAyMiwgMjAyMSBhdCAwMTo1MDowNlBNIC0wODAw LCBKaWFuIENhaSB3cm90ZToNCj4gPiA+IEkgYW0gb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luY2UgQVJNMzIgUkVUIGlzIG1vdiBwYywgPD4NCj4gZ2l0 IGdyZXAgJ21vdi4qcGMsJyB8IHdjIC1sIGdpdmVzIDkzIHNpdGVzIGluIGFyY2gvYXJtLg0KPiBJ IHN1cHBvc2UgdGhlc2UgbmVlZCB0byBjb21lIG91dDoNCj4gDQo+IG1vdiBwYywgbHINCj4gZHNi KG5zaCk7DQo+IGlzYigpOw0KDQpXb24ndCB0aGF0IGdvIGhvcnJpYmx5IHdyb25nIGZvciBjb25k aXRpb25hbCByZXR1cm5zPw0KDQoJRGF2aWQNCg0KLQ0KUmVnaXN0ZXJlZCBBZGRyZXNzIExha2Vz aWRlLCBCcmFtbGV5IFJvYWQsIE1vdW50IEZhcm0sIE1pbHRvbiBLZXluZXMsIE1LMSAxUFQsIFVL DQpSZWdpc3RyYXRpb24gTm86IDEzOTczODYgKFdhbGVzKQ0K From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 616DBC433DB for ; Wed, 3 Mar 2021 22:59:21 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9F5B464EF9 for ; Wed, 3 Mar 2021 22:59:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9F5B464EF9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=ACULAB.COM Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References:Message-ID:Date: Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=vnWRmdh7nJtHP8y6SIgoulBNMSXxFHWqfsWAsWz3zzk=; b=in+ss5TMcPvM35f2Q8/qOoNnR VfOuxQUUROfipCwU+Lrd4d5Ng5mXsPse/T7MEcm4KildQagkLxNpMl/+VU7YmXLFHH8x4cBrbsouc 4wjOzLYkI4Wz/gwHQHHHlwulSy5P2U62ZSQApf0SV/sta+drfHh5rEwkY+eYQJg/jEtst/p4hP2o1 9zXjsxzOYtsVYj9HyNv5ww65UvT5WRH8+1s7jp7SFJquFHWh2vq0KumrZ9Oq0LZ/toDyMeRYdgEkZ KL3i+cQwPtzdWfYoX2rqx/e9KzJORdVlHxkqSHAC0T2HJz2lCsgowTrx5QXSDB8YpTgMz8NqRcPRM wTHNwJRTw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lHaOE-006pPP-41; Wed, 03 Mar 2021 22:54:46 +0000 Received: from eu-smtp-delivery-151.mimecast.com ([207.82.80.151]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lHTSz-005OVi-NE for linux-arm-kernel@lists.infradead.org; Wed, 03 Mar 2021 15:31:16 +0000 Received: from AcuMS.aculab.com (156.67.243.126 [156.67.243.126]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-129-p7FEIIrCNG6cb_3HeC64uw-1; Wed, 03 Mar 2021 15:29:45 +0000 X-MC-Unique: p7FEIIrCNG6cb_3HeC64uw-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) by AcuMS.aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Wed, 3 Mar 2021 15:29:37 +0000 Received: from AcuMS.Aculab.com ([fe80::43c:695e:880f:8750]) by AcuMS.aculab.com ([fe80::43c:695e:880f:8750%12]) with mapi id 15.00.1347.000; Wed, 3 Mar 2021 15:29:37 +0000 From: David Laight To: 'Linus Walleij' , Will Deacon CC: Jian Cai , Nick Desaulniers , Manoj Gupta , Luis Lozano , clang-built-linux , Nathan Chancellor , Russell King , Catalin Marinas , James Morris , "Serge E. Hallyn" , Arnd Bergmann , Masahiro Yamada , Kees Cook , Ard Biesheuvel , =?utf-8?B?QW5kcmVhcyBGw6RyYmVy?= , "Ingo Molnar" , Marc Zyngier , Andrew Morton , Mike Rapoport , Mark Rutland , David Brazdil , James Morse , Linux ARM , Linux Kernel Mailing List , "linux-security-module@vger.kernel.org" Subject: RE: [PATCH v4] ARM: Implement SLS mitigation Thread-Topic: [PATCH v4] ARM: Implement SLS mitigation Thread-Index: AQHXEECBQRoTQnOC90iuKvtWWC/yz6pyYx/A Date: Wed, 3 Mar 2021 15:29:37 +0000 Message-ID: <49e8725f29ab4ecda6d669e9216bca29@AcuMS.aculab.com> References: <20210219201852.3213914-1-jiancai@google.com> <20210219230841.875875-1-jiancai@google.com> <20210222115816.GA8605@willie-the-truck> <20210223100453.GB10254@willie-the-truck> In-Reply-To: Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=C51A453 smtp.mailfrom=david.laight@aculab.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Linus Walleij > Sent: 03 March 2021 15:19 > > On Tue, Feb 23, 2021 at 11:05 AM Will Deacon wrote: > > On Mon, Feb 22, 2021 at 01:50:06PM -0800, Jian Cai wrote: > > > I am not sure if there are any plans to protect assembly code and I > > > will leave it to the Arm folks since they know a whole lot better. But > > > even without that part, we should still have better protection, > > > especially when overhead does not look too bad: I did some preliminary > > > experiments on ChromeOS, code size of vmlinux increased 3%, and there > > > were no noticeable changes to run-time performance of the benchmarks I > > > used. > > > > If the mitigation is required, I'm not sure I see a lot of point in only > > doing a half-baked job of it. It feels a bit like a box-ticking exercise, > > in which case any overhead is too much. > > I wrote some suggestions on follow-ups in my reply, and I can > help out doing some of the patches, I think. > > Since ARM32 RET is mov pc, <> > git grep 'mov.*pc,' | wc -l gives 93 sites in arch/arm. > I suppose these need to come out: > > mov pc, lr > dsb(nsh); > isb(); Won't that go horribly wrong for conditional returns? David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales) _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel