Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp890120pxp; Wed, 16 Mar 2022 20:19:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMkSqkoIu/Nc7PyiYCIaEgQGQPFIOJcZq2gv9oGoSC12bparpYCZT2Oi5wDN0JTPqNfbDZ X-Received: by 2002:a63:4602:0:b0:381:f916:9312 with SMTP id t2-20020a634602000000b00381f9169312mr2028999pga.473.1647487172908; Wed, 16 Mar 2022 20:19:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647487172; cv=none; d=google.com; s=arc-20160816; b=olqMEMGHAPbStXwt4aX2s5nrlMkCp0Xep/zIF/dHbwHXXSunoAkocbD9eeREBygzbv tRRC8sURf23IXDJbF5PR6n9hODU9RtE+8tCaG64BWW5FEWAXSvYGIG+ZPhEY6755eTxL fpX9TMOxpQt9BDX1DRO3ceEQpGDoXuLT8CuZyCNAp7AhBi5s6PUPmGfoyjdWCUvjR/TW PBHmHyKSbYp8RbgykkHCAY1AaXHSfp1iZGXJS2ufJky3du/K8Zc8yHSUACtl1TZEwza1 TsYsrwKkJum4i0hQF0ew04SP6Ev2McNQY9408k+x7cmvDA7nW5RfBzFVjXyatI+JEPrw zL8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:accept-language:in-reply-to:references:message-id:date :thread-index:thread-topic:subject:cc:to:from; bh=Sr+Vm5jUKuoezWVLkIsI4bdmgi7zgEl/5PM8gvDJIgs=; b=Ry+bDOOdUJ47p1YXCwbkwLocigwyD5A8KxyHCR3LF9gzu1RUz70VJWQ+u/7gJcsYzV DVfVzTxDvQiyntyuWrOg136gQSH2wzul2EuhhHf+FWM9mEXMrB2BCJhjMvEg7xpo4iaS 6ZWC5/h1pkZZXZuHHEZ7rvLLINjfaqhycilSNVe/pt1l73XgTlNzwlcg9MrrhhXqQCL4 XI9Mp4Ab4VwGGT3vIx5mvNupD8/rkZpA511NJ6j/FVbKGynaHc/6wS1X5sTeaK+V9nYL L45Ai+I6ViMs3omdxvNzB8+TFsS6m0U6ZXfTURPXQyBFlJgxxS0MT2NolueyJ+LqCpaV uFcw== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id 126-20020a620684000000b004e0db114e7bsi3212226pfg.67.2022.03.16.20.19.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 20:19:32 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5AE2722523; Wed, 16 Mar 2022 20:19:29 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345141AbiCQCdw convert rfc822-to-8bit (ORCPT + 99 others); Wed, 16 Mar 2022 22:33:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232675AbiCQCdt (ORCPT ); Wed, 16 Mar 2022 22:33:49 -0400 Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.85.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 31DF11FA4E for ; Wed, 16 Mar 2022 19:32:34 -0700 (PDT) Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-28-TfXkqhZKOkGnjBRqD1P3bg-1; Thu, 17 Mar 2022 02:32:31 +0000 X-MC-Unique: TfXkqhZKOkGnjBRqD1P3bg-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.32; Thu, 17 Mar 2022 02:32:30 +0000 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.033; Thu, 17 Mar 2022 02:32:29 +0000 From: David Laight To: 'Kees Cook' , James Jones , Arnd Bergmann CC: Borislav Petkov , the arch/x86 maintainers , Linux Kernel Mailing List Subject: RE: [PATCH] x86: Remove a.out support Thread-Topic: [PATCH] x86: Remove a.out support Thread-Index: AQHYOYVhiI2rWSVwnUW0pCDz/QTpF6zC2QRw Date: Thu, 17 Mar 2022 02:32:29 +0000 Message-ID: <5161ace381a74a63b58b0a2a2a2cb57d@AcuMS.aculab.com> References: <4c449fab-8135-5057-7d2c-7b948ce130cc@theinnocuous.com> <0b31b1d3-852d-6cab-82ae-5eecaec05679@theinnocuous.com> <202203151150.1CDB1D8DA@keescook> <202203161523.857B469@keescook> In-Reply-To: <202203161523.857B469@keescook> 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 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kees Cook > Sent: 16 March 2022 22:30 > > On Wed, Mar 16, 2022 at 01:38:31PM +0100, Arnd Bergmann wrote: > > is in the end, but it's likely easier than a standalone a.out loader > > in user space, or a conversion to ELF format. > > Yeah, the exec format is really simple. The only tricky bit was preparing > the stack and making sure everything landed in the right place for text > and data. James, can you try this? aln and mac run for me, but I'm not > actually exercising them beyond dumping argument lists, etc: Doesn't that restrict the a.out program to the address space below the normal base address for elf programs? So you'll only be able to load small programs - which might be ok here. OTOH it might be possible to link the 'loader program' to a high address - the elf loader will probably just load it. Best to link it static to avoid shared lib mmaps and probably try to avoid libc calls. I was wondering what happens when malloc() starts using sbrk() - but I guess it sees the top of the bss for the loaded and it all works fine. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)