Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FS#573 - Unloading rt2800soc crashes rt3052 based devices #7096

Closed
openwrt-bot opened this issue Mar 1, 2017 · 4 comments
Closed

FS#573 - Unloading rt2800soc crashes rt3052 based devices #7096

openwrt-bot opened this issue Mar 1, 2017 · 4 comments
Labels

Comments

@openwrt-bot
Copy link

tsys:

On LEDE trunk rt3052 based devices (and all other devices using rt2800 wireless chipset) crash whenever you try to unload rt2800soc. This happens because patch 604-rt2x00-load-eeprom-on-SoC-from-a-mtd-device-defines-.patch interferes with 602-rt2x00-introduce-rt2x00eeprom.patch. In 602 the struct rt2x00_dev is extended by the member eeprom_file. In its initialisation function rt2x00lib_request_eeprom_file eeprom_file is either initialized with a firmware struct from request_firmware or keeps being NULL if an error occurs. Patch 604 hooks into rt2x00lib_request_eeprom_file by the function rt2800lib_read_eeprom_mtd. rt2800lib_read_eeprom_mtd fills eeprom_file with a statically declared struct firmware if loading from the mtd partition succeeds. Now, when we come to uninitialization patch 602s rt2x00lib_free_eeprom_file is called. This function assumes that eeprom_file was dynamically allocated and calls release_firmware(eeprom_file) even if patch 604 allocated it statically. This leads to release_firmware kfree-ing eeprom_file although it was never kmalloced, resulting in a kernelpanic.

@openwrt-bot
Copy link
Author

mkresin:

Thanks a lot for the report and the detailed analysis. Would it be possible that you send a patch according to [[https://lede-project.org/docs/guide-developer/the-source-code#submitting_patches|submitting patches guideline]] to get this bug fixed?

@openwrt-bot
Copy link
Author

tsys:

Yeah, sure. I'll see what I can do

EDIT: Patch and PR created: lede-project/source#907

@openwrt-bot
Copy link
Author

tsys:

Mathias, could you please take a look at the pull request for this bug? lede-project/source#907

@openwrt-bot
Copy link
Author

manawyrm:

I just encountered this bug and can confirm the issue.

root@LEDE:~# rmmod rt2800soc
packet_write_wait: Connection to 192.168.1.1 port 22: Broken pipe
[tobias@tobias-arch ~]$

unloading the module on a fresh installation of the stable LEDE release causes the system to freeze and crash instantly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant