All of lore.kernel.org
 help / color / mirror / Atom feed
From: Allen Webb <allenwebb@google.com>
To: "linux-modules@vger.kernel.org" <linux-modules@vger.kernel.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: gregkh@linuxfoundation.org, mcgrof@kernel.org,
	christophe.leroy@csgroup.eu, nick.alcock@oracle.com,
	Allen Webb <allenwebb@google.com>
Subject: [PATCH v10 00/11] Generate modules.builtin.alias from match ids
Date: Thu,  6 Apr 2023 14:00:19 -0500	[thread overview]
Message-ID: <20230406190030.968972-1-allenwebb@google.com> (raw)
In-Reply-To: <20221219204619.2205248-1-allenwebb@google.com>

Generate modules.builtin.alias from match ids

This patch series (v10) generates `modules.builtin.alias` during modpost.
The goal is for tools like USBGuard to leverage not only modules.aliases
but also `modules.builtin.aliases` to associate devices with the modules
that may be bound before deciding to authorize a device or not. This is
particularly useful in cases when new devices of a particular type
shouldn't be allowed part of the time like for lock screens.

Also included in this series are added documentation, style fixes and
fixes for build breakages for built-in modules that relied on
MODULE_DEVICE_TABLE being a no-op. Some of these were typos in
device table name that do not need aliases and one ifdef-ed out the
device table.

---

Generate modules.builtin.alias from match ids
=============================================

This series (v10) removes the `cc:stable` commit tags since the fixes
only are needed going forward. It also includes documentation updates
and unifies the MODULE_DEVICE_TABLE macro for both the builtin and
module case.

Additionally, rather than fixing the typo-ed device table names the
commits were updated to drop the broken MODULE_DEVICE_TABLE
invocations, since they belong to device types that would not benefit
from the intended purpose of `modules.builtin.alias`.

Note, cover letters were first added in v5.

  RFC (broken patch): https://lore.kernel.org/lkml/CAJzde042-M4UbpNYKw0eDVg4JqYmwmPYSsmgK+kCMTqsi+-2Yw@mail.gmail.com/
  v1 (missing v1 label): https://lore.kernel.org/lkml/20221111152852.2837363-1-allenwebb@google.com/
  v2 (missing v2 label): https://lore.kernel.org/lkml/20221128201332.3482092-1-allenwebb@google.com/
  v3: https://lore.kernel.org/lkml/20221129224313.455862-1-allenwebb@google.com/
  v4: https://lore.kernel.org/lkml/20221130221447.1202206-1-allenwebb@google.com/
  v5: https://lore.kernel.org/lkml/20221201211630.101541-1-allenwebb@google.com/
  v6: https://lore.kernel.org/lkml/20221202224540.1446952-1-allenwebb@google.com/
  v7: https://lore.kernel.org/lkml/20221216221703.294683-1-allenwebb@google.com/
  v8: https://lore.kernel.org/lkml/20221219191855.2010466-1-allenwebb@google.com/
  v9: https://lore.kernel.org/lkml/20221219204619.2205248-1-allenwebb@google.com/
  v10: This version

Patch series status
-------------------

This series should be close to ready.

Acknowledgements
----------------

Thanks to Greg Kroah-Hartman, Christophe Leroy, Luis Chamberlain and the
other Linux maintainers for being patient with me as I have worked
through learning the kernel workflow to get this series into a more
presentable state.

Thanks to Luis Chamberlain for raising the alternative of using kmod to
address the primary motivation of the patch series.

Thanks to Dmitry Torokhov and Benson Leung for feedback on the
USB authorization documentation for the driver API.

Also, thanks to Intel's kernel test robot <lkp@intel.com> for catching
issues that showed up with different kernel configurations.

Allen Webb (11):
  rockchip-mailbox: Remove unneeded MODULE_DEVICE_TABLE
  scsi/BusLogic: Always include device id table
  stmpe-spi: Fix MODULE_DEVICE_TABLE entries
  module.h: MODULE_DEVICE_TABLE for built-in modules
  modpost: Track module name for built-in modules
  modpost: Add -b option for emitting built-in aliases
  file2alias.c: Implement builtin.alias generation
  build: Add modules.builtin.alias
  Documentation: Include modules.builtin.alias
  Documentation: Update writing_usb_driver for built-in modules
  Documentation: add USB authorization document to driver-api

 .gitignore                                    |  1 +
 .../driver-api/usb/authorization.rst          | 71 ++++++++++++++
 Documentation/driver-api/usb/index.rst        |  1 +
 .../driver-api/usb/writing_usb_driver.rst     |  3 +
 Documentation/kbuild/kbuild.rst               |  7 ++
 Makefile                                      |  1 +
 drivers/mailbox/rockchip-mailbox.c            |  1 -
 drivers/mfd/stmpe-spi.c                       |  1 -
 drivers/scsi/BusLogic.c                       |  2 -
 include/linux/module.h                        | 36 ++++++--
 scripts/Makefile.modpost                      | 15 +++
 scripts/mod/file2alias.c                      | 92 ++++++++++++++-----
 scripts/mod/modpost.c                         | 30 +++++-
 scripts/mod/modpost.h                         |  2 +
 14 files changed, 229 insertions(+), 34 deletions(-)
 create mode 100644 Documentation/driver-api/usb/authorization.rst

