aircrack-ng / rtl8812au

RTL8812AU/21AU and RTL8814AU driver with monitor mode and frame injection

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Kernel Oops "Incompatible netdev->dev_addr

fariouche opened this issue · comments

Hello,

Since some time ago, there is a check in the kernel to avoid direct copy of the mac addr. The reason is that it breaks the kernel rbtree and setting the mac address must be done through the helper function.

I didn't checked your module, but just looking at the code, I see this helper that still uses memcpy.

#define dev_addr_set(netdev, ethdata) _rtw_memcpy(netdev->dev_addr, ethdata, ETH_ALEN)

You have to change this code to use the helper function, like so:
#define dev_addr_set(netdev, ethdata) eth_hw_addr_set(netdev, ethdata)

I'm not using this driver as is, so this is not test on your repo, but this fixed the error using my fork.
You may add a kernel version check depending on the kernel version you want to support. This modification was introduce in the kernel 5.17.0

I believe this is the same error as #1075 (but he didn't include the begining of the crash dump)

The kernel module is so clean now compared to what it used to be !! 🥇