From: Sapan Bhatia <gwsapan@gmail.com>
Date: Fri, 8 Nov 2013 22:19:09 +0000 (-0500)
Subject: Guarded against some hypothetically possible errors
X-Git-Tag: procprotect-0.4-3~2
X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=45362125880411ebb94253979d98df1b04a3e02c;p=procprotect.git

Guarded against some hypothetically possible errors
---

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;