at v206 1.0 kB view raw
1diff --git a/kernel/kmod.c b/kernel/kmod.c 2index a689506..30747b4 100644 3--- a/kernel/kmod.c 4+++ b/kernel/kmod.c 5@@ -294,10 +294,8 @@ static int ____call_usermodehelper(void *data) 6 out the path to be used prior to this point and are now operating 7 on that copy 8 */ 9- if ((strncmp(sub_info->path, "/sbin/", 6) && strncmp(sub_info->path, "/usr/lib/", 9) && 10- strncmp(sub_info->path, "/lib/", 5) && strncmp(sub_info->path, "/lib64/", 7) && 11- strncmp(sub_info->path, "/usr/libexec/", 13) && strncmp(sub_info->path, "/usr/bin/", 9) && 12- strcmp(sub_info->path, "/usr/share/apport/apport")) || strstr(sub_info->path, "..")) { 13+ if ((strncmp(sub_info->path, "/sbin/", 6) && strncmp(sub_info->path, "/nix/store/", 11) && 14+ strncmp(sub_info->path, "/run/current-system/systemd/lib/", 32)) || strstr(sub_info->path, "..")) { 15 printk(KERN_ALERT "grsec: denied exec of usermode helper binary %.950s located outside of permitted system paths\n", sub_info->path); 16 retval = -EPERM; 17 goto out;