Unfortunately the patch doesn't work anymore after removing this section. I found the comment in the file. The section looks like this:
- Code: Select all
@@ -152,6 +150,20 @@ int __request_module(bool wait, const char *fmt, ...)
if (ret)
return ret;
+#ifdef CONFIG_GRKERNSEC_MODHARDEN
+ if (uid_eq(current_uid(), GLOBAL_ROOT_UID)) {
+ /* hack to workaround consolekit/udisks stupidity */
+ read_lock(&tasklist_lock);
+ if (!strcmp(current->comm, "mount") &&
+ current->real_parent && !strncmp(current->real_parent->comm, "udisk", 5)) {
+ read_unlock(&tasklist_lock);
+ printk(KERN_ALERT "grsec: denied attempt to auto-load fs module %.64s by udisks\n", module_name);
+ return -EPERM;
+ }
+ read_unlock(&tasklist_lock);
+ }
+#endif
+
/* If modprobe needs a service that is in a module, we get a recursive
* loop. Limit the number of running kmod threads to max_threads/2 or
* MAX_KMOD_CONCURRENT, whichever is the smaller. A cleaner method
I removed the part in the ifdef, so it looks like this:
- Code: Select all
@@ -152,6 +150,20 @@ int __request_module(bool wait, const char *fmt, ...)
if (ret)
return ret;
+#ifdef CONFIG_GRKERNSEC_MODHARDEN
+#endif
+
/* If modprobe needs a service that is in a module, we get a recursive
* loop. Limit the number of running kmod threads to max_threads/2 or
* MAX_KMOD_CONCURRENT, whichever is the smaller. A cleaner method
By applying the patch i get the following error:
- Code: Select all
patch: **** malformed patch at line 145516: @@ -180,16 +192,61 @@ int __request_module(bool wait, const char *fmt, ...)
which is the section directly afterwards. Am I missing something? Wheres my error in the modified file?
(so you could also manually modprobe the relevant module as root, and that should work around it as well)
Which module(s) would I have to load with modprobe?