You are not logged in.

#1 2019-04-26 05:24:40

jimjamz
Member
From: Nagasaki, Japan
Registered: 2016-04-04
Posts: 90

Failure to Insert Modules into Kernel

I have a USB Wi-FI adapter (TP Link TL-WN722N v3.0 - Realtek chipset) that, by default, does not support Monitor mode.
However, there is a kernel module that fixes that:
https://github.com/mfruba/kernel

I've ran the `make`, `make install` and followed the installation procedures for both `modprobe` and `insmod` as root user.
However, after rebooting, the Monitor mode is still not supported:

Error for wireless request "Set Mode" (8B06) :
    SET failed on device wlx503aee96fa3a ; Invalid argument.

The .ko is there because if I try to insert it again, it says the file exists.

`lsmod | grep 8188` also tells me it's there:

8188eu               1052672  0
r8188eu               421888  0
cfg80211              589824  5 brcmsmac,b43,mac80211,r8188eu,8188eu
usbcore               253952  10 uvcvideo,usbhid,bcm5974,ehci_hcd,ohci_pci,r8188eu,btusb,ohci_hcd,8188eu,ehci_pci

However, `lib80211` does not make any reference to r8188eu:

lib80211               16384  0

Is there another way to tell if the module is really loaded into the kernel?

Last edited by jimjamz (2019-04-26 05:27:35)

Offline

#2 2019-04-26 05:35:52

hhh
That's it!
Registered: 2015-09-17
Posts: 7,450
Website

Re: Failure to Insert Modules into Kernel

Moving to "Kernel and Hardware"

hhh, moderator

Offline

#3 2019-04-26 05:39:34

hhh
That's it!
Registered: 2015-09-17
Posts: 7,450
Website

Re: Failure to Insert Modules into Kernel

jimjamz wrote:

Is there another way to tell if the module is really loaded into the kernel?

See if it works? monkey

Offline

#4 2019-04-26 05:53:28

jimjamz
Member
From: Nagasaki, Japan
Registered: 2016-04-04
Posts: 90

Re: Failure to Insert Modules into Kernel

I found the following drivers, but it only seems compatible for Ubuntu and Mint:
https://www.tp-link.com/us/support/down … v3/#Driver

Maybe a silly question, but is it safe/wise to insert kernel modules compiled for other distributions?

Offline

#5 2019-04-26 21:45:11

stevep
MX Linux Developer
Registered: 2016-08-08
Posts: 364

Re: Failure to Insert Modules into Kernel

jimjamz wrote:

I found the following drivers, but it only seems compatible for Ubuntu and Mint:
https://www.tp-link.com/us/support/down … v3/#Driver

Maybe a silly question, but is it safe/wise to insert kernel modules compiled for other distributions?

They list multiple kernels supported, which means that they are source code only, and must be compiled. They don't list the 4.9 kernel as being supported, so they may not build.

Looking at that github, they have Realtek drivers in a Ralink folder, so that doesn't really make me confident about other possible problems. 

Can you get that device working without monitor mode?

Offline

#6 2019-04-27 07:14:31

ohnonot
...again
Registered: 2015-09-29
Posts: 3,671
Website

Re: Failure to Insert Modules into Kernel

jimjamz wrote:

Maybe a silly question, but is it safe/wise to insert kernel modules compiled for other distributions?

