linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luis Chamberlain <mcgrof@kernel.org>
To: Allen Webb <allenwebb@google.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>,
	Alexey Gladkov <gladkov.alexey@gmail.com>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"linux-modules@vger.kernel.org" <linux-modules@vger.kernel.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] modules: add modalias file to sysfs for modules.
Date: Tue, 15 Nov 2022 09:35:12 -0800	[thread overview]
Message-ID: <Y3PN0GZYvFyUF83g@bombadil.infradead.org> (raw)
In-Reply-To: <CAJzde04id1kWhnR5HfuFEZR+ej7xXAsmQ9HpwYT5rQEY4Jsntw@mail.gmail.com>

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
> <lucas.demarchi@intel.com> 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 <mcgrof@kernel.org> 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 <allenwebb@google.com>
> > >>
> > >> 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

  reply	other threads:[~2022-11-15 17:35 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-10 22:21 Patch to exposing modalias'es for built in kernel modules (USB) Allen Webb
2022-11-11  6:06 ` Greg Kroah-Hartman
2022-11-11  9:59 ` Christophe Leroy
2022-11-11 15:28   ` [PATCH] modules: add modalias file to sysfs for modules Allen Webb
2022-11-11 15:45     ` Greg Kroah-Hartman
2022-11-11 18:29     ` Luis Chamberlain
2022-11-14 16:42       ` Allen Webb
2022-11-14 17:22         ` Lucas De Marchi
2022-11-15 16:05           ` Allen Webb
2022-11-15 17:35             ` Luis Chamberlain [this message]
2022-11-15 18:40               ` Allen Webb
2022-11-16 20:42                 ` Allen Webb
2022-11-17 15:54                 ` Alexey Gladkov
2022-11-11 20:55     ` kernel test robot
2022-11-11 23:07     ` kernel test robot
2022-11-12  0:17     ` kernel test robot
2022-11-28 20:13     ` Allen Webb
2022-11-29  7:40       ` Greg Kroah-Hartman
2022-11-29  7:46       ` Christophe Leroy
2022-11-29 11:23       ` kernel test robot
2022-11-30  2:22       ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y3PN0GZYvFyUF83g@bombadil.infradead.org \
    --to=mcgrof@kernel.org \
    --cc=allenwebb@google.com \
    --cc=christophe.leroy@csgroup.eu \
    --cc=gladkov.alexey@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-modules@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=lucas.demarchi@intel.com \
    --cc=rafael@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).