Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3471597pxb; Mon, 4 Apr 2022 18:02:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3APlWK+5BTOdaCZj+9r8fLY9vR4DxuLr58uRaiJltfCBLn6E17fGfZtX64mW7E05kFMIS X-Received: by 2002:a05:6a00:1488:b0:4fa:ac61:8b11 with SMTP id v8-20020a056a00148800b004faac618b11mr1103910pfu.58.1649120554422; Mon, 04 Apr 2022 18:02:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649120554; cv=none; d=google.com; s=arc-20160816; b=u4a+RFSBKHoIFz4MIWwIWB0f1Qf5woI4gquXJei2F7oNyDVAHaU+NnGD9DM/qxJme/ nVUiw1U107eaD4zmK8ykzOimZIfltp1vATgSoHpuAyCw8JNbFtCQBYNVrYdiOHCMKf7C Nu0uwPM1MsgmbWxtGaRBgpLaNga/hBajYMebhzL1+ZmqjE5ke5F+9qYygSXM9gpIKuTy Th2B8yD4wmkEojU31GxKlc5x5yZ2FIvViufTiC9sreTGue85vkiyP8ryFCaKAUPXazMv L1UU076IOqJQ9WHdBCJiDagmBgh0/nwamVfchUoLfX8KZ4XgI1mM0KrN49fkHKJNcYHU aKwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date; bh=16dHztEmmpg9hHrshQX4c9B2qQ2bg00ZX+4fWuoo8Lw=; b=uKGKqNDWXGxpO+qmdLxzeVN90DbL/yohxK4/PMl8HJTv0f17FAtZpdVGWTZgBjDxmt R8emze2R9ye2uwE0rNW+RE+9jgjv2tJwjfaaZmoeJA9qnH6xekKC7Vo9/Rgbxf5EWecd t0M+iq1KqW9KIk9uTbOl/yqy4EzXmu2nBzzBkO9zPcXYFibkC6JqdeqgfKnA2SWJs3Cj 0rQlr6VEZCIfiZ/LsTDGcImVM9UxM/UVhUTvf2Dw82tOyY3ZSeBgzEZ67AtoAgEzm04v BKG2yT/2fyCfGLNz1jr7UuctdJ+5k3LzK5BTwnIS3JPP/5+mZGomCjLXh9THCDVph3/H LxhA== 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 Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id mw11-20020a17090b4d0b00b001c6f8baf3ebsi534780pjb.124.2022.04.04.18.02.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 18:02:34 -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 Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id F293F16DB67; Mon, 4 Apr 2022 17:10:13 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359071AbiDDLFl (ORCPT + 99 others); Mon, 4 Apr 2022 07:05:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353742AbiDDLFg (ORCPT ); Mon, 4 Apr 2022 07:05:36 -0400 Received: from angie.orcam.me.uk (angie.orcam.me.uk [IPv6:2001:4190:8020::34]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 91334BB8 for ; Mon, 4 Apr 2022 04:03:39 -0700 (PDT) Received: by angie.orcam.me.uk (Postfix, from userid 500) id 402BE92009C; Mon, 4 Apr 2022 13:03:37 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 309AA92009B; Mon, 4 Apr 2022 12:03:37 +0100 (BST) Date: Mon, 4 Apr 2022 12:03:37 +0100 (BST) From: "Maciej W. Rozycki" To: Kees Cook cc: James Jones , bp@alien8.de, x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86: Remove a.out support In-Reply-To: <67CF27C5-5013-4EF4-B24C-8D9EB52536FB@chromium.org> Message-ID: References: <4c449fab-8135-5057-7d2c-7b948ce130cc@theinnocuous.com> <0b31b1d3-852d-6cab-82ae-5eecaec05679@theinnocuous.com> <202203151150.1CDB1D8DA@keescook> <67CF27C5-5013-4EF4-B24C-8D9EB52536FB@chromium.org> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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 On Sat, 2 Apr 2022, Kees Cook wrote: > > Chiming in late as I'm scanning outstanding mailing list traffic: if this > >is as you say all statically linked stuff, then converting from a.out to > >ELF might be as easy as: > > > >$ objcopy -I a.out-i386-linux -O elf32-i386 a.out-binary elf-binary > > Based on my research (and the wrapper I ended up writing), I don't think > this is sufficient because entry point handling is different between ELF > and a.out (specifically the stack layout and initial sp register value). Fair enough. I guess the exact value of %esp doesn't matter that much (why would it?), but the arguments and environment may well be structured differently (and indeed based on a glance over binfmt_aout.c there's extra indirection involved compared to the ELF i386 psABI). Maciej