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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2F29C433F5 for ; Mon, 25 Apr 2022 03:45:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 842B96B00C4; Sun, 24 Apr 2022 23:45:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7CB4D6B00C5; Sun, 24 Apr 2022 23:45:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6444D6B00C6; Sun, 24 Apr 2022 23:45:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.26]) by kanga.kvack.org (Postfix) with ESMTP id 50FD06B00C4 for ; Sun, 24 Apr 2022 23:45:52 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id 1F7ED81EAA for ; Mon, 25 Apr 2022 03:45:52 +0000 (UTC) X-FDA: 79394012544.04.449B8F8 Received: from mail-oi1-f171.google.com (mail-oi1-f171.google.com [209.85.167.171]) by imf07.hostedemail.com (Postfix) with ESMTP id 1EA1840038 for ; Mon, 25 Apr 2022 03:45:49 +0000 (UTC) Received: by mail-oi1-f171.google.com with SMTP id r8so15818642oib.5 for ; Sun, 24 Apr 2022 20:45:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=landley-net.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=dCbuXnt8KI6vT4+iL+5GGDKwywcs08Pazm0PAaoYNFI=; b=ZvaDEohb8ZLj7cvPeWXG70F+Xmei4RkLyAyXVmfQrQwpmNzLUAwA3X85LIHV2dvy3B zdls0TLE9Bm0H7NsvkqqSigKYPQmL1fEIk5ubVzVX7gH77cDgy0gcYKaDwbqepEx+Z42 beIuU3yYuC2nJ2JPlxGkDdPy5pfY6i9g6EviD4PM1Biie+s8LDe1rU1v7Chqf9+Of2DM hj/fz3cO/2reyFq0zD0PoG1gQgbBJr8wL+PmUB6jjTiewSYBc88jCiVWlYLS+ZIGuJG5 9Lz/5+i0Ir9Lvrsf2fCg6oedgf2axiFm5gLfRx95D6fG5Ndv39Ybt7WM3UQW1//pXBzv tO1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=dCbuXnt8KI6vT4+iL+5GGDKwywcs08Pazm0PAaoYNFI=; b=zGaEPm+GAeEANDMQqBOxbSepWY8rE2P/8onHZ8Yw+nX+y3XM74SS2GRCxP3lzzUK8A t3hAyDy6OVz4fFxOx+EhzYxIPdnoKTK8hmrKLps+XkdsS0PijyOweKQODzwcO4Dmxvv2 +EnSoS1s8j1UAw0BcAnEZBlaL2lH33S/ATHpDwOqvGU5BGVs6licpfVaL+5iNK995gFU XGZ0WCOVHvEkdcO1GAzNU5sgOhVz6SJDDT1d3nAtTomVxDkVxT7EbaKtN9h2gyKLKj1I m9kxbcNVLejCXC3wS686yL3sl4IgPlt+J9cdQ6KA6xTh8BKJ7FZckoPEifSt0JNzG+bB Iljw== X-Gm-Message-State: AOAM532Q51x6tnnzzpfcXAd1d3RjMyUS03uu7Wnd9MyQiUsahHWLndqA a92xN3eM0BXWj1dWHCVgx0FB8g== X-Google-Smtp-Source: ABdhPJyjXv8VnX8iTAuwua0Imy62cyfWX3ohly9ACpWE55XVrjfJZYK8m6QF79M73snVG+oZVSSfmQ== X-Received: by 2002:a05:6808:1381:b0:325:1ffe:af93 with SMTP id c1-20020a056808138100b003251ffeaf93mr2368429oiw.191.1650858350829; Sun, 24 Apr 2022 20:45:50 -0700 (PDT) Received: from [192.168.208.243] ([172.56.88.231]) by smtp.gmail.com with ESMTPSA id e16-20020a4a9b50000000b0035e5b5acc04sm1834959ook.24.2022.04.24.20.45.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 24 Apr 2022 20:45:50 -0700 (PDT) Message-ID: <24f1fd7f-7e1c-bb56-3a08-56ccfc686a61@landley.net> Date: Sun, 24 Apr 2022 22:50:09 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.2 Subject: Re: [PATCH] binfmt_flat: Remove shared library support Content-Language: en-US To: Rich Felker , Geert Uytterhoeven Cc: Greg Ungerer , "Eric W. Biederman" , Kees Cook , Niklas Cassel , Damien Le Moal , Alexander Viro , Paul Walmsley , Palmer Dabbelt , Albert Ou , Mike Frysinger , "stable@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "linux-mm@kvack.org" , "linux-riscv@lists.infradead.org" , Linux-Arch , linux-m68k , Linux ARM , Linux-sh list , Yoshinori Sato References: <20220414091018.896737-1-niklas.cassel@wdc.com> <81788b56-5b15-7308-38c7-c7f2502c4e15@linux-m68k.org> <87levzzts4.fsf_-_@email.froward.int.ebiederm.org> <01b063d7-d5c2-8af0-ad90-ed6c069252c5@linux-m68k.org> <20220421124326.GG7074@brightrain.aerifal.cx> From: Rob Landley In-Reply-To: <20220421124326.GG7074@brightrain.aerifal.cx> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 1EA1840038 X-Stat-Signature: pyuoy8kgnns7x3h4yowqrzj5u6mes6yt X-Rspam-User: Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=landley-net.20210112.gappssmtp.com header.s=20210112 header.b=ZvaDEohb; spf=none (imf07.hostedemail.com: domain of rob@landley.net has no SPF policy when checking 209.85.167.171) smtp.mailfrom=rob@landley.net; dmarc=none X-HE-Tag: 1650858349-418566 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 4/21/22 07:43, Rich Felker wrote: > On Thu, Apr 21, 2022 at 08:52:59AM +0200, Geert Uytterhoeven wrote: >> On Thu, Apr 21, 2022 at 1:53 AM Greg Ungerer wrote: >> > On 21/4/22 00:58, Eric W. Biederman wrote: >> > > In a recent discussion[1] it was reported that the binfmt_flat library >> > > support was only ever used on m68k and even on m68k has not been used >> > > in a very long time. >> > > >> > > The structure of binfmt_flat is different from all of the other binfmt >> > > implementations becasue of this shared library support and it made >> > > life and code review more effort when I refactored the code in fs/exec.c. >> > > >> > > Since in practice the code is dead remove the binfmt_flat shared libarary >> > > support and make maintenance of the code easier. >> > > >> > > [1] https://lkml.kernel.org/r/81788b56-5b15-7308-38c7-c7f2502c4e15@linux-m68k.org >> > > Signed-off-by: "Eric W. Biederman" >> > > --- >> > > >> > > Can the binfmt_flat folks please verify that the shared library support >> > > really isn't used? >> > >> > I can definitely confirm I don't use it on m68k. And I don't know of >> > anyone that has used it in many years. >> > >> > >> > > Was binfmt_flat being enabled on arm and sh the mistake it looks like? >> >> I think the question was intended to be >> >> Was *binfmt_flat_shared_flat* being enabled on arm and sh the >> mistake it looks like? > > Early in my work on j2, I tried to research the history of shared flat > support on sh, and it turned out the mainline tooling never even > supported it, and the out-of-line tooling I eventually found was using > all sorts of wrong conditionals for how it did the linking and elf2flt > conversion, e.g. mere presence of any PIC-like relocation in any file > made it assume the whole program was PIC-compatible. There's no way > that stuf was ever used in any meaningful way. It just didn't work. > > Quickly dropped that and got plain ELF (no shared text/xip, but no > worse than the existing flat support) working, and soon after, FDPIC. > > The whole binfmt_flat ecosystem is a mess with no good reason to > exist. FYI when I had to come up to speed on this in 2014 I did a writeup on my own research: https://landley.net/notes-2014.html#07-12-2014 The lack of a canonical "upstream" elf2flt repository was probably the biggest problem at the time. (There's a reason I grabbed fdpic hard and tried to make that work everywhere.) > Rich Rob