aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2013-08-30 09:17:33 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2013-08-30 09:19:34 -0400
commit2d9db75005effd6d4e0c8be4f74922e4f413fbe5 (patch)
treeaa90d75eb0610c8fdc07d5b5a936acce3a0c4316
parent6686390bab6a0e049fa7040631aee08b35a55293 (diff)
NFS: Fix up two use-after-free issues with the new tracing code
We don't want to pass the context argument to trace_nfs_atomic_open_exit() after it has been released. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--fs/nfs/dir.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 4ce7f7696e11..d8149e916dd7 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -1399,7 +1399,6 @@ static int nfs_finish_open(struct nfs_open_context *ctx,
1399 nfs_file_set_open_context(file, ctx); 1399 nfs_file_set_open_context(file, ctx);
1400 1400
1401out: 1401out:
1402 put_nfs_open_context(ctx);
1403 return err; 1402 return err;
1404} 1403}
1405 1404
@@ -1460,9 +1459,9 @@ int nfs_atomic_open(struct inode *dir, struct dentry *dentry,
1460 inode = NFS_PROTO(dir)->open_context(dir, ctx, open_flags, &attr); 1459 inode = NFS_PROTO(dir)->open_context(dir, ctx, open_flags, &attr);
1461 nfs_unblock_sillyrename(dentry->d_parent); 1460 nfs_unblock_sillyrename(dentry->d_parent);
1462 if (IS_ERR(inode)) { 1461 if (IS_ERR(inode)) {
1463 put_nfs_open_context(ctx);
1464 err = PTR_ERR(inode); 1462 err = PTR_ERR(inode);
1465 trace_nfs_atomic_open_exit(dir, ctx, open_flags, err); 1463 trace_nfs_atomic_open_exit(dir, ctx, open_flags, err);
1464 put_nfs_open_context(ctx);
1466 switch (err) { 1465 switch (err) {
1467 case -ENOENT: 1466 case -ENOENT:
1468 d_drop(dentry); 1467 d_drop(dentry);
@@ -1484,6 +1483,7 @@ int nfs_atomic_open(struct inode *dir, struct dentry *dentry,
1484 1483
1485 err = nfs_finish_open(ctx, ctx->dentry, file, open_flags, opened); 1484 err = nfs_finish_open(ctx, ctx->dentry, file, open_flags, opened);
1486 trace_nfs_atomic_open_exit(dir, ctx, open_flags, err); 1485 trace_nfs_atomic_open_exit(dir, ctx, open_flags, err);
1486 put_nfs_open_context(ctx);
1487out: 1487out:
1488 return err; 1488 return err;
1489 1489