-- 
2.39.2


  parent reply	other threads:[~2023-04-06 19:01 UTC|newest]

Thread overview: 102+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAJzde06+FXNpyBzT+NfS2GCfqEERMkGDpdsmHQj=v1foLJW4Cw@mail.gmail.com>
2022-11-29 22:43 ` [PATCH v3] modules: add modalias file to sysfs for modules Allen Webb
2022-11-30  7:06   ` Greg Kroah-Hartman
2022-11-30 22:14     ` [PATCH v4] " Allen Webb
2022-12-01  4:33       ` kernel test robot
2022-12-01  6:06       ` Greg Kroah-Hartman
2022-12-01  9:46       ` kernel test robot
2022-12-08  2:34   ` [PATCH v3] " Luis Chamberlain
2022-12-08 14:22     ` Allen Webb
2022-12-08 15:20       ` Greg Kroah-Hartman
2022-12-16 22:16         ` [PATCH v7 0/5] Generate modules.builtin.alias from match ids Allen Webb
2022-12-16 22:16           ` [PATCH v7 1/5] module.h: MODULE_DEVICE_TABLE for built-in modules Allen Webb
2022-12-17  3:49             ` kernel test robot
2022-12-17  3:59             ` kernel test robot
2022-12-17  4:50             ` kernel test robot
2022-12-17 10:05             ` Christophe Leroy
2022-12-19 15:56               ` Allen Webb
2022-12-16 22:17           ` [PATCH v7 2/5] modpost: Track module name " Allen Webb
2022-12-17 10:08             ` Christophe Leroy
2022-12-16 22:17           ` [PATCH v7 3/5] modpost: Add -b option for emitting built-in aliases Allen Webb
2022-12-17 10:10             ` Christophe Leroy
2022-12-16 22:17           ` [PATCH v7 4/5] file2alias.c: Implement builtin.alias generation Allen Webb
2022-12-17  0:47             ` kernel test robot
2022-12-17  3:09             ` kernel test robot
2022-12-17 10:13             ` Christophe Leroy
2022-12-16 22:17           ` [PATCH v7 5/5] build: Add modules.builtin.alias Allen Webb
2022-12-19 19:18           ` [PATCH v8 0/9] Generate modules.builtin.alias from match ids Allen Webb
2022-12-19 19:18             ` [PATCH v8 1/9] imx: Fix typo Allen Webb
2022-12-19 19:21               ` Greg Kroah-Hartman
2022-12-19 19:55                 ` Allen Webb
2022-12-19 19:18             ` [PATCH v8 2/9] rockchip-mailbox: " Allen Webb
2022-12-19 19:18             ` [PATCH v8 3/9] scsi/BusLogic: Always include device id table Allen Webb
2022-12-19 19:18             ` [PATCH v8 4/9] stmpe-spi: Fix typo Allen Webb
2022-12-19 19:18             ` [PATCH v8 5/9] module.h: MODULE_DEVICE_TABLE for built-in modules Allen Webb
2022-12-19 19:18             ` [PATCH v8 6/9] modpost: Track module name " Allen Webb
2022-12-19 19:18             ` [PATCH v8 7/9] modpost: Add -b option for emitting built-in aliases Allen Webb
2022-12-19 19:18             ` [PATCH v8 8/9] file2alias.c: Implement builtin.alias generation Allen Webb
2022-12-19 19:18             ` [PATCH v8 9/9] build: Add modules.builtin.alias Allen Webb
2022-12-19 20:06             ` [PATCH v8 0/9] Generate modules.builtin.alias from match ids Luis Chamberlain
2022-12-19 20:42               ` Allen Webb
2022-12-19 20:46             ` [PATCH v9 00/10] " Allen Webb
2022-12-19 20:46               ` [PATCH v9 01/10] imx: Fix typo Allen Webb
2022-12-19 21:23                 ` Luis Chamberlain
2022-12-20  6:42                 ` Greg Kroah-Hartman
2022-12-20 14:26                   ` Allen Webb
2022-12-20 14:32                     ` Greg Kroah-Hartman
2022-12-20 14:45                       ` Allen Webb
2022-12-19 20:46               ` [PATCH v9 02/10] rockchip-mailbox: " Allen Webb
2022-12-20  6:46                 ` Greg Kroah-Hartman
2022-12-20 14:58                   ` Allen Webb
2022-12-20 18:12                     ` Luis Chamberlain
2022-12-20 18:19                       ` Allen Webb
2022-12-20 18:47                         ` Luis Chamberlain
2022-12-20 19:49                           ` Allen Webb
2022-12-20 20:03                             ` Luis Chamberlain
2022-12-20 21:57                               ` Allen Webb
2022-12-20 23:09                                 ` Luis Chamberlain
2022-12-27 17:42                                   ` Allen Webb
2023-01-10  0:25                                     ` Luis Chamberlain
2023-01-09 11:54                           ` Nick Alcock
2023-01-10 18:20                             ` Allen Webb
2022-12-19 20:46               ` [PATCH v9 03/10] scsi/BusLogic: Always include device id table Allen Webb
2022-12-19 20:46               ` [PATCH v9 04/10] stmpe-spi: Fix typo Allen Webb
2022-12-19 20:46               ` [PATCH v9 05/10] module.h: MODULE_DEVICE_TABLE for built-in modules Allen Webb
2022-12-20  6:45                 ` Greg Kroah-Hartman
2022-12-20 16:36                   ` Allen Webb
2022-12-19 20:46               ` [PATCH v9 06/10] modpost: Track module name " Allen Webb
2022-12-19 20:46               ` [PATCH v9 07/10] modpost: Add -b option for emitting built-in aliases Allen Webb
2022-12-20  6:43                 ` Greg Kroah-Hartman
2022-12-20 17:32                   ` Allen Webb
2022-12-19 20:46               ` [PATCH v9 08/10] file2alias.c: Implement builtin.alias generation Allen Webb
2022-12-19 20:46               ` [PATCH v9 09/10] build: Add modules.builtin.alias Allen Webb
2022-12-19 20:46               ` [PATCH v9 10/10] docs: Include modules.builtin.alias Allen Webb
2022-12-19 20:49                 ` Allen Webb
2022-12-19 21:23                 ` Luis Chamberlain
2022-12-19 21:40                   ` Allen Webb
2022-12-19 22:07                     ` Luis Chamberlain
2022-12-19 22:20                       ` Allen Webb
2022-12-19 22:51                         ` Luis Chamberlain
2022-12-19 20:46               ` [PATCH v9 10/10] Documentation: " Allen Webb
2023-04-06 19:00               ` Allen Webb [this message]
2023-04-06 19:00                 ` [PATCH v10 01/11] rockchip-mailbox: Remove unneeded MODULE_DEVICE_TABLE Allen Webb
2023-04-06 19:00                 ` [PATCH v10 02/11] scsi/BusLogic: Always include device id table Allen Webb
2023-04-06 19:00                 ` [PATCH v10 03/11] stmpe-spi: Fix MODULE_DEVICE_TABLE entries Allen Webb
2023-05-24  6:52                   ` Luis Chamberlain
2023-05-24  6:52                   ` Luis Chamberlain
2023-04-06 19:00                 ` [PATCH v10 04/11] module.h: MODULE_DEVICE_TABLE for built-in modules Allen Webb
2023-05-24  6:44                   ` Luis Chamberlain
2023-04-06 19:00                 ` [PATCH v10 05/11] modpost: Track module name " Allen Webb
2023-04-20  9:47                   ` Greg KH
2023-05-24  6:50                   ` Luis Chamberlain
2023-04-06 19:00                 ` [PATCH v10 06/11] modpost: Add -b option for emitting built-in aliases Allen Webb
2023-05-24  6:54                   ` Luis Chamberlain
2023-04-06 19:00                 ` [PATCH v10 07/11] file2alias.c: Implement builtin.alias generation Allen Webb
2023-05-24  7:00                   ` Luis Chamberlain
2023-04-06 19:00                 ` [PATCH v10 08/11] build: Add modules.builtin.alias Allen Webb
2023-05-24  7:02                   ` Luis Chamberlain
2023-07-19 19:51                     ` Allen Webb
2023-07-26 18:30                       ` Luis Chamberlain
2023-04-06 19:00                 ` [PATCH v10 09/11] Documentation: Include modules.builtin.alias Allen Webb
2023-04-06 19:00                 ` [PATCH v10 10/11] Documentation: Update writing_usb_driver for built-in modules Allen Webb
2023-04-06 19:00                 ` [PATCH v10 11/11] Documentation: add USB authorization document to driver-api Allen Webb
2023-04-20  9:51                   ` Greg KH

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=20230406190030.968972-1-allenwebb@google.com \
    --to=allenwebb@google.com \
    --cc=christophe.leroy@csgroup.eu \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-modules@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=nick.alcock@oracle.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.