Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp3666399ybh; Tue, 17 Mar 2020 04:25:15 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsblU1tFVAvemDlVM03h0uAHTgRj3LjP2+0uU7KPGL3TCDiStUadNcW8TsQ/gnULtqKlGun X-Received: by 2002:aca:ecd0:: with SMTP id k199mr3213394oih.60.1584444315490; Tue, 17 Mar 2020 04:25:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584444315; cv=none; d=google.com; s=arc-20160816; b=h4axoEJJzjc3XhQjVWcuJl26vCuw+mwFpGedWbSkyHnRO3KhQHCpEzPxJ4gxDTJKnh KoHovc4FDm+5oYysUcChrcf76pCmvV5N7BVAE0tg1x9IMuU2khVE9pVGIrPJ4s+0gouw PRZTzjAyYOzAYuwztWNlvYDiSu51i72UcNmJ2xzr0xdqMQaQs7bzNwepAV7tIidpYSaF pIqAiZ7lbxGX5/GzNPC9K9Le0+8Lkm6YygX85CVrbjUcMyh8w94v2pX31FBblCpCDopt NoueVFCVa7i8CzOEDuCMPKQ44Jo/ejzagbVL7ig8/LiSIe3XE0cdUL5edupc2A5rV9HV /aHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=GaGdl8pgY44OKNN30+xVpu/sgpjCpuysfuKAf9fBIcA=; b=BfgaDfAeoNgWzGXnuvyjtT3ddUiJVR6ye/vxm0CupZOi8iRhcCjlKBcA9Qw+2pAn0B wB3oM/JEAzuBGVVENTrnZIl0ECjqxP4lAYyIfcUBsZgansqC+a7kRreQAPC/lnI0kF5h T8iwsytn5qPh6XktVbyB8UJtLEzjmfmbz9ap2rKaSYKJAhrTphjbyqLAujUxsKcmWA4t vHcTcGXK0/D3/od3rINm/9vH9d7Iqh75lj/XJbTBLpjGLN239/9kIaEJDFbKrPnIDdtP EJO6ja6KNvL7TYyb18XiIvY8I2BRkt8zcLXsNc3v5ulkb4ErIGOKpodRPJuULlnDtUun Kp4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rzUIlzSB; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f5si1532340otq.73.2020.03.17.04.25.03; Tue, 17 Mar 2020 04:25:15 -0700 (PDT) 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=@kernel.org header.s=default header.b=rzUIlzSB; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726683AbgCQLYo (ORCPT + 99 others); Tue, 17 Mar 2020 07:24:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:37922 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726005AbgCQLYn (ORCPT ); Tue, 17 Mar 2020 07:24:43 -0400 Received: from linux-8ccs (p5B2812F9.dip0.t-ipconnect.de [91.40.18.249]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 20CA72051A; Tue, 17 Mar 2020 11:24:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1584444283; bh=GaGdl8pgY44OKNN30+xVpu/sgpjCpuysfuKAf9fBIcA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rzUIlzSBBTaX4YeDLXeOTa6YgyRsPvHnbJZEalAynpP5TXlqAl1HnGORO6bY4p3NX cq6cTOHPm6xTkN+JyxDKkzORj+v4mg8Fvedr45/hHt/jB/2VjWA5r4o8P8nP/qvqX1 C3xWWl7fozzau6Yg4s/f/b/lhvGeiUqBF54DWjI0= Date: Tue, 17 Mar 2020 12:24:39 +0100 From: Jessica Yu To: Masahiro Yamada Cc: Matthias Maennich , Lucas De Marchi , stable , Linux Kernel Mailing List Subject: Re: [PATCH v2] modpost: move the namespace field in Module.symvers last Message-ID: <20200317112439.GB6841@linux-8ccs> References: <20200311170120.12641-1-jeyu@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: X-OS: Linux linux-8ccs 4.12.14-lp150.12.61-default x86_64 User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org +++ Masahiro Yamada [14/03/20 11:11 +0900]: >On Thu, Mar 12, 2020 at 2:02 AM Jessica Yu wrote: >> >> In order to preserve backwards compatability with kmod tools, we have to >> move the namespace field in Module.symvers last, as the depmod -e -E >> option looks at the first three fields in Module.symvers to check symbol >> versions (and it's expected they stay in the original order of crc, >> symbol, module). >> >> In addition, update an ancient comment above read_dump() in modpost that >> suggested that the export type field in Module.symvers was optional. I >> suspect that there were historical reasons behind that comment that are >> no longer accurate. We have been unconditionally printing the export >> type since 2.6.18 (commit bd5cbcedf44), which is over a decade ago now. >> >> Fix up read_dump() to treat each field as non-optional. I suspect the >> original read_dump() code treated the export field as optional in order >> to support pre <= 2.6.18 Module.symvers (which did not have the export >> type field). Note that although symbol namespaces are optional, the >> field will not be omitted from Module.symvers if a symbol does not have >> a namespace. In this case, the field will simply be empty and the next >> delimiter or end of line will follow. >> >> Cc: stable@vger.kernel.org >> Fixes: cb9b55d21fe0 ("modpost: add support for symbol namespaces") >> Tested-by: Matthias Maennich >> Reviewed-by: Matthias Maennich >> Reviewed-by: Lucas De Marchi >> Signed-off-by: Jessica Yu > > >While I am not opposed to this fix, >I did not even notice Module.symvers was official interface. > >Kbuild invokes scripts/depmod.sh to finalize >the 'make modules_install', but I do not see the -E >option being used there. > >I do not see Module.symvers installed in >/lib/modules/$(uname -r)/. While that's true, distros typically package Module.symvers in their linux-headers/kernel-devel (or equivalent) packages to support external module builds. The -E option is usually used to do symbol versioning/kabi checks with the Module.symvers file. Considering the options, I think it will cause the least headaches down the line to make this fix upstream and maintain backwards compatibility with kmod rather than to patch kmod and remind distros to repackage because old depmod versions don't work with the new Module.symvers anymore.. Thank you! Jessica