Hi all.

Problem solved. Kernel misconfiguration.

It's simple and clear. At least for anyone who knows details regarding different security options in ChromeOS and Debian.

SystemTap for the win! Probing parameters for call_modprobe(), argv[0] for call_usermodehelper_setup() and the return value of call_usermodehelper_exec() via "stap" [1] shows the problem: ENOENT on /sbin/usermode-helper. This file is non-existent in Debian but ChromeOS uses it to filter all application calls from kernel- to userspace.

Solution is a change in the kernel config:
- CONFIG_STATIC_USERMODEHELPER=y
- CONFIG_STATIC_USERMODEHELPER_PATH="/sbin/usermode-helper"
+ # CONFIG_STATIC_USERMODEHELPER is not set

Because I didn't find the solution via both of my favourite search engines I write this mail for archive purposes. Maybe someone else with a similar problem in the future finds the solution via internet search...
(therefore the full quote!)

[1] not fancy but works (I'm no SystemTap expert):
stap -ve 'probe kernel.function("call_modprobe") { printf("%s\n", $$parms$) }' stap -ve 'probe kernel.function("call_usermodehelper_setup") { printf("%s\n", $argv[0]$) }' stap -ve 'probe kernel.function("call_usermodehelper_exec").return { retval=$return; printf("%s\nretval:%d\n", $$return$, retval) }'

regards
hede


Am 20.09.2022 15:39, schrieb hede:
hi all.

Am 19.09.2022 16:27, schrieb hede:
I need help getting module on-demand-loading working with a custom kernel.

Additional information:

My problem seems less related to udev but more probably related the
kernel kmod subsystems!?

The kernel usually calls /sbin/modprobe if functionality is missing.
Check kmod.c in kernel sources. If I create a file modprobe.fake [1]
and modify /proc/sys/kernel/modprobe to call this file, a standard
Debian shows the same behaviour than my Chromebook: If fat/vfat
modules are not loaded and I try to mount some fat filesystem
afterwards this fails with the same error message.

But while a standard Debian system obviously calls the fake modprobe
command (as it creates the txt file) the Chromebook does NOT do so.

[1]
### /usr/local/bin/modprobe.fake ###
#!/bin/sh
date >> /tmp/modprobe.txt
echo "$@" >> /tmp/modprobe.txt
exit 1
### (chmod +x)

default config on Chromebook:
###
root@cbtest:~# cat /proc/sys/kernel/modules_disabled
0
root@cbtest:~# cat /proc/sys/kernel/modprobe
/sbin/modprobe
###

still searching a solution...

hede

Am 19.09.2022 16:27, schrieb hede:
> Hi all.
>
> I need help getting module on-demand-loading working with a custom kernel.
>
> Currently I'm running Debian 11 for x86_64 on a Chromebook in
> developer mode directly via Coreboot/Depthcharge. Not having UEFI or
> classical BIOS boot code means that the default Debian kernel doesn't
> work, right? So I'm using a kernel from the chromiumOS project
> (ChromeOS 5.10) with a custom config.
>
> I do need a patched kernel anyways as there's no UEFI/ACPI but a
> special Chromebook embedded controller for all those fancy sensors and
> a like.
>
> The system is working fine, including wifi, rotation sensors, graphics
> and so on except the on demand kernel module loading doesn't work.
> Running "edevadm monitor" I do get many UEVENTs when plugging in an
> usb stick, for example. The event device system itself does work. But
> trying to mount the filesystem doesn't work as no vfat module gets
> loaded (as an example).
>
> Likewise adding rules via iptables doesn't work, as the netfilter
> modules are missing. I have to manually load the nf* modules and
> _then_ I'm able to use iptables.
>
> I can load all those modules by hand via modprobe, but autoloading via
> kernel/udev doesn't work.
>
> Running "depmod -a" was fine. The files
> /lib/modules/[kernelversions]/modules.* seem(!) also to be ok. "find
> /sys/ -name "uevent" | wc -l" seems also fine with more than a
> thousand results.
>
> When I try for example mounting the fat system without having the vfat
> module ready, on my standard desktop system "udevadm monitor" shows
> events and mount succeeds. But on the Chromebook with custom kernel
> there's no such event shown and mount fails with:
> "mount: /mnt: unknown filesystem type 'vfat'."
> After "modprobe vfat" everything is fine and mount succeeds. Indeed
> the udev events do show when manually running modprobe.
>
> systemd-udevd.service is running. The files in /run/udev/* seem to be
> the same on the desktop (where everything is fine) and Chromebook (not
> working).
>
> Does anyone has an idea how to solve this? Feel free to ask me further
> details of the system. I don't know how the module autoloading works
> so I have no idea which additional information is useful.
>
> regards
> hede
>

Reply via email to