Bypass SELinux limitations related to loading kernel modules

The possibility of bypassing the prohibition of loading kernel modules, implemented in targeted SELinux rules on one of the studied devices, was demonstrated (it is not specified which device it is and how much the problem affects SELinux rules in firmware and distributions). Blocking modules in the SELinux rules involved was based on restricting access to the finit_module system call, which allows you to load a module from a file and is used in utilities such as insmod. However, the SELinux rules did not consider the init_module system call, which can also be used to load kernel modules directly from a buffer in memory.

To demonstrate the method, an exploit prototype has been prepared that allows you to execute code at the kernel level by loading your module and completely disable SELinux protection, if you have root access to the system limited using SELinux.

Source: opennet.ru

Add a comment