it shouldn't be catastrophical if you do it only manually with modprobe.
[ famous last words big_smile be sure you're not working on anything important in case you need to cold reboot big_smile ]

Offline

#7 2019-04-27 14:51:38

DeepDayze
Member
From: In Linux Land
Registered: 2017-05-28
Posts: 647

Re: Failure to Insert Modules into Kernel

ohnonot wrote:
jimjamz wrote:

Maybe a silly question, but is it safe/wise to insert kernel modules compiled for other distributions?

it shouldn't be catastrophical if you do it only manually with modprobe.
[ famous last words big_smile be sure you're not working on anything important in case you need to cold reboot big_smile ]

Forcing a kernel module to load (especially if written for another distro) may lead to disaster...so yes be warned  devil


Real Men Use Linux

Offline

#8 2019-04-27 16:28:30

twoion
ほやほや
Registered: 2015-08-10
Posts: 2,393

Re: Failure to Insert Modules into Kernel

The kernel/modprobe has some sanity checks guarding against inserting modules that may not be compatible with the current kernel:

       --force-vermagic
           Every module contains a small string containing important information, such as the kernel and compiler
           versions. If a module fails to load and the kernel complains that the "version magic" doesn't match, you
           can use this option to remove it. Naturally, this check is there for your protection, so using this option
           is dangerous unless you know what you're doing.

           This applies to any modules inserted: both the module (or alias) on the command line and any modules on
           which it depends.

       --force-modversion
           When modules are compiled with CONFIG_MODVERSIONS set, a section detailing the versions of every
           interfaced used by (or supplied by) the module is created. If a module fails to load and the kernel
           complains that the module disagrees about a version of some interface, you can use "--force-modversion" to
           remove the version information altogether. Naturally, this check is there for your protection, so using
           this option is dangerous unless you know what you're doing.

           This applies any modules inserted: both the module (or alias) on the command line and any modules on which
           it depends.

--force covers both. So if you think you know what're doing modprobe --force $bad_incompatible_module will do its thing and may crash or twist kernel operations.


A silent kite against the blue, blue sky

Offline

#9 2019-04-27 23:38:44

DeepDayze
Member
From: In Linux Land
Registered: 2017-05-28
Posts: 647

Re: Failure to Insert Modules into Kernel

twoion wrote:

The kernel/modprobe has some sanity checks guarding against inserting modules that may not be compatible with the current kernel:

       --force-vermagic
           Every module contains a small string containing important information, such as the kernel and compiler
           versions. If a module fails to load and the kernel complains that the "version magic" doesn't match, you
           can use this option to remove it. Naturally, this check is there for your protection, so using this option
           is dangerous unless you know what you're doing.

           This applies to any modules inserted: both the module (or alias) on the command line and any modules on
           which it depends.

       --force-modversion
           When modules are compiled with CONFIG_MODVERSIONS set, a section detailing the versions of every
           interfaced used by (or supplied by) the module is created. If a module fails to load and the kernel
           complains that the module disagrees about a version of some interface, you can use "--force-modversion" to
           remove the version information altogether. Naturally, this check is there for your protection, so using
           this option is dangerous unless you know what you're doing.

           This applies any modules inserted: both the module (or alias) on the command line and any modules on which
           it depends.

--force covers both. So if you think you know what're doing modprobe --force $bad_incompatible_module will do its thing and may crash or twist kernel operations.

Or such module can fail with an error that it can't find some symbol (one result of a mismatch between a module and kernel interface). But yes it CAN crash a kernel and I've had kernel panics that happens immediately when force-loading a module that is incompatible.


Real Men Use Linux

Offline

#10 2019-05-03 06:07:46

jimjamz
Member
From: Nagasaki, Japan
Registered: 2016-04-04
Posts: 90

Re: Failure to Insert Modules into Kernel

stevep wrote:
jimjamz wrote:

I found the following drivers, but it only seems compatible for Ubuntu and Mint:
https://www.tp-link.com/us/support/down … v3/#Driver

Maybe a silly question, but is it safe/wise to insert kernel modules compiled for other distributions?

They list multiple kernels supported, which means that they are source code only, and must be compiled. They don't list the 4.9 kernel as being supported, so they may not build.

Looking at that github, they have Realtek drivers in a Ralink folder, so that doesn't really make me confident about other possible problems. 

Can you get that device working without monitor mode?

I was able to get the device working without monitor mode, as there is a rtl8188 driver already installed in BL.
I had to remove that (and all realtek wireless drivers to be sure) before cloning, building and installing the following:
https://github.com/ail603601/rtl8188eus

This allowed me to build my own .ko and following the guide, this was inserted using insmod.
The device now works in monitor mode.

Offline

Board footer

Powered by FluxBB