Re: [PATCH 01/18] liveupdate: Export symbols needed by modules

From: Christoph Hellwig

Date: Thu Dec 03 2026 - 02:53:46 EST


On Wed, Dec 02, 2026 at 09:22:05AM -0800, David Matlack wrote:
> On Tue Dec 1, 2026 at 11:18 PM PST, Christoph Hellwig wrote:
> > On Wed, Dec 02, 2026 at 12:39:38AM +0000, David Matlack wrote:
> >> From: Vipin Sharma <vipinsh@xxxxxxxxxx>
> >>
> >> Export liveupdate_register_file_handler() and
> >> liveupdate_unregister_file_handler() so that drivers built as modules
> >> can register Live Update file handlers.
> >
> > I don't see any such driver in this series. And the diea of allowing
> > reandom drivers to register this information feels wrong.
>
> The user in this series is the test driver added in patch 10
> (tools/testing/selftests/liveupdate/modules/luo_pci_test_driver.c),

Which of course does not count as a user. It's just code you make up,
not real code.

> which the selftests build as a module and load in the kernel. The other
> user will be vfio-pci, from the VFIO Live Update series, which is where
> this patch comes from:
>
> https://lore.kernel.org/kvm/20260714151505.3466855-1-vipinsh@xxxxxxxxxx/
>
> To address the concern about random drivers, I see two options:
>
> A. Restrict these exports to the modules that need them, i.e.
> EXPORT_SYMBOL_FOR_MODULES(..., "vfio-pci,luo_pci_test_driver").
>
> B. Make the test driver built-in, behind a Kconfig option like the
> existing CONFIG_LIVEUPDATE_TEST, and drop this patch from this
> series. vfio-pci would still need exports though.
>
> Can you say more about what your concern is?

The concern is to add dangerous exports without in-tree actual users.

> Is it mainly about which
> modules can call these functions, or about drivers registering Live
> Update file handlers at all? If it's the latter, I'd like to understand
> it, since that's how drivers like vfio-pci are expected to preserve

The main concert is adding it without a real user, which is a complete
no-go. But even with a user like vfio-pci (which should have been part
of the series) this looks dangerous enough to not be exported globally.

---end quoted text---