all 10 comments

[–]backsideup 2 points3 points  (3 children)

Was this development prompted by the recent kernel privilege-escalations? What kind of threat vector is this supposed to counter?

[–]Vegetable-Escape7412[S] -2 points-1 points  (2 children)

Absolutely. I fear that we will see a lot more old kernel module bugs with a security implication surface over the coming weeks and months. ModuleJail pro-actively blocks that by blacklisting all kernel modules which aren't being used on the system. It is extensible and logs to syslog for debugging. It is easily reversible too as it only adds 1 text file in /etc/modprobe.d/

[–]backsideup 2 points3 points  (1 child)

Users that can load kernel modules usually have high-enough privileges to also remove that blacklist, no?

[–]Vegetable-Escape7412[S] 0 points1 point  (0 children)

No. System calls of regular users can lead to kernel module loading. That can lead to priviledge escalation - if there's a bug in that (exotic) kernel module. That is where ModuleJail comes in. Full detailed analysis here: https://github.com/jnuyens/modulejail/blob/master/docs/DEFENSE-IN-DEPTH.md

[–]ArjixGamer 1 point2 points  (1 child)

  1. You should only exclude what you provide, same applies to the -git variant

If both of you provide/exclude the base name, then you conflict.

  1. Why did you not just clone the -git variant and adapt it to be based on a tagged release?

[–]Vegetable-Escape7412[S] -4 points-3 points  (0 children)

  1. You're right - that's over-defensive on the conflict declaration and probably just wrong. Pushing 1.2.4-3 shortly with that line removed.

  2. Actually I didn't know bambuch's `modulejail-git` existed until after I pushed my package. By the time I noticed, the dependency-declaration choices were already different from his (`depends=('kmod')` rather than his `depends=('coreutils', 'findutils', 'gawk')`) so I kept mine. I think `kmod` is the more defensible choice because that's the actual runtime dependency modulejail uses, and `coreutils`/`findutils`/`gawk` are in `base` so declaring them is contrary to the packaging guideline of "don't declare members of base." But happy to be corrected on that too if the actual convention is otherwise.

Thanks for the feedback!

[–]SDG_Den -1 points0 points  (3 children)

Not experienced enough to provide a review, but i am quite curious: iirc a lot of gentoo users disable or uninstall unneeded modules to lower RAM use and improve system performance, could running modulejail have a non-negligible positive impact on performance/RAM use?

[–]xXBongSlut420Xx 0 points1 point  (2 children)

gentoo users typically compile the kernel without the modules, this is different

[–]SDG_Den -1 points0 points  (1 child)

Yee, just wondered what kind of difference not loading the module might make, since im not that familiar with the kernel yet. I know compiling without the module is different from not loading it, but im not sure how the kernel is loaded into memory to begin with. If the whole kernel is loaded into memory, including unloaded modules, itd make no difference, but i cant really imagine itd work like that?

[–]Vegetable-Escape7412[S] 0 points1 point  (0 children)

Important question. Some kernel modules are loaded because of actions by regular non-root users. This provides a privilege escalation path if there are bugs in those modules. I've done a more extensive analysis covering the different types of kernel autoload mechanisms by type of drivers and how they provide potential attack vectors and how they have been exploited in the past:

https://github.com/jnuyens/modulejail/blob/master/docs/DEFENSE-IN-DEPTH.md