Skip to content

Commit

Permalink
Merge pull request #119 from carloslack/kvdev
Browse files Browse the repository at this point in the history
Block a process name that starts with a number
  • Loading branch information
carloslack authored Oct 14, 2024
2 parents fa2a4b9 + d6f4dbb commit 964fb0e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/kovid.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <linux/kthread.h>
#include <linux/kernel.h>
#include <linux/namei.h>
#include <linux/ctype.h>

#include "lkm.h"
#include "fs.h"
Expand Down Expand Up @@ -558,8 +559,9 @@ static ssize_t write_cb(struct file *fptr, const char __user *user,
char *newname;
pid = (pid_t)simple_strtol(s, NULL, 10);
newname = strrchr(buf, ' ');
if (++newname)
if (newname && ++newname && !isdigit(*newname)) {
kv_rename_task(pid, newname);
}
}
}
proc_timeout(PRC_RESET);
Expand Down

0 comments on commit 964fb0e

Please sign in to comment.