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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB384C433EF for ; Wed, 16 Mar 2022 22:30:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229965AbiCPWbY (ORCPT ); Wed, 16 Mar 2022 18:31:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229525AbiCPWbW (ORCPT ); Wed, 16 Mar 2022 18:31:22 -0400 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDF3FF61 for ; Wed, 16 Mar 2022 15:30:06 -0700 (PDT) Received: by mail-pj1-x1033.google.com with SMTP id mj15-20020a17090b368f00b001c637aa358eso5983707pjb.0 for ; Wed, 16 Mar 2022 15:30:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=kPlqUJrQWu0IAkzBC9W9JiD0zP1UEGLgfkVOoVLya6o=; b=lS3popOVLSYQ7vwrjTYrjAdiJcspI4KHS3LMtsOJaw1fvaSEHt/nkx+oiNWKhvweDy nYp8wvsz9uFdQvWWCZvt0kIgJYi+ooQybbLXjJUXCW9HshmXLMiDEW27LxCaCPyxVB3f XtnQvYQT3piH0s2om40BT6AkLum0NYtJd4XMw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=kPlqUJrQWu0IAkzBC9W9JiD0zP1UEGLgfkVOoVLya6o=; b=EOJTR5F0dQplGGlR4p3ngxlMsP8JOAns21M8j+zg3U/ytna48SJQUIUp9feR2B8bVj wKmqCGdjN8dz2F7Bjp9OneUgRUew1gaRFbHxfVS60aSoNeV3TbPmBofT0y+MSH2P/UL4 nBx70tCOcuhw9JGIsb7ijWdflTyhSQxUeb+qAVwszir3UOFtRoPCQhDFfzCJ3i3Sd5NJ WSrVu9i24pHC49h7p3dg1fvYUcr4s2yiZqcmUKt/WR15WJOgMyhFy0tz+gAdMt0IykFu NmpOJXg9d4O//C3ywOVrhHRxwo06V1VL+5UHRr3jXCfMQYpWog8xSJ//OCWmvkHXeRmI JzbA== X-Gm-Message-State: AOAM533dXu8bYExP6q5E0kDNlCRE/Do0mdNtfcYChM+EJO2kkVIMQD7m PpNkDbf1/Hnn6ipVI5Irk17Avg== X-Google-Smtp-Source: ABdhPJypup/WCjhC/LYM1s6EjoMoVRNK3RGKzke3VAFYSpgY/dnT2wKiFCexetZnL9swKgfi84f/zw== X-Received: by 2002:a17:902:e741:b0:151:ffbd:37ea with SMTP id p1-20020a170902e74100b00151ffbd37eamr2070996plf.100.1647469806247; Wed, 16 Mar 2022 15:30:06 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id 63-20020a630942000000b00372a99c1821sm3445719pgj.21.2022.03.16.15.30.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Mar 2022 15:30:05 -0700 (PDT) Date: Wed, 16 Mar 2022 15:30:04 -0700 From: Kees Cook To: James Jones , Arnd Bergmann Cc: Borislav Petkov , the arch/x86 maintainers , Linux Kernel Mailing List Subject: Re: [PATCH] x86: Remove a.out support Message-ID: <202203161523.857B469@keescook> References: <4c449fab-8135-5057-7d2c-7b948ce130cc@theinnocuous.com> <0b31b1d3-852d-6cab-82ae-5eecaec05679@theinnocuous.com> <202203151150.1CDB1D8DA@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: https://github.com/kees/kernel-tools/tree/trunk/a.out $ make cc -Wall -m32 aout.c -o aout $ ./aout aln --help mmap: Operation not permitted /proc/sys/vm/mmap_min_addr is set to 65536 but QMAGIC a.out binaries must be mapped at 4096. To temporarily change this, run: sudo sysctl -w vm.mmap_min_addr=4096 $ sudo sysctl -w vm.mmap_min_addr=4096 vm.mmap_min_addr = 4096 $ ./aout aln --help aln: unrecognized option `--help' Usage: aln [-options]