Guarded against some hypothetically possible errors
Sapan Bhatia [Fri, 8 Nov 2013 22:19:09 +0000 (17:19 -0500)]
Makefile
procprotect.c

index 97aa044..0a9e45e 100644 (file)
--- 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:
index 741a799..1c3e803 100644 (file)
@@ -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;