diff options
| author | Attilio Rao <attilio@FreeBSD.org> | 2012-11-19 22:43:45 +0000 |
|---|---|---|
| committer | Attilio Rao <attilio@FreeBSD.org> | 2012-11-19 22:43:45 +0000 |
| commit | c6e0355cee63fe6338c72bc1fcfc849ae60c03dd (patch) | |
| tree | 74991dff07f38b2ff87b7e8e75d2f6d55750135d | |
| parent | 49f4a268d5bb21f7e3c6f20e2923b242f920e12d (diff) | |
Notes
| -rw-r--r-- | sys/fs/ext2fs/ext2_vfsops.c | 8 | ||||
| -rw-r--r-- | sys/fs/msdosfs/msdosfs_denode.c | 6 | ||||
| -rw-r--r-- | sys/fs/nfsclient/nfs_clnode.c | 6 | ||||
| -rw-r--r-- | sys/fs/nfsclient/nfs_clport.c | 6 | ||||
| -rw-r--r-- | sys/fs/nullfs/null_subr.c | 4 | ||||
| -rw-r--r-- | sys/fs/unionfs/union_subr.c | 6 | ||||
| -rw-r--r-- | sys/gnu/fs/reiserfs/reiserfs_inode.c | 7 | ||||
| -rw-r--r-- | sys/nfsclient/nfs_node.c | 6 | ||||
| -rw-r--r-- | sys/ufs/ffs/ffs_vfsops.c | 8 |
9 files changed, 0 insertions, 57 deletions
diff --git a/sys/fs/ext2fs/ext2_vfsops.c b/sys/fs/ext2fs/ext2_vfsops.c index 147b9b86365f7..7447558919a3a 100644 --- a/sys/fs/ext2fs/ext2_vfsops.c +++ b/sys/fs/ext2fs/ext2_vfsops.c @@ -905,14 +905,6 @@ ext2_vget(struct mount *mp, ino_t ino, int flags, struct vnode **vpp) ump = VFSTOEXT2(mp); dev = ump->um_dev; - - /* - * If this malloc() is performed after the getnewvnode() - * it might block, leaving a vnode with a NULL v_data to be - * found by ext2_sync() if a sync happens to fire right then, - * which will cause a panic because ext2_sync() blindly - * dereferences vp->v_data (as well it should). - */ ip = malloc(sizeof(struct inode), M_EXT2NODE, M_WAITOK | M_ZERO); /* Allocate a new vnode/inode. */ diff --git a/sys/fs/msdosfs/msdosfs_denode.c b/sys/fs/msdosfs/msdosfs_denode.c index c10fcf9c120bc..cbaa54da851e9 100644 --- a/sys/fs/msdosfs/msdosfs_denode.c +++ b/sys/fs/msdosfs/msdosfs_denode.c @@ -142,12 +142,6 @@ deget(pmp, dirclust, diroffset, depp) KASSERT((*depp)->de_diroffset == diroffset, ("wrong diroffset")); return (0); } - - /* - * Do the malloc before the getnewvnode since doing so afterward - * might cause a bogus v_data pointer to get dereferenced - * elsewhere if malloc should block. - */ ldep = malloc(sizeof(struct denode), M_MSDOSFSNODE, M_WAITOK | M_ZERO); /* diff --git a/sys/fs/nfsclient/nfs_clnode.c b/sys/fs/nfsclient/nfs_clnode.c index d7219318bf258..eaaec9cb950e5 100644 --- a/sys/fs/nfsclient/nfs_clnode.c +++ b/sys/fs/nfsclient/nfs_clnode.c @@ -122,12 +122,6 @@ ncl_nget(struct mount *mntp, u_int8_t *fhp, int fhsize, struct nfsnode **npp, *npp = VTONFS(nvp); return (0); } - - /* - * Allocate before getnewvnode since doing so afterward - * might cause a bogus v_data pointer to get dereferenced - * elsewhere if zalloc should block. - */ np = uma_zalloc(newnfsnode_zone, M_WAITOK | M_ZERO); error = getnewvnode("newnfs", mntp, &newnfs_vnodeops, &nvp); diff --git a/sys/fs/nfsclient/nfs_clport.c b/sys/fs/nfsclient/nfs_clport.c index 0257a4c6d43ae..1cbf325058c5e 100644 --- a/sys/fs/nfsclient/nfs_clport.c +++ b/sys/fs/nfsclient/nfs_clport.c @@ -197,12 +197,6 @@ nfscl_nget(struct mount *mntp, struct vnode *dvp, struct nfsfh *nfhp, FREE((caddr_t)nfhp, M_NFSFH); return (0); } - - /* - * Allocate before getnewvnode since doing so afterward - * might cause a bogus v_data pointer to get dereferenced - * elsewhere if zalloc should block. - */ np = uma_zalloc(newnfsnode_zone, M_WAITOK | M_ZERO); error = getnewvnode("newnfs", mntp, &newnfs_vnodeops, &nvp); diff --git a/sys/fs/nullfs/null_subr.c b/sys/fs/nullfs/null_subr.c index 5f926a6eb664c..078edeab82919 100644 --- a/sys/fs/nullfs/null_subr.c +++ b/sys/fs/nullfs/null_subr.c @@ -236,10 +236,6 @@ null_nodeget(mp, lowervp, vpp) * duplicates later, when adding new vnode to hash. * Note that duplicate can only appear in hash if the lowervp is * locked LK_SHARED. - * - * Do the MALLOC before the getnewvnode since doing so afterward - * might cause a bogus v_data pointer to get dereferenced - * elsewhere if MALLOC should block. */ xp = malloc(sizeof(struct null_node), M_NULLFSNODE, M_WAITOK); diff --git a/sys/fs/unionfs/union_subr.c b/sys/fs/unionfs/union_subr.c index 64bd4acec35b9..e3391a7f76966 100644 --- a/sys/fs/unionfs/union_subr.c +++ b/sys/fs/unionfs/union_subr.c @@ -247,12 +247,6 @@ unionfs_nodeget(struct mount *mp, struct vnode *uppervp, if (dvp == NULLVP) return (EINVAL); } - - /* - * Do the MALLOC before the getnewvnode since doing so afterward - * might cause a bogus v_data pointer to get dereferenced elsewhere - * if MALLOC should block. - */ unp = malloc(sizeof(struct unionfs_node), M_UNIONFSNODE, M_WAITOK | M_ZERO); diff --git a/sys/gnu/fs/reiserfs/reiserfs_inode.c b/sys/gnu/fs/reiserfs/reiserfs_inode.c index d9511025f7eb9..1c5207c60f8d4 100644 --- a/sys/gnu/fs/reiserfs/reiserfs_inode.c +++ b/sys/gnu/fs/reiserfs/reiserfs_inode.c @@ -757,13 +757,6 @@ reiserfs_iget( rmp = VFSTOREISERFS(mp); dev = rmp->rm_dev; - /* - * If this malloc() is performed after the getnewvnode() it might - * block, leaving a vnode with a NULL v_data to be found by - * reiserfs_sync() if a sync happens to fire right then, which - * will cause a panic because reiserfs_sync() blindly dereferences - * vp->v_data (as well it should). - */ reiserfs_log(LOG_DEBUG, "malloc(struct reiserfs_node)\n"); ip = malloc(sizeof(struct reiserfs_node), M_REISERFSNODE, M_WAITOK | M_ZERO); diff --git a/sys/nfsclient/nfs_node.c b/sys/nfsclient/nfs_node.c index 3805f6c38fe19..cee4343156b35 100644 --- a/sys/nfsclient/nfs_node.c +++ b/sys/nfsclient/nfs_node.c @@ -128,12 +128,6 @@ nfs_nget(struct mount *mntp, nfsfh_t *fhp, int fhsize, struct nfsnode **npp, int *npp = VTONFS(nvp); return (0); } - - /* - * Allocate before getnewvnode since doing so afterward - * might cause a bogus v_data pointer to get dereferenced - * elsewhere if zalloc should block. - */ np = uma_zalloc(nfsnode_zone, M_WAITOK | M_ZERO); error = getnewvnode("nfs", mntp, &nfs_vnodeops, &nvp); diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 0a43d80801114..83ae2023e2495 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -1676,14 +1676,6 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags) ump = VFSTOUFS(mp); dev = ump->um_dev; fs = ump->um_fs; - - /* - * If this malloc() is performed after the getnewvnode() - * it might block, leaving a vnode with a NULL v_data to be - * found by ffs_sync() if a sync happens to fire right then, - * which will cause a panic because ffs_sync() blindly - * dereferences vp->v_data (as well it should). - */ ip = uma_zalloc(uma_inode, M_WAITOK | M_ZERO); /* Allocate a new vnode/inode. */ |
