Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1196046pxu; Mon, 23 Nov 2020 14:18:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJzvHmwnTU5VWY8xeN1hvajmZdxotevRZWmnwTfOKLGzdsMmjNzmiXAPu7T4iuOZmpup9NTh X-Received: by 2002:a17:906:3187:: with SMTP id 7mr1616364ejy.225.1606169902422; Mon, 23 Nov 2020 14:18:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606169902; cv=none; d=google.com; s=arc-20160816; b=Qw1JoPpg9Nrd9+se8xcy8mrKfy5IbheVVpQYvuSbvVb9uI6TczmEQyKvrKFBYWYid+ +WG6+t/PHk9R1LUDTFIhziuMiPNvtA9stayRn6xVwQA+dF512Qe2OZSMLmqqt2sRSMM9 ltOX+uGJk7djINWedAUN+VGmoOMsTNU0LbCmQaJ2gYoZF/rbKocYobXw3cApgr8aQ8vv AzQpFMh53AIIHvDP/xVxECEvPEI9Hp/7v0uGIHneN3lLu0Zgiie0BeEe4mRXyYBs5EwM ZYO14y1KtgPPgZ6MSAgiArLFjk4/HGmuYiqkaE6Rrl3p5M5O+JFyR4jb0yepmwYiAuz+ g1rw== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=oYNuHU4bByRHbW04P1rIYsgud3/IFqRbZYnLzDzZeGk=; b=TKlfC+lXTh6cdPK8KiZdM/Nk4yud5JqRaI1LfcswIApYpvltBj3HxCEtHZQq36a4r3 sAn/lCryxUx5ZWSHdLM92nb4D4ifS9WKyWwgzhfimsifEAjJwYcreZoHWk6x50xtFidN 618LhJ3quG9Pym6MrgSUzAekSBi3spF8zlkIhwxexZFm168Lb9/ax2DA8DmfYsAG+fXq Ns+Xp2aW2mzLl5VLPljXyp7ijKSwl+/DH51tmKaO7NtgZGSPOYRPenjpZFApt6YIaBsz y+Wc4FUM/CK3ayOQ9UXTq4vtzJaYzzdR3YWoeld+0m4HoPj4Gsa2vU3MSwGKWewJZVwh inZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=qXPT+DFy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w26si7564102edt.596.2020.11.23.14.17.59; Mon, 23 Nov 2020 14:18:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=qXPT+DFy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731732AbgKWWNm (ORCPT + 99 others); Mon, 23 Nov 2020 17:13:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728895AbgKWWNm (ORCPT ); Mon, 23 Nov 2020 17:13:42 -0500 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 231B9C0613CF for ; Mon, 23 Nov 2020 14:13:42 -0800 (PST) Received: by mail-pl1-x644.google.com with SMTP id s2so9563226plr.9 for ; Mon, 23 Nov 2020 14:13:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=oYNuHU4bByRHbW04P1rIYsgud3/IFqRbZYnLzDzZeGk=; b=qXPT+DFyBceoMCKgzQ4K9krDTGbWS62obotE34ZjBaZKyz2guVj28ejAzO82PJHbJR xc5pZCMC4UzLXN8l/mmynG7HfDtKAYh4dhlJCWzIN+HIdt+MzNXMtU3GFMAzJ7KMkUT0 GNRVe+hd7HbXBM1BLIDcpB8jVpThu9VF4Pz8q56Dmi94TRgLk/dAJcUjef7aDgc/4LGE wr5nFtl5XIRNu1Y0I8lMKeFITYhS7poM1SMEJeKWctX5LSlknUeL0iWxhzQBshqr92E+ q02Sb6MF7NEAL3fR5zUR4xOJ6O9lOYDeEAlQztbT610E/Hj1x7JcqqxE0ZpqWV4P2vo9 CCUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=oYNuHU4bByRHbW04P1rIYsgud3/IFqRbZYnLzDzZeGk=; b=LujU0Yg+B5Q+bFeo1uSzkgb/hSN0ZtNiLxOSkRZBkVIipTqgwUN1K7Mqx08upZSivi aQN3lYoE3W24MN2PnDdzH8xQLmDMazrYv2q0Jv5b1geR84qQ9C9zVAannq7E/URCiPMQ z72751lhbjRpgIOWdQcSdKJlZp4S03miZCyMRJf8oegZLD7w5LxkqHINMCPMlVVgHZK9 5/Cy0zMiZMBQRdopXVhkmDEkhMWhm3ebjpsW+dZgMuVCHFez4RfWmOrEA9LK0t2OejB4 OkoLC86MaGZOls2u1VCvzuWyn7aYHnaI8P383Uybcqd6wmKd/u5alAIRh2wqLc2gKVho QyTw== X-Gm-Message-State: AOAM530WMxV3tb0WE6X/n/APxSg43nxf8dEnGqgrtJWs1BbB+5Q2iils wPM1EValxOBIFRcTLetbZcURNA== X-Received: by 2002:a17:902:b68a:b029:d8:d387:3d04 with SMTP id c10-20020a170902b68ab02900d8d3873d04mr1243192pls.62.1606169621497; Mon, 23 Nov 2020 14:13:41 -0800 (PST) Received: from google.com (h208-100-161-3.bendor.broadband.dynamic.tds.net. [208.100.161.3]) by smtp.gmail.com with ESMTPSA id q72sm13002681pfq.62.2020.11.23.14.13.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Nov 2020 14:13:40 -0800 (PST) Date: Mon, 23 Nov 2020 14:13:38 -0800 From: William Mcvicker To: Christoph Hellwig Cc: Jessica Yu , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, kernel-team@android.com, Greg Kroah-Hartman , Saravana Kannan Subject: Re: [PATCH v1 0/2] Add support to capture external module's SCM version Message-ID: <20201123221338.GA2726675@google.com> References: <20201121011652.2006613-1-willmcvicker@google.com> <20201123090257.GB6334@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201123090257.GB6334@infradead.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 23, 2020 at 09:02:57AM +0000, Christoph Hellwig wrote: > On Sat, Nov 21, 2020 at 01:16:49AM +0000, Will McVicker wrote: > > These two patches add module support to capture an external module's SCM > > version as a MODULE_INFO() attribute. This allows users to identity the SCM > > version of a given kernel module by using the modinfo tool or on the device > > via sysfs: > > As this obviously is of no use for in-tree modules it falls under the we > don't add code to support things that are not in tree rule and has no > business in the kernel. Hi Christoph, Ah sorry, I didn't intend this to come across as only for external modules. That just seemed like the easiest way to explain how the scmversion attribute can be different from the vermagic. We mainly need this for in-tree kernel modules since that's where most our drivers are. Let me re-phrase this with that in mind. Basically, I like to look at this as an improved version of the existing srcversion module attribute since it allows you to easily identify the module version with a quick SCM version string check instead of doing a full checksum on the module source. For example, we have a setup to test kernel changes on the hikey and db845c devices without updating the kernel modules. Without this scmversion module attribute, you can't identify the original module version using `uname -r`. And for kernel modules in the initramfs, you can't even use modinfo to get the module vermagic. With this patch, you are able to get the SCM version for *all* kernel modules (on disk and in the initramfs) via the sysfs node: /sys/module//scmversion. This also works the other way around when developers update their kernel modules to fix some bug (like a security vulnerability) but don't need to update the full kernel. Regarding the documentation, Greg, thanks for pointing out Documentation/ABI/! I seached high and low for documentation on the other module sysfs attributes, but couldn't find anything. I'll update the proper documentation in the v2 patchset. Thanks, Will