2015-03-29 17:36:37 +00:00
|
|
|
diff --git a/kernel/kmod.c b/kernel/kmod.c
|
2015-04-15 23:21:02 +00:00
|
|
|
index a689506..30747b4 100644
|
2015-03-29 17:36:37 +00:00
|
|
|
--- a/kernel/kmod.c
|
|
|
|
+++ b/kernel/kmod.c
|
2016-02-27 15:13:08 +00:00
|
|
|
@@ -294,11 +294,8 @@ static int ____call_usermodehelper(void *data)
|
2013-11-26 22:08:51 +00:00
|
|
|
out the path to be used prior to this point and are now operating
|
|
|
|
on that copy
|
|
|
|
*/
|
|
|
|
- if ((strncmp(sub_info->path, "/sbin/", 6) && strncmp(sub_info->path, "/usr/lib/", 9) &&
|
2014-03-15 16:31:39 +00:00
|
|
|
- strncmp(sub_info->path, "/lib/", 5) && strncmp(sub_info->path, "/lib64/", 7) &&
|
2015-04-15 23:21:02 +00:00
|
|
|
- strncmp(sub_info->path, "/usr/libexec/", 13) && strncmp(sub_info->path, "/usr/bin/", 9) &&
|
2016-02-27 15:13:08 +00:00
|
|
|
- strncmp(sub_info->path, "/usr/sbin/", 10) &&
|
2014-03-15 16:31:39 +00:00
|
|
|
- strcmp(sub_info->path, "/usr/share/apport/apport")) || strstr(sub_info->path, "..")) {
|
2015-04-15 23:21:02 +00:00
|
|
|
+ if ((strncmp(sub_info->path, "/sbin/", 6) && strncmp(sub_info->path, "/nix/store/", 11) &&
|
|
|
|
+ strncmp(sub_info->path, "/run/current-system/systemd/lib/", 32)) || strstr(sub_info->path, "..")) {
|
|
|
|
printk(KERN_ALERT "grsec: denied exec of usermode helper binary %.950s located outside of permitted system paths\n", sub_info->path);
|
2013-11-26 22:08:51 +00:00
|
|
|
retval = -EPERM;
|
2015-03-29 17:15:31 +00:00
|
|
|
goto out;
|