2

Ive been giving this piece of code but it doesn't seem to work.

#include<linux/module.h>

int proc_init (void) {
  printk(KERN_INFO "helloModule: kernel module initialized\n");
  return 0;
}

void proc_cleanup(void) {
  printk(KERN_INFO "helloModule: performing cleanup of module\n");
}

MODULE_LICENSE("GPL");
module_init(proc_init);
module_exit(proc_cleanup);

And this is the given maker file:

CONFIG_MODULE_SIG=n

obj-m += helloModule.o

all:
    make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

clean:
    make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean

I was told if in the maker file I change:

CONFIG_MODULE_SIG=n to CONFIG_MODULE_SIG=0 

it would work but I still get Module verification failed: signature. Here are the full results if it helps:

[ 1092.186460] helloModule: module verification failed: signature and/or required key missing - tainting kernel
[ 1092.188510] helloModule: kernel module initialized
[ 2245.128462] helloModule: performing cleanup of module
[ 2250.667037] helloModule: kernel module initialized
[ 2305.815511] helloModule: performing cleanup of module
[ 2357.490185] helloModule: kernel module initialized
[ 2526.267464] usb 1-1: USB disconnect, device number 2
[ 2526.718539] usb 1-1: new full-speed USB device number 3 using ohci-pci
[ 2527.105378] usb 1-1: New USB device found, idVendor=80ee, idProduct=0021
[ 2527.105388] usb 1-1: New USB device strings: Mfr=1, Product=3, SerialNumber=0
[ 2527.105393] usb 1-1: Product: USB Tablet
[ 2527.105399] usb 1-1: Manufacturer: VirtualBox
[ 2527.152019] input: VirtualBox USB Tablet as /devices/pci0000:00/0000:00:06.0/usb1/1-1/1-1:1.0/0003:80EE:0021.0002/input/input8
[ 2527.232240] hid-generic 0003:80EE:0021.0002: input,hidraw0: USB HID v1.10 Mouse [VirtualBox USB Tablet] on usb-0000:00:06.0-1/input0
[ 2865.057333] helloModule: performing cleanup of module
[ 2888.205365] helloModule: kernel module initialized
[ 3021.971994] helloModule: performing cleanup of module
[ 3045.980743] helloModule: kernel module initialized
[ 3358.220063] helloModule: performing cleanup of module
[ 3438.762378] helloModule: kernel module initialized
[ 3950.763573] helloModule: performing cleanup of module
[ 4001.871200] helloModule: kernel module initialized
[ 4146.644108] helloModule: performing cleanup of module
[ 4230.781248] helloModule: kernel module initialized
[ 4354.724930] helloModule: performing cleanup of module
[ 4356.440943] helloModule: kernel module initialized
[ 4376.318716] helloModule: performing cleanup of module

My ubuntu version is 16.04 LTS

BitByte
  • 43
  • 6
  • Your module is clearly loading if it is able to print those debug messages. What exactly is not working? Your kernel appears to check, but not require, module signatures. – Jonathon Reinhart May 30 '18 at 09:47

0 Answers0