summaryrefslogtreecommitdiffstats
path: root/fs/cifs/file.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2010-11-10 10:19:10 -0500
committerSteve French <sfrench@us.ibm.com>2010-11-10 15:37:17 +0000
commitebe2e91e000c59aed0300d81815f451c85e0bda6 (patch)
treefc3f70522b873aba4cae89c963386a890d24fa5c /fs/cifs/file.c
parentf6614b7bb405a9b35dd28baea989a749492c46b2 (diff)
downloadop-kernel-dev-ebe2e91e000c59aed0300d81815f451c85e0bda6.zip
op-kernel-dev-ebe2e91e000c59aed0300d81815f451c85e0bda6.tar.gz
cifs: fix potential use-after-free in cifs_oplock_break_put
cfile may very well be freed after the cifsFileInfo_put. Make sure we have a valid pointer to the superblock for cifs_sb_deactive. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r--fs/cifs/file.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 06c3e83..b857ce5 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -2271,8 +2271,10 @@ void cifs_oplock_break_get(struct cifsFileInfo *cfile)
void cifs_oplock_break_put(struct cifsFileInfo *cfile)
{
+ struct super_block *sb = cfile->dentry->d_sb;
+
cifsFileInfo_put(cfile);
- cifs_sb_deactive(cfile->dentry->d_sb);
+ cifs_sb_deactive(sb);
}
const struct address_space_operations cifs_addr_ops = {
OpenPOWER on IntegriCloud