summary refs log tree commit diff
path: root/pkgs/os-specific/linux/kernel/grsec-path.patch
blob: 6f59cf8d80bd755d6c9b39cee28bc57f2de49134 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/kernel/kmod.c b/kernel/kmod.c
index 67f7981..03f127d 100644
--- a/kernel/kmod.c
+++ b/kernel/kmod.c
@@ -246,9 +246,9 @@ static int ____call_usermodehelper(void *data)
 	   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) &&
-	     strncmp(sub_info->path, "/lib/", 5) && strncmp(sub_info->path, "/lib64/", 7) &&
-	     strcmp(sub_info->path, "/usr/share/apport/apport")) || strstr(sub_info->path, "..")) {
+	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 /sbin and system library paths\n", sub_info->path);
 		retval = -EPERM;
 		goto fail;