Welcome to the Linux Foundation Forum!

hello_world: loading out-of-tree module taints kernel. hello_world: module verification failed: sign

Posts: 3

I was able to resolve the second one by signing the module using scripts/sign-file

I understand what the first line is saying but the problem is that
im not getting the output printed when i insert the module for first time

im only getting these errors when i insert for the first time

when i remove this module and reinsert the module, both init and exit functions are getting executed (logging in dmesg)

is this common, can i skip the warning or resolve it

Best Answer

  • Posts: 2
    Answer ✓

    @kevinpaul468 If you're seeing your output from the init and exit functions in dmesg at the same time, it's usually because you're not adding a newline character at the end of your printk(). It has nothing to do with the signing. Make sure you include a '\n', like this:

    1. pr_info("foo\n");

    Even from userspace, this still happens:

    1. echo -n test | sudo tee /dev/kmsg > /dev/null && sudo dmesg | tail -1 | grep test # nothing shows up
    2. echo test | sudo tee /dev/kmsg > /dev/null && sudo dmesg | tail -2 | grep test # both "test" messages get printed out

    Why? Simply because messages without a trailing newline can be continued, just like when you call pr_cont(). This behavior is managed by the vprintk_store() function:

    1. /* A message without a trailing newline can be continued. */
    2. if (!(flags & LOG_NEWLINE))
    3. prb_commit(&e);
    4. else
    5. prb_final_commit(&e);

Answers

  • Posts: 7
    edited February 18

    I recommend trying to resolve it. Could you share the code of your kernel module, especially the init and exit functions? Can you provide the complete logs (dmesg) from both the first insertion and the reinsertion of the module? pls =)

  • Thanks a lot bro, i really thought i messed up something real bad
    now, i understand where i was wrong

    you are correct, i was not printing the \n at the end of the stirngs

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Categories

Upcoming Training