Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7272238rwb; Tue, 15 Nov 2022 09:49:23 -0800 (PST) X-Google-Smtp-Source: AA0mqf7DYFlnn+VZjFisPkM4HPEqxLMkMqeDjdGzYZXU8E9QmKQilTAD9cHf4HOL8eH4yT5SBDc5 X-Received: by 2002:a50:9f61:0:b0:463:b8dc:893f with SMTP id b88-20020a509f61000000b00463b8dc893fmr16461883edf.28.1668534563119; Tue, 15 Nov 2022 09:49:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668534563; cv=none; d=google.com; s=arc-20160816; b=eHWx2MKo/xy+oRDTRDI8LUsXaWH9aaW1YtzAA9ghXgNcEZxfH8BrTm0r0Y3p1J7Fni rvXMolfzNiTuxoSbaWC0CwHpRwZ7Ykw27xBX9inYtEPMyC6jwWpGIy3ih6hYdRIWBNi8 7JD37PpXB81SNc5k6Tp2gAZVqEl9P1NYldXG+z5EYLOCgS14Qa2v0s07hrlEb264tDSV 5kFVNHwS0pcCzsnvwK/n51OeQDeFaxB2M9teaKPnibp5pMdNFmgeSaihO6MsFROP/2T/ SmSnVAzNHp8dK95az5MmVui6yzJ5zbuQRc9m6nXTVzwQtHAMm4fogcvlsbLi+FLOSMAU rxVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=xKJI9SOGNy34zKV8aehb6R2QO5TFVEQr7/jH6rpCfbc=; b=QlKbU2+8cLDlccOauUidriSwCKPIgLREt6IlTG79RgQGylNamEb9HIZyElnqTBVi39 bhwwVXf8CVA+BNB6o6OZUvEytCceOnH+G+t6x5CNGZjqvM3TkRJXzxEPstB1hU2xrJAP 5pLVkgLQWuX2JVIUBeMWLuYyEkP4J3El1avUWtw/W2z3Wps0fsCTuWmWrLX9XRNdJUSf 45HbKTktDcwRQOmyV0f2QQSn6IjHFku63xX6INTP2nTGMrHnSJe4Vwaij3hR65ets4UA WRvF8q8KYALQIsV+e4tpjacun8qTahmUjtt3hGzhES0q0Gqs9yHWsgPrwJJ2G77Txtuh 1zTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=XKXMfCzb; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p13-20020a056402500d00b0045a11b60c57si12337530eda.121.2022.11.15.09.49.00; Tue, 15 Nov 2022 09:49:23 -0800 (PST) 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=@infradead.org header.s=bombadil.20210309 header.b=XKXMfCzb; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230215AbiKORf3 (ORCPT + 90 others); Tue, 15 Nov 2022 12:35:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229656AbiKORf1 (ORCPT ); Tue, 15 Nov 2022 12:35:27 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 565A918360; Tue, 15 Nov 2022 09:35:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=xKJI9SOGNy34zKV8aehb6R2QO5TFVEQr7/jH6rpCfbc=; b=XKXMfCzbqhX3BPrpS3eldTlN3y sNzfSKUTAT58GfygdyU2TitFCkkqI2QUNl3FttQv5+sYM53sn/sSiO3GUgZbxUAZLnGutQAqQbxYQ h9Vo0n4UWJxuBfohz6/KK8OL9sXv0/S7ummuzP/gcSNPrs2zhfM1xr4/K/kTI60L/4ND8T1sonuRk S9EWB/ddfCNQ+t0EbXL1Rgv0PJ4LXJQ9VGW1oarIBWLh/woBg8OfmZ2QhijQKIlq8qGlqY4bv3Aor mHO/9Vr/Ko4LgE5RERDnvIMhJnu0B4RN6EScZ7PWF7TNV6MaQ1gkOeVvrBn8YHl0f6FXyu0RosuC8 458//vHw==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1ouzq4-00DWPE-P0; Tue, 15 Nov 2022 17:35:12 +0000 Date: Tue, 15 Nov 2022 09:35:12 -0800 From: Luis Chamberlain To: Allen Webb Cc: Lucas De Marchi , Alexey Gladkov , Christophe Leroy , Greg Kroah-Hartman , "linux-modules@vger.kernel.org" , "linux-usb@vger.kernel.org" , "Rafael J. Wysocki" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] modules: add modalias file to sysfs for modules. Message-ID: References: <20221111152852.2837363-1-allenwebb@google.com> <20221114172214.ilnk5wj3eevpsqts@ldmartin-desk2.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Luis Chamberlain X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE 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 Tue, Nov 15, 2022 at 10:05:35AM -0600, Allen Webb wrote: > On Mon, Nov 14, 2022 at 11:22 AM Lucas De Marchi > wrote: > > > > On Mon, Nov 14, 2022 at 10:42:50AM -0600, Allen Webb wrote: > > >On Fri, Nov 11, 2022 at 12:29 PM Luis Chamberlain wrote: > > >> > > >> On Fri, Nov 11, 2022 at 09:28:52AM -0600, Allen Webb wrote: > > >> > USB devices support the authorized attribute which can be used by > > >> > user-space to implement trust-based systems for enabling USB devices. It > > >> > would be helpful when building these systems to be able to know in > > >> > advance which kernel drivers (or modules) are reachable from a > > >> > particular USB device. > > >> > > > >> > This information is readily available for external modules in > > >> > modules.alias. However, builtin kernel modules are not covered. This > > >> > patch adds a sys-fs attribute to both builtin and loaded modules > > >> > exposing the matching rules in the modalias format for integration > > >> > with tools like USBGuard. > > >> > > > >> > Signed-off-by: Allen Webb > > >> > > >> Thanks for the patch Allen! > > >> > > >> I'd rather have something generic though, and it would seem kmod [0] already > > >> does this, have you seen the kmod support for builtin.alias.bin > > >> > > >> Can't that be used? > > > > > >Probably, but I don't see the builtin.alias.bin in my build. Is it experimental? > > > > no. That is generated by depmod since v27 using modules.builtin.modinfo > > generated by the kernel build system. Highly recommend v30 though > > as there were fixes in v28 and v29 and some changes to speed up its > > generation/use in v30: See entries mentioning > > builtin.alias and bultin.modinfo in > > https://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git/tree/NEWS > > > > libkmod/modprobe/modinfo also have the corresponding changes to lookup that > > index when resolving aliases. > > I see the file but it is largely missing the aliases I am interested > in, so it looks like I might need to modify my patch that creates > buildin.alias to add the missing alias defines in the header along > with the other module metadata for builtin modules. Does this sound > right to you? Can you clarify what is missing and why? And an RFC is welcomed if it helps demonstrates what you mean. Luis