Quantcast
Channel: Active questions tagged kernel-modules - Unix & Linux Stack Exchange
Viewing all articles
Browse latest Browse all 1184

How can I break at module_init()? This loadable kernel module is preventing SSH logins

$
0
0

I am porting the driver for a USB device to Rocky Linux 9.3. Once the module is inserted, new logins by ssh are unresponsive. Blacklisting the module and rebooting restores normal functionality.

https://github.com/izot/lon-driver


With the module inserted, lsmod|grep u50 "Used By" goes from 0 to 1 about every 7 secs. Then, when an SSH login is attempted, Used By goes between 3 and 2.

Stop the SSH login, modprobe -r u50, try again...Now SSH gets motd but no prompt and says "PTY allocation request failed on channel 0."

ssh SITE "/bin/bash -i" (login succeeds) (same with module inserted)

modinfo u50

filename:       /lib/modules/5.14.0-362.18.1.el9_3.x86_64/kernel/drivers/lon/u50.kodescription:    U50 SMIP Driver 1.4 L2alias:          tty-ldisc-28license:        GPLrhelversion:    9.3srcversion:     311B898EC0CC268466EA85Bdepends:retpoline:      Yname:           u50vermagic:       5.14.0-362.18.1.el9_3.x86_64 SMP preempt mod_unload modversions

With the module removed, journalctl shows "error: openpty: Cannot allocate memory" and "error: session_pty_req: session 0 alloc failed."

With the module inserted again and an SSH attempt, journalctl shows "NetworkManager ... manager: (lon10): new Generic device (/org/freedesktop/NetworkManager/Devices/743)" and "NetworkManager ... manager: (lon11): new Generic device (/org/freedesktop/NetworkManager/Devices/744)."

When the SSH attempt is canceled, journalctl shows "Removing a network device that was not added" twice.


I finally have gdb setup to remotely debug. I copied the src to the host running gdb. I can break at a function in the loadable module but that is too late. I need to break when the module is loaded and it kills new ssh logins. This module is for USB and is not related to ssh.

I can break at do_init_module() and step until exit_to_user_mode_loop() then it says "Cannot find bounds of current function." Setting a breakpoint at module_init() for a future load does not break.


Viewing all articles
Browse latest Browse all 1184

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>