kernel-modules-hook icon indicating copy to clipboard operation
kernel-modules-hook copied to clipboard

Copying modules to /tmp?

Open alexdewar opened this issue 4 years ago • 2 comments

This is just a suggestion, but how about copying the module files to /tmp and then just creating a symlink to it? That way a) it'll be faster and b) the files will automatically get cleaned on next boot and you won't need a separate service to do this.

alexdewar avatar Oct 18 '20 09:10 alexdewar

I have several concerns about this:

  1. Users might have a script to clean out /tmp periodically, or they might not have a tmpfs mounted on /tmp. The first case would render this package useless; the second would defeat the purpose of a move to /tmp.
  2. If a system is running low on memory, copying potentially several hundred megabytes of files to /tmp could make the system run out of memory.
  3. The fact that /tmp is world-writable creates major security concerns regarding how the files are copied. Specifically, the script (which runs as root) would need to be careful not to reuse an existing directory that was created by another process, or unprivileged users could potentially load arbitrary kernel modules..
  4. You would still need to clean up the symlink on the next reboot.

cptpcrd avatar Oct 18 '20 12:10 cptpcrd

I'm pretty sure that solves your issue: https://github.com/graysky2/anything-sync-daemon

JeanMax avatar Mar 07 '21 00:03 JeanMax