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 7A8B9C4167E for ; Thu, 16 Sep 2021 16:14:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6E90B613DB for ; Thu, 16 Sep 2021 16:14:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241301AbhIPQP0 convert rfc822-to-8bit (ORCPT ); Thu, 16 Sep 2021 12:15:26 -0400 Received: from eu-smtp-delivery-151.mimecast.com ([185.58.85.151]:56017 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235630AbhIPQJL (ORCPT ); Thu, 16 Sep 2021 12:09:11 -0400 Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-162-75vixzp0Of-n5TQEq5DIEg-1; Thu, 16 Sep 2021 17:07:49 +0100 X-MC-Unique: 75vixzp0Of-n5TQEq5DIEg-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) by AcuMS.aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Thu, 16 Sep 2021 17:07:47 +0100 Received: from AcuMS.Aculab.com ([fe80::994c:f5c2:35d6:9b65]) by AcuMS.aculab.com ([fe80::994c:f5c2:35d6:9b65%12]) with mapi id 15.00.1497.023; Thu, 16 Sep 2021 17:07:47 +0100 From: David Laight To: 'Will Deacon' , Arnd Bergmann CC: Linux Kernel Mailing List , "Linux FS-devel Mailing List" , Al Viro , Andy Lutomirski , Catalin Marinas , Kees Cook , Linus Torvalds , Peter Zijlstra Subject: RE: [RFC PATCH] fs/compat_binfmt_elf: Introduce sysctl to disable compat ELF loader Thread-Topic: [RFC PATCH] fs/compat_binfmt_elf: Introduce sysctl to disable compat ELF loader Thread-Index: AQHXqw1xhvz/JjIwFE+lWY/Xr1h6SKum0nuw Date: Thu, 16 Sep 2021 16:07:47 +0000 Message-ID: <0594844caf4b4c4c815922e726f43d81@AcuMS.aculab.com> References: <20210916131816.8841-1-will@kernel.org> <20210916151330.GA9000@willie-the-truck> In-Reply-To: <20210916151330.GA9000@willie-the-truck> 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: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Will Deacon > Sent: 16 September 2021 16:14 ... > > I'm not sure I understand the logic behind the sysctl. Are you worried > > about exposing attack surface on devices that don't support 32-bit > > instructions at all but might be tricked into loading a 32-bit binary that > > exploits a bug in the elf loader, or do you want to remove compat support > > on some but not all devices running the same kernel? > > It's the latter case. With the GKI effort in Android, we want to run the > same kernel binary across multiple devices. However, for some devices > we may be able to determine that there is no need to support 32-bit > applications even though the hardware may support them, and we would > like to ensure that things like the compat syscall wrappers, compat vDSO, > signal handling etc are not accessible to applications. Interesting because there is the opposite requirement to run 32bit user code under emulation on a 64bit only cpu. This largely requires the kernel to contain the 32bit compatibility code - even though it can't execute the instructions. I suspect you could even embed the instruction emulator inside the elf interpreter. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)