Skip to content

Commit 7d3e8d2

Browse files
dubeykogregkh
authored andcommitted
ceph: fix a buffer leak in __ceph_setxattr()
commit 5d3cc36 upstream. The old_blob in __ceph_setxattr() can store ci->i_xattrs.prealloc_blob value during the retry. However, it is never called the ceph_buffer_put() for the old_blob object. This patch fixes the issue of the buffer leak. Cc: stable@vger.kernel.org Signed-off-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com> Reviewed-by: Alex Markuze <amarkuze@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent a022656 commit 7d3e8d2

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

fs/ceph/xattr.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1296,6 +1296,7 @@ int __ceph_setxattr(struct inode *inode, const char *name,
12961296

12971297
do_sync:
12981298
spin_unlock(&ci->i_ceph_lock);
1299+
ceph_buffer_put(old_blob);
12991300
do_sync_unlocked:
13001301
if (lock_snap_rwsem)
13011302
up_read(&mdsc->snap_rwsem);

0 commit comments

Comments
 (0)