Should a bad USB device handle a Linux kernel error?

My question is quite broad, I know, but I have been thinking about this for a long time.

A bit of background. I work in a physics lab where Debian (a combination of the old version and Lenny) or, most recently, Ubuntu 10.4 LTS is running on all lab computers. We have written a lot of special software for interacting with experiment equipment and other computers.

We have many FPGA boards that control various parts of the experiment, they connect via USB to various computers. After updating the computer that controls the experiment, we began to see crashes / locks on the computer on which all the lasers are running. It was completely stable.

My question is this: if the whole computer is blocked due to a problem with a) Python / GTK gui software b) USB device driver or c) Can the actual device be blamed on the Linux kernel (or other OS levels)?

Is it unfair to ask the linux kernel not to panic even if I am mistaken in my software / hardware implementation.

My own guess: any user-level applications will never be able to destroy the entire system, since they should only have access to their own materials.

Any device driver becomes part of the kernel itself and therefore can disable it. Is my judicious sound?

Bonus question: is there a way to isolate the device and the kernel in one way or another so that Linux continues to work happily no matter what stupid errors are made using hardware. This would be very useful for two reasons: 1) debugging is easier with the system running, 2) For the purposes of the experiment, we really need long breaks and only part of the system failure is infinitely better than failures in one part of the system that extends to the rest.

Any links and reading material on this subject will be appreciated. Thanks.

+6
source share
1 answer

You are right that unprivileged code cannot crash the system if there is no kernel error. However, the line between unprivileged and privileged is not quite the same as user space versus kernel. A user-mode program can open /dev/kmem and delete internal data structures of the operating system if the user account has superuser privileges.

To isolate the main core from problems with device drivers, run the device driver inside the virtual machine.

Several popular VM systems, including VMWare Workstation, support forwarding an arbitrary USB device from host to guest without a device driver on the host.

+3
source

Source: https://habr.com/ru/post/913245/


All Articles