Public bug reported:

The source code below is a absolute minimal kernel driver for Ubuntu 24.05.LTS 
kernel 6.7.0.
Using insmod and rmmod you can successfully load\unload the driver, e.g.
sudo insmod ch34x_pis.ko

However.... if you change the unused function name to read
"ch34x_fops_read(void)"

insmod fails with the following error --->
insmod: ERROR: could not insert module ch34x_pis.ko: Invalid parameters

and in dmesg log --->
[12287.351993] BPF: [123685] FUNC 34x_fops_read 
[12287.352001] BPF: type_id=1249
[12287.352002] BPF:  
[12287.352004] BPF: Invalid name
[12287.352005] BPF: 
[12287.352007] failed to validate module [ch34x_pis] BTF: -22


NOTE - the BPF error message says "34x_fops_read" ... and not the actual name 
of "ch34x_fops_read".


Source code (compiled using kernel 6.7.0) ---->

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/usb.h>

int XXXch34x_fops_read(void)
{
        return 0;
}

const struct usb_device_id table[] = 
{
    { }
};

MODULE_DEVICE_TABLE(usb, table);

static struct usb_driver duff_driver =
{
    .name       = "DUFF",
    .id_table   = table,
};

module_usb_driver(duff_driver);

MODULE_LICENSE("GPL");

** Affects: ubuntu
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2115120

Title:
  insmod fail due to function name starting with ch

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+bug/2115120/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to