Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp184874rwb; Mon, 26 Sep 2022 10:53:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6YzAWGUuPRqM/6YLufZQnUc6fupPkPjOofpItxhbw8o3acCUQU/Ajm9kqTjHdUfPYl2jTm X-Received: by 2002:a05:6402:5507:b0:452:183f:16d1 with SMTP id fi7-20020a056402550700b00452183f16d1mr24085522edb.96.1664214785407; Mon, 26 Sep 2022 10:53:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664214785; cv=none; d=google.com; s=arc-20160816; b=ks2aUZMGV2TnA1gpIFLkwYZTvJ5vCm1H1pD6fYOE7IgJkKA8W1y4q+bR+SoiF1l2Fo KeAO/7liJk6dio62G2+hT5mk8Z8GlR9nkpEyaE7HQDnZYInkxjbTqOYRC/twV4jIimQn WomZc91pfDnilpz191E7qwrdGZ9pkjbO1IZkUwWfwlLsJ5JPQrFof/05NRRn5q5aEPhQ k7eTjnayP78XcT/aDsjasU74eTo15bc4zXb3iDRygyDPiFvBya7GwTNH/6myqWuTmBzL xaRsJcpqFy8/OxjgdMcbeLDEHGoAV75/xQQVpRn35Lq6s7igBIgTaiaY3hZOViLbBIfc UU3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=FuDoAhUih77p+eFMc/wgERFaCHzR/FtdOrLLLNe+ocs=; b=P16PfPtz5KCJz3RXg6rRBRlbDs01PecmSViLZV8i68ABzDvVnRI3nJXlOGEhhtysn7 dMquOziC6g340rCE2DoMNz9qRjJbj7i2MLkKfVBBcBxIywQJapB4L+m7KyHZ7wbMuE1q f6IBkiQj2qO49VaQyAGTkPh9csuhmE/7IfGK915jH5CObOpeI5q8Ig7Z9sI0RCY9bAyq olufxJ0t+8v122S4CfHCx1HqdMuuvVIKVTLfwwQQ97orCySnCX5jlsUL5+Uc9yB7+5hW g8iYnFV47PHtW/d5mSkUZm8lFl58DdtbdozFZoWIhRWU+aIH4ixNsznwn15+ftHyfCmP hQgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XYuMgLFP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c26-20020a056402159a00b004576b5c858csi1483124edv.19.2022.09.26.10.52.40; Mon, 26 Sep 2022 10:53:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XYuMgLFP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230475AbiIZR3i (ORCPT + 99 others); Mon, 26 Sep 2022 13:29:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230477AbiIZR3P (ORCPT ); Mon, 26 Sep 2022 13:29:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C48D12EDB9; Mon, 26 Sep 2022 09:47:05 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 6EAB561046; Mon, 26 Sep 2022 16:47:04 +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> X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 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