Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp3449278imb; Tue, 5 Mar 2019 09:34:06 -0800 (PST) X-Google-Smtp-Source: APXvYqzQ/8ldoRZ1xwTN1FHm2kpLRoV99Yew/0YZHL88Uyz52Ba3lnq+QW26loETCCHiuj/clbZ2 X-Received: by 2002:a63:8b42:: with SMTP id j63mr2311884pge.79.1551807245947; Tue, 05 Mar 2019 09:34:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551807245; cv=none; d=google.com; s=arc-20160816; b=MHd97zFm0J8PPpDD0+z0LtvjXb0o2Bso8zo4gTduBQo+2JN0L3Cli0ketPFY4CisY5 eolFfKLbUJhb631bX3qDGQXyJ8/PnJRw5zIWbXrjFARKutXXrKjiKWR/ts7nfUG6x4hn kAA1GN7l6f1Kt0AUPEcTZqOEPFR08e0rsuD5wYBspFPzQQ3jn1hMbhYFXc/HsVDraCfH /B5X0iXa0g/pC3ViNfddy2g4WjmijkOI5dCIEwJYTwr3h/HUZYOSqoMaSMVoLMnk0FpK zuLhDBhfiTn6w2JN3OLzi+EEGKlgsfE+gu93SToYjlCwinfSRkx4l2UflwQgjCWQ5Z7J 1C/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=IKS/HjuKsvqhTIX522zw0q6VfF9Uwm49M8UO+zqYMaU=; b=Gb8KWUKBWXmZUqeOx1zG/wZvH3hXuASdgOfQyiGHlQz4GebXs1Jse3lnA5i+Fpkssf ND6Gol1Juhtcxtr8Al8+oRqNK8WuEqbViewr4w4XKvruRyaLrY0m8mHj/RaC4s6vHUlq VtQosFAZn4ZMyHv8f8tK+ffnIYR/L5sBowMvSa6+xWCe1KxhBGpVRH11pg3UsbMMxk1S JhJUCdI0L7Mf/8wASX30xrXhFZi/75v9hVE5mrUVlLJ9DaL82qXusXu6GastP66QOEgG J1Wqc511HTesES2Helv8FmSqX+zRoVlpX0+6u88ENcc1AjyP4yV3UCckuFv66n7527v3 M7vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=RawKYXQO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b1si4570391plc.15.2019.03.05.09.33.50; Tue, 05 Mar 2019 09:34:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=RawKYXQO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726456AbfCEQWp (ORCPT + 99 others); Tue, 5 Mar 2019 11:22:45 -0500 Received: from mail-lf1-f68.google.com ([209.85.167.68]:38568 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726101AbfCEQWp (ORCPT ); Tue, 5 Mar 2019 11:22:45 -0500 Received: by mail-lf1-f68.google.com with SMTP id t2so2022155lff.5 for ; Tue, 05 Mar 2019 08:22:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IKS/HjuKsvqhTIX522zw0q6VfF9Uwm49M8UO+zqYMaU=; b=RawKYXQOZQF6qfYGfAOsHYYTwMKDkGQhXyG7x3Eu8Bg/3a/2UNmBXHFuqmR0mbY8WE s5p6zdJMH4q93QQwepfwKRpfk96tq2NR+W/PwPkF7Tv/EODKLDEJcgbrVeA/IaBgPcTb ku8odfRQBGJhrpT72EsWZUteXRuG27CPcNUXk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IKS/HjuKsvqhTIX522zw0q6VfF9Uwm49M8UO+zqYMaU=; b=muk5ihDB7BXRUnx0UctnM2tHiMcxUEyz4S8vBpN6YGSYp8ofy/i5e3zQzyYUHzIk8l 05YqncKpUY2qhB12VFlmj7NQzfng/dMT0vnDjNlBwYj/nTC9eqJlsrwzQlM0/nPb/89X Z+H13Hy8v1UtcA7OEtNVFLXc0rY6p1nQ1BEDOvzCEFMjdNTMOlZKaak67RXKeXMO1nHb Lxsn9Sc6SoWNRDsVENeoh3qUkZhN4N4/C99XoyhvQRKMY4DssMV91H9vj27sd+cSJw8F icMAQzZblPXCoQ485IYsqtaQ/C6wE6uZpRYslBCpafX89WYob9OXHz7qjHZfHUzHIAM9 F1KQ== X-Gm-Message-State: APjAAAXu5aPOhFTT0tG3HCDI+oTHhyUD+C9gmHdXMpqCXvxaWo/Vs7U9 QE8TI4YO4aGw4VYP1Z+BK6+Rlv78PgM= X-Received: by 2002:ac2:41cb:: with SMTP id d11mr1253995lfi.3.1551802961181; Tue, 05 Mar 2019 08:22:41 -0800 (PST) Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com. [209.85.167.48]) by smtp.gmail.com with ESMTPSA id j8sm2212270ljh.58.2019.03.05.08.22.37 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Mar 2019 08:22:38 -0800 (PST) Received: by mail-lf1-f48.google.com with SMTP id p1so6616719lfk.9 for ; Tue, 05 Mar 2019 08:22:37 -0800 (PST) X-Received: by 2002:a19:6a0a:: with SMTP id u10mr529329lfu.148.1551802957214; Tue, 05 Mar 2019 08:22:37 -0800 (PST) MIME-Version: 1.0 References: <20190305091904.GB8256@zn.tnic> <20190305122218.GD13380@bombadil.infradead.org> <20190305134347.4be2449c@alans-desktop> <20190305145717.GD8256@zn.tnic> In-Reply-To: <20190305145717.GD8256@zn.tnic> From: Linus Torvalds Date: Tue, 5 Mar 2019 08:22:21 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] x86: Deprecate a.out support To: Borislav Petkov Cc: Alan Cox , Matthew Wilcox , Jann Horn , Al Viro , Thomas Gleixner , kernel list , linux-fsdevel , "the arch/x86 maintainers" , Linux API , Andrew Morton , Richard Weinberger , Anton Ivanov Content-Type: multipart/mixed; boundary="00000000000006ed0b05835b480b" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --00000000000006ed0b05835b480b Content-Type: text/plain; charset="UTF-8" On Tue, Mar 5, 2019 at 6:59 AM Borislav Petkov wrote: > > We can at least deprecate it on x86... I'd prefer to try to deprecate a.out core dumping first.. That's the part that is actually broken, no? In fact, I'd be happy to deprecate a.out entirely, but if somebody _does_ complain, I'd like to be able to bring it back without the core dumping. Because I think the likeliihood that anybody cares about a.out core dumps is basically zero. While the likelihood that we have some odd old binary that is still a.out is slightly above zero. So I'd be much happier with this if it was a two-stage thing where we just delete a.out core dumping entirely first, and then deprecate even running a.out binaries separately. Because I think all the known *bugs* we had were with the core dumping code, weren't they? Removing it looks trivial. Untested patch attached. Then I'd be much happier with your "let's deprecate a.out entirely" as a second patch, because I think it's a unrelated issue and much more likely to have somebody pipe up and say "hey, I have this sequence that generates executables dynamically, and I use a.out because it's much simpler than ELF, and now it's broken". Or something. Linus --00000000000006ed0b05835b480b Content-Type: text/x-patch; charset="US-ASCII"; name="patch.diff" Content-Disposition: attachment; filename="patch.diff" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_jsvzcale0 IGFyY2gveDg2L2lhMzIvaWEzMl9hb3V0LmMgfCAxNTkgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0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