cifs: fix potential use-after-free in cifs_oplock_break_put
Subsystems (2)
PATCH 1/1 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 <[email protected]>
--- fs/cifs/file.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
fs/cifs/file.c +3 -1
@@ -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 = {
Signature · 1 line
1.7.2.3
A message that is not in the archive (sent off-list or not yet received): 1289402350-14218-1-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Suresh Jayaraman
Reviewed-byQuoted 13 lines · Jeff Layton
cfile may very well be freed after the
cifsFileInfo_put. Make sure we have a valid pointer to the superblock forcifs_sb_deactive.Signed-off-by Jeff Layton <[email protected]>--- fs/cifs/file.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)fs/cifs/file.c +0
-0
fs/cifs/file.c void cifs_oplock_break_get(struct cifsFileInfo *cfile) · line 2279
Quoted 10 lines
fs/cifs/file.c +3
-1@@ -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); }
Looks correct to me.
Reviewed-by Suresh Jayaraman <[email protected]>