From 45362125880411ebb94253979d98df1b04a3e02c Mon Sep 17 00:00:00 2001 From: Sapan Bhatia Date: Fri, 8 Nov 2013 17:19:09 -0500 Subject: [PATCH] Guarded against some hypothetically possible errors --- Makefile | 2 +- procprotect.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 97aa044..0a9e45e 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ ARCH=$(shell uname -m) DIST=fc18 ifeq ($(wildcard /lib/modules/$(KVER)/build),) - KVER=3.10.6-100.$(DIST).$(ARCH) + KVER=3.11.4-101.$(DIST).$(ARCH) endif all: diff --git a/procprotect.c b/procprotect.c index 741a799..1c3e803 100644 --- a/procprotect.c +++ b/procprotect.c @@ -94,12 +94,14 @@ static int lookup_fast_entry(struct kretprobe_instance *ri, struct pt_regs *regs struct dentry *parent; struct inode *pinode; - if (!nd) return; + if (!nd) return ret; parent = nd->path.dentry; - if (!parent) return; + if (!parent) return ret; pinode = parent->d_inode; + if (!pinode || !pinode->i_sb || !current || !current->nsproxy) return ret; + if (pinode->i_sb->s_magic == PROC_SUPER_MAGIC && current->nsproxy->mnt_ns!=init_task.nsproxy->mnt_ns) { ctx = (struct procprotect_ctx *) ri->data; -- 2.43.0