The problem the Calibre has is not unique but is common to everyone who tries to use connected advanced technology to a Linux computer. This includes ebook readers, smart phones, and digital camera. As time goes by, we can expect the variety of embedded Linux devices to grow. Think of this scenario: You buy a new TV that has embedded Internet so you can watch streaming video. It has a bug and the seller has provided a mechanism for you to apply a patch via a USB connection to your laptop. If you can mount this device in user space then you can upgrade the TV without requiring root access to your computer.
I am an embedded system engineer and I know the risk of allowing user space application permission to modify hardware control registers. There are ways to deal with this at the hardware level which have not been used in personal computing devices like laptops or desktop computers. The most effective one that would apply to this situation is the process/userID aware memory-management-unit (MMU) which is starting to appear in safety-critical embedded designs. This tags each address space accessible by the CPU with which user or process is allowed to access it. Embedded systems use them to restrict control of devices to only those processes that are designated to control the particular devices. A rogue thread on these systems can not accidentally modify someone else's control registers.
How does this relate to this situation? In the current state of Linux, once you are recognized as root, you have access to anything, can modify anything without restriction (whether it makes sense or not). Nothing tells the system what your intentions are so the system can not protect you from doing stupid things. The Kernel does not have fine-grain control at the hardware level to allow access to only certain hardware at certain times. It can only decide it you may control hardware directly or not. If it decides that you can control hardware then you have access to all hardware without restriction.
It is not really possible to put the restrictions into the Kernel at this time because there is no uniform hardware architecture that would allow this to be done by establishing common policies. The mechanism might be put into place but it would have to be customised but each brand and model of hardware out there. (not gonna happen). These smart MMUs provide a mechanism that gives the system enough fine-grain control at the hardware level to make user space control of plug-in devices safe and practical. They can eliminate the need to be root in order to control a device.
Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds