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 8304EC433FE for ; Thu, 17 Mar 2022 02:05:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345003AbiCQCGN (ORCPT ); Wed, 16 Mar 2022 22:06:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352830AbiCQCGK (ORCPT ); Wed, 16 Mar 2022 22:06:10 -0400 Received: from mail-4022.proton.ch (mail-4022.proton.ch [185.70.40.22]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D6FD1E3EE for ; Wed, 16 Mar 2022 19:04:53 -0700 (PDT) Date: Thu, 17 Mar 2022 02:04:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=theinnocuous.com; s=protonmail; t=1647482691; bh=g1vw4pgWe5qxlGdq8erecfh8s9xp7QSO6YFIB+9Qkh4=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID; b=U4thnzlydYwy3meEiVrzkGjoJSjnKDAwJDe3NSoQUIXTeQCwry1+qgN1M3ZAngwz+ E24jctkiiL70tEXWi6SbHwzev6GeEQ5ZuayLj4GjgZXLrvooUxbYXWFdOXNJD1xr1G DE4DgNqcLHKAj/v5z2M3rhXA03129ngaT36nwOUyHJo/pWSq2upktxqC9YFgPbTtHI 6frlClVWEGZgkC1z9y9fmDHjHSjO6hKzcHyEDasZQ/71zbPFmPt2EK3GNF0ze/bOw7 jnVsYQ4GQ4bi1cBcOZqdoVQ34APCemCIZFly5uom5hDB5wZvO1Dgsrv7og5Ry1fB+1 Cc5erbLAfhp0w== To: Kees Cook , Arnd Bergmann From: James Jones Cc: Borislav Petkov , the arch/x86 maintainers , Linux Kernel Mailing List Reply-To: James Jones Subject: Re: [PATCH] x86: Remove a.out support Message-ID: <59fb3d14-423a-d39b-04cb-1e60ee67d3f1@theinnocuous.com> In-Reply-To: <202203161523.857B469@keescook> References: <4c449fab-8135-5057-7d2c-7b948ce130cc@theinnocuous.com> <0b31b1d3-852d-6cab-82ae-5eecaec05679@theinnocuous.com> <202203151150.1CDB1D8DA@keescook> <202203161523.857B469@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/16/22 3:30 PM, Kees Cook wrote: > 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 Yes, works perfectly, thank you. I like the idea of using this much better than getting emailed every time someone wants to delete the a.out code again. Consider my use case withdrawn. I've already pushed an update to my jaguar-sdk project to use this tool instead. -James > $ 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=3D4096 > $ sudo sysctl -w vm.mmap_min_addr=3D4096 > vm.mmap_min_addr =3D 4096 > $ ./aout aln --help > aln: unrecognized option `--help' > Usage: aln [-options]