*/
#include <linux/module.h>
+#include <linux/moduleparam.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/fdtable.h>
#include <linux/math64.h>
#include <linux/task_io_accounting_ops.h>
+#include <linux/security.h>
#define DEBUG 0
#define PAGE_TO_KB(x) ((x) << (PAGE_SHIFT - 10))
static struct proc_dir_entry* proc_file;
+static char *blacklist[10] = {0, };
+static int blacklist_c = 0;
+module_param_array(blacklist, charp, &blacklist_c, 0000);
static u64 time_now(void)
{
unsigned long long vm_rss, total_ram;
struct task_io_accounting task_ioac;
unsigned int open_fds;
+ u32 secid;
+ char *label;
+ u32 label_len;
+ int blacklisted;
+ int i;
rcu_read_lock();
continue;
}
+ security_cred_getsecid(((struct cred *)task->real_cred), &secid);
+ if (!security_secid_to_secctx(secid, &label, &label_len)) {
+ blacklisted = 0;
+ for (i = 0; i < blacklist_c; i++) {
+ if (strcmp(label, blacklist[i]) == 0) {
+ blacklisted = 1;
+ break;
+ }
+ }
+ if (blacklisted) {
+ task_unlock(task);
+ continue;
+ }
+ }
/* Memory */
vm_rss = get_mm_rss(task->mm);