]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE14-initialize-i-security-20040816
authorKris Van Hees <aedil@alchar.org>
Wed, 25 Aug 2004 08:04:05 +0000 (08:04 +0000)
committerDerrick Brashear <shadow@dementia.org>
Wed, 25 Aug 2004 08:04:05 +0000 (08:04 +0000)
modern 2.6 kernels with i_security need this such that if the i_security field got garbage-collected out from under us we don't deref a null pointer.

(cherry picked from commit e6c7148abed9f88d6dd83ce8dba77a434cce231a)

src/afs/LINUX/osi_vnodeops.c

index ab516a17c964ff0e63c86255b032255509ca2180..8c69a2af11581196fed0f248a8a2551618df2d6e 100644 (file)
@@ -1085,6 +1085,12 @@ afs_linux_lookup(struct inode *dip, struct dentry *dp)
            printk
                ("afs_linux_lookup: ip->i_mode 0x%x  dp->d_name.name %s  code %d\n",
                 ip->i_mode, dp->d_name.name, code);
+#ifdef STRUCT_INODE_HAS_I_SECURITY
+       if (ip->i_security == NULL) {
+           if (security_inode_alloc(ip))
+               panic("afs_linux_lookup: Cannot allocate inode security");
+       }
+#endif
 #else
        if (S_ISDIR(ip->i_mode))
            ip->i_op = &afs_dir_iops;