6/3/2023 0 Comments Cpt for ipack blockStatic inline void module_remove_driver(struct device_driver *drv) +++ -175,6 +175,14 static inline void module_add_driver(struct module *mod, Obj-$(CONFIG_SYS_HYPERVISOR) += hypervisor.oĭiff -git a/drivers/base/base.h b/drivers/base/base.h +obj-$(CONFIG_MODULES) += mod_devicetable.o module.o Kernel/module/sysfs.c | 100 ++++++++++++++ġ0 files changed, 409 insertions(+), 1 deletion(-)Ĭreate mode 100644 drivers/base/mod_devicetable.cĭiff -git a/drivers/base/Makefile b/drivers/base/Makefile Patch adds a sys-fs attribute to both builtin and loaded modulesĮxposing the matching rules in the modalias format for integration However, builtin kernel modules are not covered. This information is readily available for external modules in Would be helpful when building these systems to be able to know inĪdvance which kernel drivers (or modules) are reachable from a User-space to implement trust-based systems for enabling USB devices. USB devices support the authorized attribute which can be used by Subject: modules: add modalias file to sysfs for modules. I did keep theĬode limited to a single file so that it could possibly be compiled inīoth environments, but type sizing of structs will be tricky forįrom fc8855454debb520a9d28031a825bc48852ccc1a Mon Sep 17 00:00:00 2001 Share code between build-time userspace and the kernel. Like a viable option I could go back and implement PCI and any otherĪdditionally, I haven't refactored files2alias to not have duplicateĬode, but I am not sure how feasible that is given we would need to I only implemented USB for the proof-of-concept, but if this looks The authorized attribute (USB, PCI, maybe others). However, the only modules that really benefitįrom this are ones with drivers associated with buses that make use of There are some flaws with this design in that some modaliases are notĪssociated with a bus. With the kernel data structures available. Time the modalias attribute is read, but it shouldn't be that oftenĪnd I didn't see a better way of doing it though I am not familiar I don't really like that it has to walk all drivers for all buses each Patch for this I could post as an alternative or in addition if it is One other approach I considered was generating a builtin.alias file atīuild time which would be installed alongside modules.alias. ![]() ![]() This is particularly useful inĬases when new devices shouldn't be allowed part of the time like for Like USBGuard could leverage not only modules.aliases, but also theĪliases for the builtin modules to match devices with drivers beforeĭeciding to authorize a device or not. To inform policy decisions in userspace for devices with theĪuthorized attribute in sysfs. ![]() This patch is to expose the driver matching values from the modalias ![]() I have a somewhat rough patch that introduces a modalias sysfsĪttribute to kernel modules (both builtin and loaded). My apologies for any process mistakes in submitting this as it is myįirst ever attempt at a Linux kernel patch. 9:59 ` Christophe Leroy 0 siblings, 2 replies 21+ messages in thread Patch to exposing modalias'es for built in kernel modules (USB) LKML Archive on help / color / mirror / Atom feed * Patch to exposing modalias'es for built in kernel modules (USB) 22:21 Allen Webb
0 Comments
Leave a Reply. |