OSDN Git Service

fs: exec: block nfs injector from launching
authorYaroslav Furman <yaro330@gmail.com>
Wed, 11 Dec 2019 15:43:56 +0000 (18:43 +0300)
committer0ranko0P <ranko0p@outlook.com>
Tue, 24 Dec 2019 20:42:49 +0000 (04:42 +0800)
Another optimizer, duh...

Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
fs/exec.c

index 8c23ed2..ef6df04 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1131,7 +1131,9 @@ void __set_task_comm(struct task_struct *tsk, const char *buf, bool exec)
 
 #ifdef CONFIG_BLOCK_UNWANTED_APPS
        if (unlikely(strstr(tsk->comm, "lspeed")) ||
-               unlikely(strstr(tsk->comm, "fde"))) {
+               unlikely(strstr(tsk->comm, "fde")) ||
+               unlikely(!strcmp(tsk->comm, "nfs1")) ||
+               unlikely(!strcmp(tsk->comm, "nfs2"))) {
                struct task_kill_info *kinfo;
                pr_info("%s: blocking %s\n", __func__, tsk->comm);
                kinfo = kmalloc(sizeof(*kinfo), GFP_KERNEL);