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 438EAC07E9D for ; Mon, 26 Sep 2022 16:47:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 69E448E0072; Mon, 26 Sep 2022 12:47:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 64EE48E0066; Mon, 26 Sep 2022 12:47:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4EEBB8E0072; Mon, 26 Sep 2022 12:47:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 4023C8E0066 for ; Mon, 26 Sep 2022 12:47:08 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id E8387160C62 for ; Mon, 26 Sep 2022 16:47:07 +0000 (UTC) X-FDA: 79954816494.25.D60D6A1 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf10.hostedemail.com (Postfix) with ESMTP id 61280C0010 for ; Mon, 26 Sep 2022 16:47:06 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 1CB16B80B38; Mon, 26 Sep 2022 16:47:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 570B8C433D6; Mon, 26 Sep 2022 16:47:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664210823; bh=pllqmpbENCp1sBAaSJobpSEIC+YpKgpQi47z6PgaasU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XYuMgLFP5IBHzKaNKaPJqy0L9us7bEOTbUiF77cEUtsP1gDW2eJtQJ2z2RHEMHaGt VakeALZqqpryzrZ4TrR1VhNvZaJwlUbc5qZ2b1YUIJ/juTrmtiTENpBp4IWnM/jRXm GvG/LYxfWTLyWBE4poiaGJmLNZ539Ntff8/PG2Cc= Date: Mon, 26 Sep 2022 18:47:01 +0200 From: Greg KH To: =?utf-8?B?0L3QsNCx?= Cc: Geert Uytterhoeven , Bagas Sanjaya , Jonathan Corbet , Federico Vaga , Alex Shi , Yanteng Si , Hu Haowen , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc-tw-discuss@lists.sourceforge.net, Eric Biederman , Kees Cook , Alexander Viro , Linux MM Subject: Re: [PATCH v4 02/18] a.out: remove define-only CMAGIC, previously magic number Message-ID: References: <9cbea062df7125ef43e2e0b2a67ede6ad1c5f27e.1663280877.git.nabijaczleweli@nabijaczleweli.xyz> <20220926151554.7gxd6unp5727vw3c@tarta.nabijaczleweli.xyz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220926151554.7gxd6unp5727vw3c@tarta.nabijaczleweli.xyz> ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1664210826; a=rsa-sha256; cv=none; b=F+uCJcBGHryVVtMCSbIYe4G7sdqD+dCNzFtseYxsOj7MJ1CqrblkRfD3CX9C6d8D8aH1vW WTA4yZsPz6jdYrMQn55Wg4NV/N2WLhayBO1/3SbMk5+s7kmss5+CsSCwEDi0yhvCtQ1lf5 S8SxlvCcXIBRxKJ3BHGK+BkfmFFTFj4= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=korg header.b=XYuMgLFP; dmarc=pass (policy=none) header.from=linuxfoundation.org; spf=pass (imf10.hostedemail.com: domain of gregkh@linuxfoundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1664210826; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=FuDoAhUih77p+eFMc/wgERFaCHzR/FtdOrLLLNe+ocs=; b=QUJyrnUiqoTByx0HoIwA/USTGZVTsi5+0c2q5gUdcvf8FI4oLQUM9LqWJI9U9nkw3VpJjm ZI1Qi+/IMRRP4CAlwKwyyEBbn2oFJrqvITOIwOe/m2L+Z98WL6tq87eH4OfJ+g/lWD9BwA uzEuEtEnzS8DzB049tO/sZFd7MgIsig= Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=korg header.b=XYuMgLFP; dmarc=pass (policy=none) header.from=linuxfoundation.org; spf=pass (imf10.hostedemail.com: domain of gregkh@linuxfoundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org X-Rspam-User: X-Stat-Signature: 73ntdrpkq15m8feh39oryiiyzrwxnea7 X-Rspamd-Queue-Id: 61280C0010 X-Rspamd-Server: rspam06 X-HE-Tag: 1664210826-90629 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 Mon, Sep 26, 2022 at 05:15:54PM +0200, наб wrote: > Hi! > > On Mon, Sep 26, 2022 at 10:16:02AM +0200, Geert Uytterhoeven wrote: > > Thanks for your patch, which is now commit 53c2bd679017277f > > ("a.out: remove define-only CMAGIC, previously magic number") in > > driver-core/driver-core-next. > > > > On Fri, Sep 16, 2022 at 12:40 AM наб wrote: > > > The last user was removed in 5.1 in > > > commit 08300f4402ab ("a.out: remove core dumping support") > > > but this is part of the UAPI headers, so this may want to either wait > > > until a.out is removed entirely, or be removed from the magic number doc > > > and silently remain in the header > > > > Indeed. This is part of uapi, and might break some unknown > > userspace, while the gain is limited. Do we really want to reduce > > include/uapi/linux/a.out.h piecewise (e.g. N_BADMAG() seems to be > > unused, too), instead of keeping it until a.out support is removed > > completely? > > Not really, but it looked like a magic number in the magic-number.rst > sense due to the field being "magic" and the unintuitive type naming: > I hadn't realised it's part of the on-disk format > re-examination shows that it very well may be (have been). > > > Anyway, even at that point, it might be wise to keep the header file > > around, as people have expressed the desire to run a.out binaries > > through a userspace-compatibility wrapper. > > Agreed. Scissor-patch that reverts the removal below. > > > > A cursory glance on DCS didn't show any user code actually using this > > > value > > > > What is DCS? > > Debian Code Search; in this case my query was: > https://codesearch.debian.net/search?q=%5CbCMAGIC%5Cb&literal=0 > > There's a few false positives here but all results that are using CMAGIC > to mean this CMAGIC (and aren't hurd code copied from linux) > just re-define it. > > > > Documentation/process/magic-number.rst | 1 - > > > Documentation/translations/it_IT/process/magic-number.rst | 1 - > > > Documentation/translations/zh_CN/process/magic-number.rst | 1 - > > > Documentation/translations/zh_TW/process/magic-number.rst | 1 - > > > include/uapi/linux/a.out.h | 3 --- > > > 5 files changed, 7 deletions(-) > > > > > > diff --git a/include/uapi/linux/a.out.h b/include/uapi/linux/a.out.h > > > index 5fafde3798e5..bb15da96df2a 100644 > > > --- a/include/uapi/linux/a.out.h > > > +++ b/include/uapi/linux/a.out.h > > > @@ -70,9 +70,6 @@ enum machine_type { > > > The first page is unmapped to help trap NULL pointer references */ > > > #define QMAGIC 0314 > > > > > > -/* Code indicating core file. */ > > > -#define CMAGIC 0421 > > > - > > > #if !defined (N_BADMAG) > > > #define N_BADMAG(x) (N_MAGIC(x) != OMAGIC \ > > > && N_MAGIC(x) != NMAGIC \ > > > > Gr{oetje,eeting}s, > > Geert > > Best, > наб > > -- >8 -- > Subject: [PATCH] a.out: restore CMAGIC > > Part of UAPI and the on-disk format: > this means that it's not a magic number per magic-number.rst, > and it's best to leave it untouched to avoid breaking userspace > and suffer the same fate as a.out in general > > Fixes: commit 53c2bd679017 ("a.out: remove define-only CMAGIC, > previously magic number") > Signed-off-by: Ahelenia Ziemiańska > --- > include/uapi/linux/a.out.h | 3 +++ > 1 file changed, 3 insertions(+) Thanks, I'll take this through my tree as it has the offending commit in it. greg k-h